Public Types | Public Member Functions | Friends | List of all members
Polynomial< PolySize > Class Template Reference

Polynomial templated on size (order): More...

Inheritance diagram for Polynomial< PolySize >:
Inheritance graph
[legend]
Collaboration diagram for Polynomial< PolySize >:
Collaboration graph
[legend]

Public Types

typedef Polynomial< PolySize > polyType
 
typedef Polynomial< PolySize+1 > intPolyType
 
- Public Types inherited from VectorSpace< Polynomial< PolySize >, scalar, PolySize >
enum  
 
typedef scalar cmptType
 Component type. More...
 

Public Member Functions

 Polynomial ()
 Construct null, with all coefficients = 0.0. More...
 
 Polynomial (const Polynomial &)
 Copy constructor. More...
 
 Polynomial (const scalar coeffs[PolySize])
 Construct from C-array of coefficients. More...
 
 Polynomial (const UList< scalar > &coeffs)
 Construct from a list of coefficients. More...
 
 Polynomial (Istream &)
 Construct from Istream. More...
 
 Polynomial (const word &name, Istream &)
 Construct from name and Istream. More...
 
bool logActive () const
 Return true if the log term is active. More...
 
scalar logCoeff () const
 Return the log coefficient. More...
 
scalar value (const scalar x) const
 Return polynomial value. More...
 
scalar derivative (const scalar x) const
 Return derivative of the polynomial at the given x. More...
 
scalar integral (const scalar x1, const scalar x2) const
 Return integral between two values. More...
 
intPolyType integral (const scalar intConstant=0.0) const
 Return integral coefficients. More...
 
polyType integralMinus1 (const scalar intConstant=0.0) const
 Return integral coefficients when lowest order is -1. More...
 
- Public Member Functions inherited from VectorSpace< Polynomial< PolySize >, scalar, PolySize >
 VectorSpace ()
 Construct null. More...
 
 VectorSpace (Istream &)
 Construct from Istream. More...
 
 VectorSpace (const VectorSpace< Polynomial< PolySize >, scalar, nCmpt > &)
 Construct as copy. More...
 
 VectorSpace (const VectorSpace< Form2, Cmpt2, nCmpt > &)
 Construct as copy of another VectorSpace type of the same rank. More...
 
label size () const
 Return the number of elements in the VectorSpace = nCmpt. More...
 
const scalar & component (const direction) const
 
scalar & component (const direction)
 
void component (scalar &, const direction) const
 
void replace (const direction, const scalar &)
 
const scalar & operator[] (const direction) const
 
scalar & operator[] (const direction)
 
void operator= (const VectorSpace< Polynomial< PolySize >, scalar, nCmpt > &)
 
void operator+= (const VectorSpace< Polynomial< PolySize >, scalar, nCmpt > &)
 
void operator-= (const VectorSpace< Polynomial< PolySize >, scalar, nCmpt > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 

Friends

Ostreamoperator (Ostream &, const Polynomial &)
 Ostream Operator. More...
 

Additional Inherited Members

- Public Attributes inherited from VectorSpace< Polynomial< PolySize >, scalar, PolySize >
scalar v_ [nCmpt]
 The components of this vector space. More...
 

Detailed Description

template<int PolySize>
class Foam::Polynomial< PolySize >

Polynomial templated on size (order):

poly = sum(coeff_[i]*x^i) logCoeff*log(x)

where 0 <= i <= N

Source files

Definition at line 63 of file Polynomial.H.

Member Typedef Documentation

typedef Polynomial<PolySize> polyType

Definition at line 97 of file Polynomial.H.

typedef Polynomial<PolySize+1> intPolyType

Definition at line 99 of file Polynomial.H.

Constructor & Destructor Documentation

Construct null, with all coefficients = 0.0.

Definition at line 31 of file Polynomial.C.

References VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_.

Polynomial ( const Polynomial< PolySize > &  )

Copy constructor.

Polynomial ( const scalar  coeffs[PolySize])
explicit

Construct from C-array of coefficients.

Definition at line 57 of file Polynomial.C.

References VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_.

Polynomial ( const UList< scalar > &  coeffs)
explicit

Construct from a list of coefficients.

Definition at line 71 of file Polynomial.C.

References Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::nl, UList< T >::size(), and VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_.

Here is the call graph for this function:

Polynomial ( Istream is)

Construct from Istream.

Definition at line 95 of file Polynomial.C.

Polynomial ( const word name,
Istream is 
)

Construct from name and Istream.

Definition at line 104 of file Polynomial.C.

References Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::nl, and VectorSpace< Polynomial< PolySize >, scalar, PolySize >::size().

Here is the call graph for this function:

Member Function Documentation

bool logActive ( ) const

Return true if the log term is active.

Definition at line 138 of file Polynomial.C.

Foam::scalar logCoeff ( ) const

Return the log coefficient.

Definition at line 145 of file Polynomial.C.

Foam::scalar value ( const scalar  x) const

Return polynomial value.

Definition at line 152 of file Polynomial.C.

References Foam::log(), VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_, and x.

Here is the call graph for this function:

Foam::scalar derivative ( const scalar  x) const

Return derivative of the polynomial at the given x.

Definition at line 174 of file Polynomial.C.

References Polynomial< PolySize >::integral(), VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_, and x.

Here is the call graph for this function:

Foam::scalar integral ( const scalar  x1,
const scalar  x2 
) const

Return integral between two values.

Definition at line 202 of file Polynomial.C.

References Foam::log(), and VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_.

Referenced by Polynomial< PolySize >::derivative().

Here is the call graph for this function:

Here is the caller graph for this function:

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 230 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 246 of file Polynomial.C.

References VectorSpace< Polynomial< PolySize >, scalar, PolySize >::v_.

Friends And Related Function Documentation

Ostream& operator ( Ostream ,
const Polynomial< PolySize > &   
)
friend

Ostream Operator.


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