Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

RazorBack::Nonlinfunc_ Class Reference

Class Nonlinfunc_: this is an abstract base class for function objects that can be used by the Nonlinreg_ class. More...

#include <Nonlinreg.hh>

List of all members.

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.


Detailed Description

Class Nonlinfunc_: this is an abstract base class for function objects that can be used by the Nonlinreg_ class.

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.


Constructor & Destructor Documentation

RazorBack::Nonlinfunc_::Nonlinfunc_ ( size_t NX,
size_t NP,
size_t NY ) [inline]
 

Init to calculate a nonlinear regression for NX independent variables, NP parameters and NY dependent variables.

Definition at line 48 of file Nonlinreg.hh.


Member Function Documentation

size_t RazorBack::Nonlinfunc_::nx ( ) const [inline]
 

Returns the number of the independent variables.

Definition at line 52 of file Nonlinreg.hh.

size_t RazorBack::Nonlinfunc_::np ( ) const [inline]
 

Returns the number of the parameters.

Definition at line 55 of file Nonlinreg.hh.

size_t RazorBack::Nonlinfunc_::ny ( ) const [inline]
 

Returns the number of the dependent variables.

Definition at line 58 of file Nonlinreg.hh.

int RazorBack::Nonlinfunc_::f ( const Vecdbl_ & X,
const Vecdbl_ & P,
Vecdbl_ & Y ) [pure virtual]
 

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.

int RazorBack::Nonlinfunc_::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.

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.


Member Data Documentation

size_t RazorBack::Nonlinfunc_::Nx [private]
 

Definition at line 38 of file Nonlinreg.hh.

size_t RazorBack::Nonlinfunc_::Np [private]
 

Definition at line 38 of file Nonlinreg.hh.

size_t RazorBack::Nonlinfunc_::Ny [private]
 

vector sizes.

Definition at line 38 of file Nonlinreg.hh.


The documentation for this class was generated from the following file:
Generated at Wed Aug 21 09:33:17 2002 for The Razorback C++ Library: Statistics by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001