[Bug 463] DimensionSet function doesn't work like expected.

For more infomation about this bug, visit

--- Comment #4 from François Cauwe <francois [..] ...> 2007-12-22 00:49:00 ---
I propose to remove the function DimensionSet, like discussed in [1].
The only place where it is called outside the class itself is in:
./filterproposaldensity.cpp:
_TmpPrior->DimensionSet(SysModel->StateSizeGet());

There it is meant for the initialisation of _TmpPrior. _TmpPrior is a gaussian,
and no code really handles the dimensionSet function(only changes the
variable). However this methode works because of:

Gaussian::ExpectedValueSet (const ColumnVector& mu)
{
_Mu = mu;
if (this->DimensionGet() == 0)
{
this->DimensionSet(mu.rows());
}
assert(this->DimensionGet() == mu.rows());
}

If you first call DimensionSet(3) and then set the expectedValue with mu 1x3,
it works, but the covariance might still be wrong.

Also the line _TmpPrior->DimensionSet(SysModel->StateSizeGet()); is not
needed for initialisation, because the first time you call ExpectedValueSet it
will set the right dimension, as shown in bug #465.

[1] http://lists.mech.kuleuven.be/pipermail/bfl/2007-December/000822.html

[Bug 463] DimensionSet function doesn't work like expected.

For more infomation about this bug, visit

--- Comment #5 from Tinne De Laet <tinne [dot] delaet [..] ...> 2008-01-02 14:07:44 ---
Created an attachment (id=179)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=179)
Changes the dimensionSet to a protected function

In the proposed patch, I made the dimensionSet function protected.
Like this _dimension stays private and the helper-function dimensionSet can
also be called by the daughterclasses.

Tinne

[Bug 463] DimensionSet function doesn't work like expected.

For more infomation about this bug, visit

--- Comment #6 from François Cauwe <francois [..] ...> 2008-01-02 17:13:26 ---
It seems fine for me.