#include <vnl_least_squares_function.h>
Inheritance diagram for vnl_least_squares_function:
Public Types | |
enum | UseGradient { no_gradient, use_gradient } |
Public Methods | |
vnl_least_squares_function (int number_of_unknowns, int number_of_residuals, UseGradient=use_gradient) | |
virtual | ~vnl_least_squares_function () |
void | throw_failure () |
void | clear_failure () |
virtual void | f (vnl_vector< double > const &x, vnl_vector< double > &fx)=0 |
virtual void | gradf (vnl_vector< double > const &x, vnl_matrix< double > &jacobian) |
virtual void | trace (int iteration, vnl_vector< double > const &x, vnl_vector< double > const &fx) |
double | rms (vnl_vector< double > const &x) |
int | get_number_of_unknowns () const |
int | get_number_of_residuals () const |
bool | has_gradient () const |
Public Attributes | |
bool | failure |
Protected Methods | |
void | init (int number_of_unknowns, int number_of_residuals) |
Protected Attributes | |
int | p_ |
int | n_ |
bool | use_gradient_ |
vcl_string | print_x_fmt_ |
vcl_string | print_f_fmt_ |
Whether or not f ought to be const is a problem. Clients might well want to cache some information during the call, and if they're compute objects, will almost certainly be writing to members during the computation. For the moment it's non-const, but we'll see...
Definition at line 34 of file vnl_least_squares_function.h.
|
Definition at line 36 of file vnl_least_squares_function.h. |
|
Construct vnl_least_squares_function, passing number of parameters. (unknowns, domain dimension) and number of residuals (range dimension). The optional argument should be no_gradient if the gradf function has not been implemented. |
|
|
|
|
|
The main function.\ Given the parameter vector x, compute the vector. of residuals fx. Fx has been sized appropriately before the call. |
|
Return the number of residuals. Definition at line 83 of file vnl_least_squares_function.h. References print_f_fmt_, print_x_fmt_, and use_gradient_. |
|
Return the number of unknowns. Definition at line 79 of file vnl_least_squares_function.h. |
|
Calculate the Jacobian, given the parameter vector x. |
|
Return true if the derived class has indicated that gradf has been implemented. Definition at line 87 of file vnl_least_squares_function.h. |
|
|
|
Compute the rms error at x by calling f and returning the norm of the residual. vector. |
|
|
|
Called after each LM iteration to print debugging etc. |
|
Definition at line 40 of file vnl_least_squares_function.h. |
|
Definition at line 92 of file vnl_least_squares_function.h. Referenced by get_number_of_unknowns(). |
|
Definition at line 91 of file vnl_least_squares_function.h. Referenced by get_number_of_unknowns(). |
|
Definition at line 95 of file vnl_least_squares_function.h. Referenced by get_number_of_residuals(). |
|
Definition at line 94 of file vnl_least_squares_function.h. Referenced by get_number_of_residuals(). |
|
Definition at line 93 of file vnl_least_squares_function.h. Referenced by get_number_of_residuals(). |