Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
polynomialFunction Class Reference

Polynomial function representation. More...

Inheritance diagram for polynomialFunction:
Inheritance graph
[legend]
Collaboration diagram for polynomialFunction:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("polynomialFunction")
 Runtime type information. More...
 
 polynomialFunction (const label)
 Construct a particular size, with all coefficients = 0.0. More...
 
 polynomialFunction (const polynomialFunction &)
 Copy constructor. More...
 
 polynomialFunction (const UList< scalar > &coeffs)
 Construct from a list of coefficients. More...
 
 polynomialFunction (Istream &)
 Construct from Istream. More...
 
virtual ~polynomialFunction ()
 Destructor. 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 integrate (const scalar x1, const scalar x2) const
 Integrate between two values. More...
 
polynomialFunction integral (const scalar intConstant=0.0) const
 Return integral coefficients. More...
 
polynomialFunction integralMinus1 (const scalar intConstant=0.0) const
 Return integral coefficients when lowest order is -1. More...
 
polynomialFunctionoperator+= (const polynomialFunction &)
 
polynomialFunctionoperator-= (const polynomialFunction &)
 
polynomialFunctionoperator*= (const scalar)
 
polynomialFunctionoperator/= (const scalar)
 
void size (const label)
 Return the number of coefficients. More...
 
label size () const
 Return the number of coefficients. More...
 

Private Member Functions

void operator= (const polynomialFunction &)
 Disallow default bitwise assignment. More...
 
- Private Member Functions inherited from List
 List ()
 Null constructor. More...
 
 List (const label)
 Construct with given size. More...
 
 List (const label, const T &)
 Construct with given size and value for all elements. More...
 
 List (const List< T > &)
 Copy constructor. More...
 
 List (const Xfer< List< T > > &)
 Construct by transferring the parameter contents. More...
 
 List (List< T > &, bool reUse)
 Construct as copy or re-use as specified. More...
 
 List (const UList< T > &, const labelUList &mapAddressing)
 Construct as subset. More...
 
template<class InputIterator >
 List (InputIterator first, InputIterator last)
 Construct given start and end iterators. More...
 
template<unsigned Size>
 List (const FixedList< T, Size > &)
 Construct as copy of FixedList<T, Size> More...
 
 List (const PtrList< T > &)
 Construct as copy of PtrList<T> More...
 
 List (const SLList< T > &)
 Construct as copy of SLList<T> More...
 
 List (const UIndirectList< T > &)
 Construct as copy of UIndirectList<T> More...
 
 List (const BiIndirectList< T > &)
 Construct as copy of BiIndirectList<T> More...
 
 List (Istream &)
 Construct from Istream. More...
 
autoPtr< List< T > > clone () const
 Clone. More...
 
 ~List ()
 Destructor. More...
 
label size () const
 Return the number of elements in the UList. More...
 
void resize (const label)
 Alias for setSize(const label) More...
 
void resize (const label, const T &)
 Alias for setSize(const label, const T&) More...
 
void setSize (const label)
 Reset size of List. More...
 
void setSize (const label, const T &)
 Reset size of List and value for new elements. More...
 
void clear ()
 Clear the list, i.e. set size to zero. More...
 
void append (const T &)
 Append an element at the end of the list. More...
 
void append (const UList< T > &)
 Append a List at the end of this list. More...
 
void append (const UIndirectList< T > &)
 Append a UIndirectList at the end of this list. More...
 
void transfer (List< T > &)
 Transfer the contents of the argument List into this list. More...
 
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
void transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
 Transfer the contents of the argument List into this list. More...
 
void transfer (SortableList< T > &)
 Transfer the contents of the argument List into this list. More...
 
Xfer< List< T > > xfer ()
 Transfer contents to the Xfer container. More...
 
TnewElmt (const label)
 Return subscript-checked element of UList. More...
 
void operator= (const UList< T > &)
 Assignment from UList operator. Takes linear time. More...
 
void operator= (const List< T > &)
 Assignment operator. Takes linear time. More...
 
void operator= (const SLList< T > &)
 Assignment from SLList operator. Takes linear time. More...
 
void operator= (const UIndirectList< T > &)
 Assignment from UIndirectList operator. Takes linear time. More...
 
void operator= (const BiIndirectList< T > &)
 Assignment from BiIndirectList operator. Takes linear time. More...
 
void operator= (const T &)
 Assignment of all entries to the given value. More...
 
template<class T >
 List (const label s)
 
template<class T >
 List (const label s, const T &a)
 
template<class T >
 List (const List< T > &a)
 
template<class T >
 List (const Xfer< List< T > > &lst)
 
template<class T >
 List (List< T > &a, bool reUse)
 
template<class T >
 List (const UList< T > &a, const labelUList &map)
 
template<class T >
 List (const PtrList< T > &lst)
 
template<class T >
 List (const SLList< T > &lst)
 
template<class T >
 List (const UIndirectList< T > &lst)
 
template<class T >
 List (const BiIndirectList< T > &lst)
 
template<class T >
void transfer (List< T > &a)
 
template<class T >
void transfer (SortableList< T > &a)
 
template<class T >
 List ()
 
template<class T >
 List (Istream &is)
 
void size (const label)
 Override size to be inconsistent with allocated storage. More...
 

Static Private Member Functions

static polynomialFunction cloneIntegral (const polynomialFunction &, const scalar intConstant=0.0)
 Return integral coefficients. More...
 
static polynomialFunction cloneIntegralMinus1 (const polynomialFunction &, const scalar intConstant=0.0)
 Return integral coefficients when lowest order is -1. More...
 
- Static Private Member Functions inherited from List
static const List< T > & null ()
 Return a null List. More...
 

Private Attributes

bool logActive_
 Include the log term? - only activated using integralMinus1() More...
 
scalar logCoeff_
 Log coefficient - only activated using integralMinus1() More...
 

Friends

Ostreamoperator<< (Ostream &, const polynomialFunction &)
 Ostream Operator. More...
 

Additional Inherited Members

- Private Types inherited from List
typedef SubList< TsubList
 Declare type of subList. More...
 

Detailed Description

Polynomial function representation.

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

where 0 <= i <= N

See also
Foam::Polynomial for a templated implementation
Source files

Definition at line 72 of file polynomialFunction.H.

Constructor & Destructor Documentation

◆ polynomialFunction() [1/4]

polynomialFunction ( const label  order)
explicit

Construct a particular size, with all coefficients = 0.0.

Definition at line 84 of file polynomialFunction.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.

Here is the call graph for this function:

◆ polynomialFunction() [2/4]

Copy constructor.

Definition at line 99 of file polynomialFunction.C.

◆ polynomialFunction() [3/4]

polynomialFunction ( const UList< scalar > &  coeffs)
explicit

Construct from a list of coefficients.

Definition at line 107 of file polynomialFunction.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.

Here is the call graph for this function:

◆ polynomialFunction() [4/4]

Construct from Istream.

Definition at line 122 of file polynomialFunction.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.

Here is the call graph for this function:

◆ ~polynomialFunction()

~polynomialFunction ( )
virtual

Destructor.

Definition at line 139 of file polynomialFunction.C.

Member Function Documentation

◆ cloneIntegral()

Foam::polynomialFunction cloneIntegral ( const polynomialFunction poly,
const scalar  intConstant = 0.0 
)
staticprivate

Return integral coefficients.

Argument becomes zeroth element (constant of integration)

Definition at line 41 of file polynomialFunction.C.

References forAll, and polynomialFunction::size().

Here is the call graph for this function:

◆ cloneIntegralMinus1()

Foam::polynomialFunction cloneIntegralMinus1 ( const polynomialFunction poly,
const scalar  intConstant = 0.0 
)
staticprivate

Return integral coefficients when lowest order is -1.

Argument becomes zeroth element (constant of integration)

Definition at line 59 of file polynomialFunction.C.

References polynomialFunction::logActive_, polynomialFunction::logCoeff_, and polynomialFunction::size().

Here is the call graph for this function:

◆ operator=()

void operator= ( const polynomialFunction )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "polynomialFunction"  )

Runtime type information.

◆ logActive()

bool logActive ( ) const

Return true if the log term is active.

Definition at line 145 of file polynomialFunction.C.

◆ logCoeff()

Foam::scalar logCoeff ( ) const

Return the log coefficient.

Definition at line 151 of file polynomialFunction.C.

◆ value()

Foam::scalar value ( const scalar  x) const

Return polynomial value.

Definition at line 157 of file polynomialFunction.C.

References Foam::log(), List::size(), and x.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ integrate()

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

Integrate between two values.

Definition at line 180 of file polynomialFunction.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and List::size().

Here is the call graph for this function:

◆ integral()

Foam::polynomialFunction integral ( const scalar  intConstant = 0.0) const

Return integral coefficients.

Argument becomes zeroth element (constant of integration)

Definition at line 211 of file polynomialFunction.C.

◆ integralMinus1()

Foam::polynomialFunction integralMinus1 ( const scalar  intConstant = 0.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.

◆ operator+=()

Foam::polynomialFunction & operator+= ( const polynomialFunction poly)

Definition at line 227 of file polynomialFunction.C.

References forAll, List::setSize(), List::size(), and polynomialFunction::size().

Here is the call graph for this function:

◆ operator-=()

Foam::polynomialFunction & operator-= ( const polynomialFunction poly)

Definition at line 253 of file polynomialFunction.C.

References forAll, List::setSize(), List::size(), and polynomialFunction::size().

Here is the call graph for this function:

◆ operator*=()

Foam::polynomialFunction & operator*= ( const scalar  s)

Definition at line 279 of file polynomialFunction.C.

References forAll, and s().

Here is the call graph for this function:

◆ operator/=()

Foam::polynomialFunction & operator/= ( const scalar  s)

Definition at line 292 of file polynomialFunction.C.

References forAll, and s().

Here is the call graph for this function:

◆ size() [1/2]

void size
inline

Return the number of coefficients.

Referenced by polynomialFunction::cloneIntegral(), polynomialFunction::cloneIntegralMinus1(), polynomialFunction::operator+=(), polynomialFunction::operator-=(), and Foam::operator<<().

Here is the caller graph for this function:

◆ size() [2/2]

label size
inline

Return the number of coefficients.

Friends And Related Function Documentation

◆ operator<<

Ostream& operator<< ( Ostream ,
const polynomialFunction  
)
friend

Ostream Operator.

Field Documentation

◆ logActive_

bool logActive_
private

Include the log term? - only activated using integralMinus1()

Definition at line 79 of file polynomialFunction.H.

Referenced by polynomialFunction::cloneIntegralMinus1().

◆ logCoeff_

scalar logCoeff_
private

Log coefficient - only activated using integralMinus1()

Definition at line 82 of file polynomialFunction.H.

Referenced by polynomialFunction::cloneIntegralMinus1().


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