daviddoria / Examples

Many examples of many features of many software packages
233 stars 130 forks source link

What is the math function in this example? #6

Open xiaojieguo opened 8 years ago

xiaojieguo commented 8 years ago

Hi, I want to use LM algorithm in my application. Could you show me the function in LMTest.cpp ?

daviddoria commented 8 years ago

I'm not sure what you mean - the function f() is defined as: fx(0) = pow(x(0) - 2, 2) + pow(x(1) - 4, 2);

which is f(x) = (x(0)-2)^2 + (x(1) - 4)^2

xiaojieguo commented 8 years ago

Thanks. I made a mistake . But I have another question. What does the second parameter mean in _vnl_least_squares_function (unsigned int number_of_unknowns, unsigned int number_of_residuals, UseGradient g=usegradient) ? Here _number_ofresiduals >= _number_ofunknowns, is it right? I am confused about _number_ofresiduals.

daviddoria commented 8 years ago

Sorry, you'll have to ask the VNL folks about this.