STK++ 0.9.13
STK::IFunction< Function > Class Template Reference

Interface base class for functions. More...

#include <STK_IFunction.h>

Inheritance diagram for STK::IFunction< Function >:
Inheritance graph

Public Member Functions

Real operator() (Real const &x) const
 
Real xmin () const
 
Real xmax () const
 
Real xminImpl () const
 
Real xmaxImpl () const
 
- Public Member Functions inherited from STK::IRecursiveTemplate< Function >
FunctionasDerived ()
 static cast : return a reference of this with a cast to the derived class.
 
Function constasDerived () const
 static cast : return a const reference of this with a cast to the derived class.
 
FunctionasPtrDerived ()
 static cast : return a ptr on a Derived of this with a cast to the derived class.
 
Function constasPtrDerived () const
 static cast : return a ptr on a constant Derived of this with a cast to the derived class.
 
Functionclone () const
 create a leaf using the copy constructor of the Derived class.
 
Functionclone (bool isRef) const
 create a leaf using the copy constructor of the Derived class and a flag determining if the clone is a reference or not.
 

Protected Member Functions

 IFunction ()
 Default Constructor.
 
 ~IFunction ()
 destructor.
 
- Protected Member Functions inherited from STK::IRecursiveTemplate< Function >
 IRecursiveTemplate ()
 constructor.
 
 ~IRecursiveTemplate ()
 destructor.
 

Detailed Description

template<class Function>
class STK::IFunction< Function >

Interface base class for functions.

The IFunction class is the template base class for all functions.

IFunction takes a function template parameter. This parameter is the type of the class which derives from it. For example

class Function: public IFunction<Function>
{...}
Interface base class for functions.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...

The pseudo virtual function defined in this interface and to implement have the following definition:

// return the the value of the function at x
inline Real fImpl(Real x) const;
double Real
STK fundamental type of Real values.

Default implementation of the xmin() and xmax() methods is the interval $(-\infty, +\infty)$. This interface will mainly be used for minimization, maximization or zero finding algorithms.

Definition at line 69 of file STK_IFunction.h.

Constructor & Destructor Documentation

◆ IFunction()

template<class Function >
STK::IFunction< Function >::IFunction ( )
inlineprotected

Default Constructor.

Definition at line 73 of file STK_IFunction.h.

73{}

◆ ~IFunction()

template<class Function >
STK::IFunction< Function >::~IFunction ( )
inlineprotected

destructor.

Definition at line 75 of file STK_IFunction.h.

75{}

Member Function Documentation

◆ operator()()

template<class Function >
Real STK::IFunction< Function >::operator() ( Real const x) const
inline
Returns
the value of the function at x
Parameters
xa real value in the range (xmin, xmax).

Definition at line 81 of file STK_IFunction.h.

81{ return this->asDerived().fImpl(x);}
Function & asDerived()
static cast : return a reference of this with a cast to the derived class.

References STK::IRecursiveTemplate< Function >::asDerived().

◆ xmax()

template<class Function >
Real STK::IFunction< Function >::xmax ( ) const
inline
Returns
the maximal value of the function at x

Definition at line 86 of file STK_IFunction.h.

86{ return this->asDerived().xmaxImpl();}

References STK::IRecursiveTemplate< Function >::asDerived().

◆ xmaxImpl()

template<class Function >
Real STK::IFunction< Function >::xmaxImpl ( ) const
inline
Returns
Default implementation of the maximal value

Definition at line 91 of file STK_IFunction.h.

91{ return Arithmetic<Real>::max();}

◆ xmin()

template<class Function >
Real STK::IFunction< Function >::xmin ( ) const
inline
Returns
the minimal value of the function at x

Definition at line 84 of file STK_IFunction.h.

84{ return this->asDerived().xminImpl();}

References STK::IRecursiveTemplate< Function >::asDerived().

◆ xminImpl()

template<class Function >
Real STK::IFunction< Function >::xminImpl ( ) const
inline
Returns
Default implementation of the minimal value

Definition at line 89 of file STK_IFunction.h.

89{ return -Arithmetic<Real>::max();}

The documentation for this class was generated from the following file: