[Insight-developers] Purify errors : CostFunctions and Metrics

Luis Ibanez luis.ibanez@kitware.com
Wed, 06 Mar 2002 23:53:51 -0500


In order to get rid of the errors pointed out by Purify
the ivars m_Parameters were removed from CostFunction.

This ivar was there due to a missunderstanding of the
way vnl_optimizers managed the passage of parameters
at the end of the optimization problem.

Along the same lines, the ivars m_Measure and
m_MeasureDerivatives were removed from the metrics.

Additionally the methods GetValue() GetDerivative()
and GetValueAndDerivative() were changed to "const"
in all the hierarchy of CostFunctions (which include the
metrics).

The signature of GetDerivative() was also changed.
now instead of returninng a DerivativeType, it is returning
void and passing the Derivative by reference in the
second argument.  In a way similat to GetValueAndDerivative();


After these changes AlgorithmTest is compiling under VC++.
It remains to be seen how the tests will behave at run time....


Luis