Polynomial function representation. More...
#include <polynomialFunction.H>


Public Member Functions | |
| TypeName ("polynomialFunction") | |
| Runtime type information. | |
| polynomialFunction () | |
| Default construct as size 1 with coefficient == 0. | |
| polynomialFunction (const label order) | |
| Construct a particular size, with all coefficients == 0. | |
| polynomialFunction (std::initializer_list< scalar > coeffs) | |
| Construct from an initializer list of coefficients. | |
| polynomialFunction (const UList< scalar > &coeffs) | |
| Construct from a list of coefficients. | |
| polynomialFunction (Istream &is) | |
| Construct from Istream. | |
| virtual | ~polynomialFunction ()=default |
| Destructor. | |
| bool | logActive () const |
| True if the log term is active. | |
| scalar | logCoeff () const |
| The log coefficient. | |
| scalar | value (const scalar x) const |
| Return polynomial value. | |
| scalar | integrate (const scalar x1, const scalar x2) const |
| Integrate between two values. | |
| polynomialFunction | integral (const scalar intConstant=0) const |
| Return integral coefficients. | |
| polynomialFunction | integralMinus1 (const scalar intConstant=0) const |
| Return integral coefficients when lowest order is -1. | |
| bool | operator== (const polynomialFunction &rhs) const |
| Equality of coefficients, and logCoeff (if active). | |
| bool | operator!= (const polynomialFunction &rhs) const |
| polynomialFunction & | operator+= (const polynomialFunction &) |
| polynomialFunction & | operator-= (const polynomialFunction &) |
| polynomialFunction & | operator*= (const scalar) |
| polynomialFunction & | operator/= (const scalar) |
Friends | |
| Istream & | operator>> (Istream &, polynomialFunction &poly) |
| Ostream & | operator<< (Ostream &, const polynomialFunction &poly) |
Polynomial function representation.
poly = logCoeff*log(x) + sum(coeffs[i]*x^i)
where 0 <= i <= N
value(x) to evaluate the poly for a given valueintegrate(x1, x2) between two scalar valuesintegral() to return a new, integral coeff polynomialintegralMinus1() to return a new, integral coeff polynomial where the base poly starts at order -1Definition at line 72 of file polynomialFunction.H.
| polynomialFunction | ( | ) |
Default construct as size 1 with coefficient == 0.
Definition at line 92 of file polynomialFunction.C.
References Foam::Zero.
Referenced by operator!=(), operator+=(), operator-=(), operator<<, operator==(), operator>>, and ~polynomialFunction().

|
explicit |
Construct a particular size, with all coefficients == 0.
Definition at line 100 of file polynomialFunction.C.
References Foam::Zero.
|
explicit |
Construct from an initializer list of coefficients.
Definition at line 110 of file polynomialFunction.C.
|
explicit |
Construct from a list of coefficients.
Definition at line 123 of file polynomialFunction.C.
|
explicit |
Construct from Istream.
Definition at line 133 of file polynomialFunction.C.
|
virtualdefault |
Destructor.
References UList< scalar >::empty(), polynomialFunction(), Foam::rhs(), UList< scalar >::size(), and x.

| TypeName | ( | "polynomialFunction" | ) |
Runtime type information.
| bool logActive | ( | ) | const |
True if the log term is active.
Definition at line 145 of file polynomialFunction.C.
| Foam::scalar logCoeff | ( | ) | const |
The log coefficient.
Definition at line 151 of file polynomialFunction.C.
| Foam::scalar value | ( | const scalar | x | ) | const |
Return polynomial value.
Definition at line 157 of file polynomialFunction.C.
References Foam::log(), UList< T >::size(), and x.

| Foam::scalar integrate | ( | const scalar | x1, |
| const scalar | x2 ) const |
Integrate between two values.
Definition at line 179 of file polynomialFunction.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and UList< T >::size().

| Foam::polynomialFunction integral | ( | const scalar | intConstant = 0 | ) | const |
Return integral coefficients.
Argument becomes zeroth element (constant of integration)
Definition at line 211 of file polynomialFunction.C.
| Foam::polynomialFunction integralMinus1 | ( | const scalar | intConstant = 0 | ) | const |
Return integral coefficients when lowest order is -1.
Argument becomes zeroth element (constant of integration)
Definition at line 218 of file polynomialFunction.C.
| bool operator== | ( | const polynomialFunction & | rhs | ) | const |
Equality of coefficients, and logCoeff (if active).
Definition at line 226 of file polynomialFunction.C.
References polynomialFunction(), and Foam::rhs().
Referenced by operator!=().


|
inline |
Definition at line 236 of file polynomialFunction.H.
References operator==(), polynomialFunction(), and Foam::rhs().

| Foam::polynomialFunction & operator+= | ( | const polynomialFunction & | poly | ) |
Definition at line 238 of file polynomialFunction.C.
References forAll, polynomialFunction(), List< T >::resize(), UList< T >::size(), and Foam::Zero.

| Foam::polynomialFunction & operator-= | ( | const polynomialFunction & | poly | ) |
Definition at line 257 of file polynomialFunction.C.
References forAll, polynomialFunction(), List< T >::resize(), UList< T >::size(), and Foam::Zero.

| Foam::polynomialFunction & operator*= | ( | const scalar | s | ) |
| Foam::polynomialFunction & operator/= | ( | const scalar | s | ) |
|
friend |
References polynomialFunction().
|
friend |
References polynomialFunction().