From: Andrew Fitzgibbon <awf@ro...>  20021102 14:25:59

> I have defined a class CMyCostFunction as : > > class CMyCostFunction :: vnl_cost_function(16){ > ... > double f(vnl_vector<double>&x) { > // here is the expression of my cost function > } > } > and then in the main program I did : > > CMyCostFunction * m_S ; > double f = 0.0 ; > m_S>compute(p_vector, &f, 0) ; // p_vector is a > vnl_vector<double> > that I have computed earlier > vnl_powell l_powell(m_S) ; > > and then I call the minimization and this object by : > l_powell.minimize(l_res); Try vnl/examples/vnl_rosenbrock.cxx http://www.isbe.man.ac.uk/public_vxl_doc/vxl/vnl/html/vnl_rosenbrock.cxx source.html This shows how to use many minimizers to minimize the "Rosenbrock" standard test function (see http://www.esat.kuleuven.ac.be/~targetjr/www.robots.ox.ac.uk/vxl/book/bo ok_6.html#SEC50 ) A. 