Concrete class for a one-dimensional function.
More...
#include <cfl/Function.hpp>
Inherits function< double(double)>.
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
Constructs constant function with the value dV on the interval [dLeft, dRight].
- Parameters
-
dV | The value of the function. |
dLeft | The left point of the domain. |
dRight | The right point of the domain. |
Constructs *this
from a dynamically allocated implementation of IFunction.
- Parameters
-
pNewP | The pointer to a dynamically allocated implementation of IFunction. |
bool cfl::Function::belongs |
( |
double |
dX | ) |
const |
Tests whether an argument belongs to the domain of the function.
- Parameters
-
- 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
-
- Returns
- The value of the function at dX.
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
-
rF | Constant reference to the multiplier. |
- Returns
- Reference to
*this
.
Function& cfl::Function::operator*= |
( |
double |
dV | ) |
|
Replaces *this
with the product of *this
and dV.
- Parameters
-
dV | The number to be multiplied by the function. |
- Returns
- Reference to
*this
.
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
-
rF | Constant 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
-
dV | The number to be added to the function. |
- Returns
- Reference to
*this
.
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
-
rF | Constant 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
-
dV | The number to be subtracted from the function. |
- Returns
- Reference to
*this
.
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
-
- Returns
- Reference to
*this
.
Function& cfl::Function::operator/= |
( |
double |
dV | ) |
|
Replaces *this
with the ratio of *this
and dV.
- Parameters
-
- 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
-
dV | The value of the function. |
- Returns
- Reference to
*this
.
The documentation for this class was generated from the following file: