Polynomial templated on size (order): More...
#include <Polynomial.H>


Public Types | |
| typedef Polynomial< PolySize > | polyType |
| typedef Polynomial< PolySize+1 > | intPolyType |
| Public Types inherited from VectorSpace< Polynomial< PolySize >, scalar, PolySize > | |
| typedef VectorSpace< Polynomial< PolySize >, scalar, Ncmpts > | vsType |
| VectorSpace type. | |
| typedef scalar | cmptType |
| Component type. | |
| typedef scalar | magType |
| Magnitude type. | |
| typedef direction | size_type |
| The type to represent the size of a VectorSpace. | |
| typedef scalar * | iterator |
| Random access iterator for traversing VectorSpace. | |
| typedef const scalar * | const_iterator |
| Random access iterator for traversing VectorSpace. | |
Public Member Functions | |
| Polynomial () | |
| Default construct, with all coefficients = 0. | |
| Polynomial (std::initializer_list< scalar > coeffs) | |
| Construct from an initializer list of coefficients. | |
| Polynomial (const scalar coeffs[PolySize]) | |
| Construct from C-array of coefficients. | |
| Polynomial (const UList< scalar > &coeffs) | |
| Construct from a list of coefficients. | |
| Polynomial (Istream &is) | |
| Construct from Istream. | |
| Polynomial (const word &name, Istream &is) | |
| Construct from name and Istream. | |
| bool | logActive () const noexcept |
| Return true if the log term is active. | |
| scalar | logCoeff () const noexcept |
| Return the log coefficient. | |
| scalar | value (const scalar x) const |
| Return polynomial value. | |
| scalar | derivative (const scalar x) const |
| Return derivative of the polynomial at the given x. | |
| scalar | integral (const scalar x1, const scalar x2) const |
| Return integral between two values. | |
| intPolyType | integral (const scalar intConstant=0.0) const |
| Return integral coefficients. | |
| polyType | integralMinus1 (const scalar intConstant=0.0) const |
| Return integral coefficients when lowest order is -1. | |
| Public Member Functions inherited from VectorSpace< Polynomial< PolySize >, scalar, PolySize > | |
| const Foam::VectorSpace< Polynomial< PolySize >, scalar, Ncmpts >::template ConstBlock< SubVector, BStart > | block () const |
| VectorSpace ()=default | |
| Default construct. | |
| const scalar & | component (const direction) const |
| void | replace (const direction, const scalar &) |
| const scalar * | cdata () const noexcept |
| Return const pointer to the first data element. | |
| scalar * | data () noexcept |
| Return pointer to the first data element. | |
| void | fill (const scalar &s) |
| Assign all components to given value. | |
| const scalar & | operator[] (const direction) const |
| void | operator= (const VectorSpace< Polynomial< PolySize >, scalar, Ncmpts > &) |
| void | operator+= (const VectorSpace< Polynomial< PolySize >, scalar, Ncmpts > &) |
| void | operator-= (const VectorSpace< Polynomial< PolySize >, scalar, Ncmpts > &) |
| void | operator*= (const scalar) |
| void | operator/= (const scalar) |
| iterator | begin () noexcept |
| Return an iterator (pointer) to begin of VectorSpace. | |
| const_iterator | cbegin () const noexcept |
| Return const_iterator (const pointer) to begin of VectorSpace. | |
| iterator | end () noexcept |
| Return an iterator (pointer) to end of VectorSpace. | |
| const_iterator | cend () const noexcept |
| Return const_iterator (const pointer) to end of VectorSpace. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from VectorSpace< Polynomial< PolySize >, scalar, PolySize > | |
| static constexpr direction | size () noexcept |
| The number of elements in the VectorSpace = Ncmpts. | |
| static Polynomial< PolySize > | uniform (const scalar &s) |
| Return a VectorSpace with all elements = s. | |
| Public Attributes inherited from VectorSpace< Polynomial< PolySize >, scalar, PolySize > | |
| scalar | v_ [Ncmpts] |
| The components of this vector space. | |
| Static Public Attributes inherited from VectorSpace< Polynomial< PolySize >, scalar, PolySize > | |
| static constexpr direction | dim |
| Dimensionality of space. | |
| static constexpr direction | nComponents |
| Number of components in this vector space. | |
| static constexpr direction | mRows |
| static constexpr direction | nCols |
| static const char *const | typeName |
| static const char *const | componentNames [] |
| static const Polynomial< PolySize > | zero |
| static const Polynomial< PolySize > | one |
| static const Polynomial< PolySize > | max |
| static const Polynomial< PolySize > | min |
| static const Polynomial< PolySize > | rootMax |
| static const Polynomial< PolySize > | rootMin |
Polynomial templated on size (order):
poly = sum(coeffs[i]*x^i) + logCoeff*log(x)
where 0 <= i <= N
value(x) to evaluate the poly for a given valuederivative(x) returns derivative at valueintegral(x1, x2) returns integral 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 71 of file Polynomial.H.
| typedef Polynomial<PolySize> polyType |
Definition at line 94 of file Polynomial.H.
| typedef Polynomial<PolySize+1> intPolyType |
Definition at line 95 of file Polynomial.H.
| Polynomial | ( | ) |
Default construct, with all coefficients = 0.
Definition at line 27 of file Polynomial.C.
References Polynomial(), VectorSpace< Polynomial< PolySize >, scalar, PolySize >::VectorSpace(), and Foam::Zero.
Referenced by Polynomial(), Polynomial(), Polynomial(), Polynomial(), and Polynomial().


| Polynomial | ( | std::initializer_list< scalar > | coeffs | ) |
Construct from an initializer list of coefficients.
Definition at line 36 of file Polynomial.C.
References for(), Polynomial(), VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_, and VectorSpace< Polynomial< PolySize >, scalar, PolySize >::VectorSpace().

|
explicit |
Construct from C-array of coefficients.
Definition at line 60 of file Polynomial.C.
References Polynomial(), VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_, and VectorSpace< Polynomial< PolySize >, scalar, PolySize >::VectorSpace().

|
explicit |
Construct from a list of coefficients.
Definition at line 74 of file Polynomial.C.
References for(), Polynomial(), UList< T >::size(), VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_, and VectorSpace< Polynomial< PolySize >, scalar, PolySize >::VectorSpace().

|
explicit |
Construct from Istream.
Definition at line 96 of file Polynomial.C.
References Polynomial(), and VectorSpace< Polynomial< PolySize >, scalar, PolySize >::VectorSpace().

Construct from name and Istream.
Definition at line 105 of file Polynomial.C.
References Foam::name().

|
noexcept |
Return true if the log term is active.
Definition at line 131 of file Polynomial.C.
References Foam::noexcept.
|
noexcept |
| Foam::scalar value | ( | const scalar | x | ) | const |
| Foam::scalar derivative | ( | const scalar | x | ) | const |
Return derivative of the polynomial at the given x.
Definition at line 167 of file Polynomial.C.
References VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_, and x.
| Foam::scalar integral | ( | const scalar | x1, |
| const scalar | x2 ) const |
Return integral between two values.
Definition at line 194 of file Polynomial.C.
References Foam::log(), and VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_.

| Foam::Polynomial< PolySize >::intPolyType integral | ( | const scalar | intConstant = 0.0 | ) | const |
Return integral coefficients.
Argument becomes zero'th element (constant of integration)
Definition at line 223 of file Polynomial.C.
References forAll, and VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_.
| Foam::Polynomial< PolySize >::polyType integralMinus1 | ( | const scalar | intConstant = 0.0 | ) | const |
Return integral coefficients when lowest order is -1.
Argument becomes zero'th element (constant of integration)
Definition at line 239 of file Polynomial.C.
References VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_.