#include <Nonlinreg.hh>
Public Methods | |
Nonlinfunc_ (size_t NX, size_t NP, size_t NY) | |
Init to calculate a nonlinear regression for NX independent variables, NP parameters and NY dependent variables. | |
size_t | nx () const |
Returns the number of the independent variables. | |
size_t | np () const |
Returns the number of the parameters. | |
size_t | ny () const |
Returns the number of the dependent variables. | |
virtual int | f (const Vecdbl_ &X, const Vecdbl_ &P, Vecdbl_ &Y)=0 |
f(X, P, Y): calculates f(X) with parameter vector P and puts the result into Y. More... | |
int | jac (const Vecdbl_ &X, const Vecdbl_ &P, Vecdbl_ &Y, Rmatdbl_ &J) |
jac(X, P, Y, J): calculates the Jacobian matrix J=dY/dP by a simple approximation. More... | |
Private Attributes | |
size_t | Nx |
size_t | Np |
size_t | Ny |
vector sizes. |
The nonlinear function is specified by overloading the pure virtual f() method. A virtual jac() method is provided for approximating the Jacobian. Analytical Jacobians may be implemented by overloading jac() in the derived class. Rudimentary error reporting is provided.
Definition at line 33 of file Nonlinreg.hh.
|
Init to calculate a nonlinear regression for NX independent variables, NP parameters and NY dependent variables.
Definition at line 48 of file Nonlinreg.hh. |
|
Returns the number of the independent variables.
Definition at line 52 of file Nonlinreg.hh. |
|
Returns the number of the parameters.
Definition at line 55 of file Nonlinreg.hh. |
|
Returns the number of the dependent variables.
Definition at line 58 of file Nonlinreg.hh. |
|
f(X, P, Y): calculates f(X) with parameter vector P and puts the result into Y. Return value: 0 if OK, non-0 on error. Not const because derived classes may modify internal data. |
|
jac(X, P, Y, J): calculates the Jacobian matrix J=dY/dP by a simple approximation. Y==f(X, P). The Jacobian is calculated subject to P normalisation, i.e. J[i][k]=dY[i]/dP[k]*p[k]. Return value: 0 if OK, non-0 on error. Not const because derived classes may modify internal data. |
|
Definition at line 38 of file Nonlinreg.hh. |
|
Definition at line 38 of file Nonlinreg.hh. |
|
vector sizes.
Definition at line 38 of file Nonlinreg.hh. |