CFL
Public Member Functions | List of all members
cfl::MultiFunction Class Reference

Standard concrete class for multi-dimensional function object. More...

#include <cfl/MultiFunction.hpp>

Inherits function< double(std::valarray< double >)>.

Public Member Functions

 MultiFunction (double dV=0, unsigned iDim=1)
 
 MultiFunction (IMultiFunction *pNewF)
 
bool belongs (const std::valarray< double > &rX) const
 
unsigned dim () const
 
double operator() (const std::valarray< double > &rX) const
 
MultiFunctionoperator*= (const MultiFunction &rF)
 
MultiFunctionoperator*= (double dV)
 
MultiFunctionoperator+= (const MultiFunction &rF)
 
MultiFunctionoperator+= (double dV)
 
MultiFunctionoperator-= (const MultiFunction &rF)
 
MultiFunctionoperator-= (double dV)
 
MultiFunctionoperator/= (const MultiFunction &rF)
 
MultiFunctionoperator/= (double dV)
 
MultiFunctionoperator= (double dV)
 

Detailed Description

This is the standard class for a multi-dimensional function object. It is constructed by a dynamically allocated object derived from the interface IMultiFunction.

See also
IMultiFunction

Constructor & Destructor Documentation

cfl::MultiFunction::MultiFunction ( double  dV = 0,
unsigned  iDim = 1 
)
explicit

Constructs constant function with the value dV and the dimension iDim. The domain of the function equals the whole space.

Parameters
dVThe value of the function.
iDimThe dimension of the function.
cfl::MultiFunction::MultiFunction ( IMultiFunction pNewF)
explicit

Constructs *this from dynamically allocated implementation of IMultiFunction.

Parameters
pNewFA pointer to dynamically allocated implementation of the interface class IMultiFunction.

Member Function Documentation

bool cfl::MultiFunction::belongs ( const std::valarray< double > &  rX) const

Returns true if argument belongs to the domain of the function. Returns false otherwise.

Parameters
rXThe argument of the function. The size of this array should equal the dimension of the function.
Returns
True if argument belongs to the domain of the function and false otherwise.
unsigned cfl::MultiFunction::dim ( ) const

Returns the dimension of the function.

Returns
The dimension of the function.
double cfl::MultiFunction::operator() ( const std::valarray< double > &  rX) const

Returns the value of the function for given argument.

Parameters
rXThe argument of the function. The size of this array should equal the dimension of the function.
Returns
The value of *this at the point rX.
MultiFunction& cfl::MultiFunction::operator*= ( const MultiFunction rF)

Assigns to *this the product of *this and rF. The new domain of *this equals the intersection of its old domain with the domain of rF. A deep copy of rF is created inside of *this.

Parameters
rFA constant reference to a multi-dimensional function object. The dimension of this function should equal to the dimension of *this.
Returns
Reference to *this.
MultiFunction& cfl::MultiFunction::operator*= ( double  dV)

Replaces *this with the product of *this and dV.

Parameters
dVThe number to be multiplied by the function.
Returns
Reference to *this.
MultiFunction& cfl::MultiFunction::operator+= ( const MultiFunction rF)

Assigns to *this the sum of *this and rF. The new domain of *this equals the intersection of its old domain with the domain of rF. A deep copy of rF is created inside of *this.

Parameters
rFA constant reference to a multi-dimensional function object. The dimension of this function should equal to the dimension of *this.
Returns
Reference to *this.
MultiFunction& cfl::MultiFunction::operator+= ( double  dV)

Replaces *this with the sum of *this and dV.

Parameters
dVThe number to be added to the function.
Returns
Reference to *this.
MultiFunction& cfl::MultiFunction::operator-= ( const MultiFunction rF)

Assigns to *this the difference between *this and rF. The new domain of *this equals the intersection of its old domain with the domain of rF. A deep copy of rF is created inside of *this.

Parameters
rFA constant reference to a multi-dimensional function object. The dimension of this function should equal to the dimension of *this.
Returns
Reference to *this.
MultiFunction& cfl::MultiFunction::operator-= ( double  dV)

Replaces *this with the difference between *this and dV.

Parameters
dVThe number to be subtracted from the function.
Returns
Reference to *this.
MultiFunction& cfl::MultiFunction::operator/= ( const MultiFunction rF)

Assigns to *this the ratio of *this and rF. The new domain of *this equals the intersection of its old domain with the domain of rF. A deep copy of rF is created inside of *this.

Parameters
rFA constant reference to a multi-dimensional function object. The dimension of this function should equal to the dimension of *this.
Returns
Reference to *this.
MultiFunction& cfl::MultiFunction::operator/= ( double  dV)

Replaces *this with the ratio of *this and dV.

Parameters
dVThe divisor number.
Returns
Reference to *this.
MultiFunction& cfl::MultiFunction::operator= ( double  dV)

Assigns to *this the constant function with the value dV. The dimension of the function does not change. The domain equals the whole space.

Parameters
dVThe value of the function.
Returns
Reference to *this.

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