[vtk-developers] vtkAmoebaMinimizer
Will Schroeder
will.schroeder at kitware.com
Wed Jun 12 07:06:16 EDT 2002
Hi David-
A couple of things about the class vtkAmoebaMinimizer:
1. There is a memory leak (see the Purify results that we finally got to
work). It looks like in the method SetParameterBracket:
char **newParameterNames = new char *[n];
double *newParameters = new double[n];
double (*newParameterBrackets)[2] = new double[n][2];
followed later by
this->ParameterNames = newParameterNames;
this->Parameters = newParameters;
this->ParameterBrackets = newParameterBrackets;
you are not freeing memory of these ivars prior to assigning them the
pointers to the allocated memory.
2. I find the use of the word "bracket" as in SetParameterBracket() to be
less than ideal. How about SetParameterRange() ? Even in your documentation
you describe the method with the word "range" so I think it's a better word
than "bracket."
Will
More information about the vtk-developers
mailing list