[Bug 463] DimensionSet function doesn't work like expected.
| Submitted by fcauwe on Fri, 2007-12-21 23:49. |
For more infomation about this bug, visit <https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=463>
--- 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 <https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=463>
--- Comment #5 from Tinne De Laet <tinne delaet [..] > 2008-01-02 14:07:44 ---Created an attachment (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 <https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=463>
--- Comment #6 from François Cauwe <francois [..] > 2008-01-02 17:13:26 ---It seems fine for me.