Standard concrete class for multi-dimensional function object.
More...
#include <cfl/MultiFunction.hpp>
Inherits function< double(std::valarray< double >)>.
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
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
-
dV | The value of the function. |
iDim | The dimension of the function. |
Constructs *this
from dynamically allocated implementation of IMultiFunction.
- Parameters
-
pNewF | A pointer to dynamically allocated implementation of the interface class IMultiFunction. |
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
-
rX | The 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
-
rX | The 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.
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
-
rF | A constant reference to a multi-dimensional function object. The dimension of this function should equal to the dimension of *this . |
- Returns
- Reference to
*this
.
Replaces *this
with the product of *this
and dV.
- Parameters
-
dV | The number to be multiplied by the function. |
- Returns
- Reference to
*this
.
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
-
rF | A constant reference to a multi-dimensional function object. The dimension of this function should equal to the dimension of *this . |
- Returns
- Reference to
*this
.
Replaces *this
with the sum of *this
and dV.
- Parameters
-
dV | The number to be added to the function. |
- Returns
- Reference to
*this
.
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
-
rF | A constant reference to a multi-dimensional function object. The dimension of this function should equal to the dimension of *this . |
- Returns
- Reference to
*this
.
Replaces *this
with the difference between *this
and dV.
- Parameters
-
dV | The number to be subtracted from the function. |
- Returns
- Reference to
*this
.
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
-
rF | A constant reference to a multi-dimensional function object. The dimension of this function should equal to the dimension of *this . |
- Returns
- Reference to
*this
.
Replaces *this
with the ratio of *this
and dV.
- Parameters
-
- Returns
- Reference to
*this
.
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
-
dV | The value of the function. |
- Returns
- Reference to
*this
.
The documentation for this class was generated from the following file: