core/vnl/algo/vnl_discrete_diff.h
Go to the documentation of this file.
00001 #ifndef vnl_discrete_diff_h_
00002 #define vnl_discrete_diff_h_
00003 //:
00004 // \file
00005 // \brief Functions to compute jacobians of vnl_least_squares_functions
00006 //
00007 // Functions to compute jacobians of vnl_least_squares_functions
00008 // by discrete differences.  They return false on failure and
00009 // true on success.
00010 //
00011 // \verbatim
00012 // name size    description
00013 //
00014 // lsf  ---     the function.
00015 // h    1 or n  step size (scalar or a vector).
00016 // x    n       point at which to evaluate the derivative of the function.
00017 // y    m       value of the function at x.
00018 // J    mxn     jacobian of the function at x.
00019 // \endverbatim
00020 //
00021 // \author fsm
00022 //
00023 // \verbatim
00024 //  Modifications
00025 //   dac (Manchester) 28/03/2001: tidied up documentation
00026 //   Peter Vanroose   27/05/2001: Corrected documentation
00027 // \endverbatim
00028 
00029 #include <vnl/vnl_vector.h>
00030 #include <vnl/vnl_matrix.h>
00031 class vnl_least_squares_function;
00032 
00033 //: forward differences
00034 //  \relatesalso vnl_least_squares_function
00035 bool vnl_discrete_diff_fwd(vnl_least_squares_function *lsf,
00036                            double h,
00037                            vnl_vector<double> const &x,
00038                            vnl_matrix<double>       &J);
00039 
00040 //: forward differences
00041 //  \relatesalso vnl_least_squares_function
00042 bool vnl_discrete_diff_fwd(vnl_least_squares_function *lsf,
00043                            vnl_vector<double> const &h,
00044                            vnl_vector<double> const &x,
00045                            vnl_matrix<double>       &J);
00046 
00047 //: forward differences
00048 //  \relatesalso vnl_least_squares_function
00049 bool vnl_discrete_diff_fwd(vnl_least_squares_function *lsf,
00050                            vnl_vector<double> const &h,
00051                            vnl_vector<double> const &x,
00052                            vnl_vector<double> const &y,
00053                            vnl_matrix<double>       &J);
00054 
00055 //: symmetric differences
00056 //  \relatesalso vnl_least_squares_function
00057 bool vnl_discrete_diff_sym(vnl_least_squares_function *lsf,
00058                            double h,
00059                            vnl_vector<double> const &x,
00060                            vnl_matrix<double>       &J);
00061 
00062 //: symmetric differences
00063 //  \relatesalso vnl_least_squares_function
00064 bool vnl_discrete_diff_sym(vnl_least_squares_function *lsf,
00065                            vnl_vector<double> const &h,
00066                            vnl_vector<double> const &x,
00067                            vnl_matrix<double>       &J);
00068 
00069 void vnl_discrete_diff_test_lsf(vnl_least_squares_function *lsf, vnl_vector<double> const &x);
00070 
00071 #endif // vnl_discrete_diff_h_