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

Concrete class for a one-dimensional function. More...

#include <cfl/Function.hpp>

Inherits function< double(double)>.

Public Member Functions

 Function (double dV=0., double dLeft=-std::numeric_limits< double >::max(), double dRight=std::numeric_limits< double >::max())
 
 Function (IFunction *pNewP)
 
bool belongs (double dX) const
 
double operator() (double dX) const
 
Functionoperator*= (const Function &rF)
 
Functionoperator*= (double dV)
 
Functionoperator+= (const Function &rF)
 
Functionoperator+= (double dV)
 
Functionoperator-= (const Function &rF)
 
Functionoperator-= (double dV)
 
Functionoperator/= (const Function &rF)
 
Functionoperator/= (double dV)
 
Functionoperator= (double dV)
 

Detailed Description

The standard class for a one-dimensional function. It is implemented by a dynamically allocated object derived from the interface class IFunction.

See also
IFunction, MultiFunction, IMultiFunction

Constructor & Destructor Documentation

cfl::Function::Function ( double  dV = 0.,
double  dLeft = -std::numeric_limits< double >::max(),
double  dRight = std::numeric_limits< double >::max() 
)
explicit

Constructs constant function with the value dV on the interval [dLeft, dRight].

Parameters
dVThe value of the function.
dLeftThe left point of the domain.
dRightThe right point of the domain.
cfl::Function::Function ( IFunction pNewP)
explicit

Constructs *this from a dynamically allocated implementation of IFunction.

Parameters
pNewPThe pointer to a dynamically allocated implementation of IFunction.

Member Function Documentation

bool cfl::Function::belongs ( double  dX) const

Tests whether an argument belongs to the domain of the function.

Parameters
dXThe argument.
Returns
The function returns true if the argument dX belongs to the domain of the function. Returns false otherwise.
double cfl::Function::operator() ( double  dX) const

Standard functional operator.

Parameters
dXThe argument.
Returns
The value of the function at dX.
Function& cfl::Function::operator*= ( const Function rF)

Replaces *this with 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
rFConstant reference to the multiplier.
Returns
Reference to *this.
Function& cfl::Function::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.
Function& cfl::Function::operator+= ( const Function rF)

Replaces *this with 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
rFConstant reference to the function that will be added.
Returns
Reference to *this.
Function& cfl::Function::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.
Function& cfl::Function::operator-= ( const Function rF)

Replaces *this with 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
rFConstant reference to the function that will be subtracted.
Returns
Reference to *this.
Function& cfl::Function::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.
Function& cfl::Function::operator/= ( const Function rF)

Replaces *this with the ratio 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
rFThe divisor function.
Returns
Reference to *this.
Function& cfl::Function::operator/= ( double  dV)

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

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

Assigns to *this the constant function with the value dV. The domain becomes equal the real line.

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

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