OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Public Member Functions | Private Attributes | List of all members
polynomial::DifferentialOperator Class Reference

#include <DifferentialOperator.h>

Public Member Functions

 DifferentialOperator ()
 
 DifferentialOperator (const std::size_t &xDerivatives, const std::size_t &sDerivatives)
 
 DifferentialOperator (const DifferentialOperator &doperator)
 
DifferentialOperatoroperator= (const DifferentialOperator &doperator)
 
 ~DifferentialOperator ()
 
void resizeX (const std::size_t &xDerivatives)
 
void resizeS (const std::size_t &sDerivatives)
 
void differentiateX ()
 
void doubleDifferentiateS ()
 
void multiplyPolynomial (const Polynomial &poly)
 
void setPolynomial (const std::vector< int > &poly, const std::size_t &x, const std::size_t &s)
 
void printOperator () const
 
void addOperator (const DifferentialOperator &doperator)
 
std::size_t getXDerivatives () const
 
std::size_t getSDerivatives () const
 
bool isPolynomialZero (const std::size_t &x, const std::size_t &s) const
 
void truncate (const std::size_t &truncateOrder)
 
double evaluatePolynomial (const double &x, const std::size_t &xDerivative, const std::size_t &sDerivative) const
 

Private Attributes

std::vector< std::vector< Polynomial > > polynomials_m
 
std::size_t xDerivatives_m
 
std::size_t sDerivatives_m
 

Detailed Description

Definition at line 52 of file DifferentialOperator.h.

Constructor & Destructor Documentation

◆ DifferentialOperator() [1/3]

polynomial::DifferentialOperator::DifferentialOperator ( )

Default constructor, initialises identity operator (constant 1)

Definition at line 34 of file DifferentialOperator.cpp.

References polynomials_m.

◆ DifferentialOperator() [2/3]

polynomial::DifferentialOperator::DifferentialOperator ( const std::size_t &  xDerivatives,
const std::size_t &  sDerivatives 
)

Constructor, initialises operator with zero polynomials and derivatives up to xDerivatives in x and sDerivatives in s

Parameters
xDerivatives-> Highest derivative of x
sDerivatives-> Highest serivative in s

Definition at line 42 of file DifferentialOperator.cpp.

References polynomials_m, sDerivatives_m, and xDerivatives_m.

◆ DifferentialOperator() [3/3]

polynomial::DifferentialOperator::DifferentialOperator ( const DifferentialOperator doperator)

Copy constructor

Definition at line 51 of file DifferentialOperator.cpp.

◆ ~DifferentialOperator()

polynomial::DifferentialOperator::~DifferentialOperator ( )

Destructor, does nothing

Definition at line 58 of file DifferentialOperator.cpp.

Member Function Documentation

◆ addOperator()

void polynomial::DifferentialOperator::addOperator ( const DifferentialOperator doperator)

Add the operator to Operator, term by term

Parameters
doperator-> DifferentialOperator object to be added with this DifferentialOperator object

Definition at line 147 of file DifferentialOperator.cpp.

References polynomials_m, resizeS(), resizeX(), sDerivatives_m, and xDerivatives_m.

Referenced by polynomial::RecursionRelation::applyOperator().

Here is the call graph for this function:

◆ differentiateX()

void polynomial::DifferentialOperator::differentiateX ( )

Differentiate wrt x using product rule

Definition at line 87 of file DifferentialOperator.cpp.

References polynomials_m, resizeX(), sDerivatives_m, and xDerivatives_m.

Referenced by polynomial::RecursionRelation::applyOperator(), and polynomial::RecursionRelation::differentiateX().

Here is the call graph for this function:

◆ doubleDifferentiateS()

void polynomial::DifferentialOperator::doubleDifferentiateS ( )

Differentiate wrt s twice

Definition at line 99 of file DifferentialOperator.cpp.

References polynomials_m, resizeS(), sDerivatives_m, and xDerivatives_m.

Referenced by polynomial::RecursionRelation::applyOperator().

Here is the call graph for this function:

◆ evaluatePolynomial()

double polynomial::DifferentialOperator::evaluatePolynomial ( const double &  x,
const std::size_t &  xDerivative,
const std::size_t &  sDerivative 
) const

Evaluate polynomial with xDerivative x-derivatives and sDerivative s-derivatives
If xDerivative or sDerivative is greater than xDerivative_m or sDerivative then zero is returned

Parameters
x-> Point at which polynomial is evaluated
xDerivative-> Number of x-derivatives
sDerivative-> Number of s-derivatives

Definition at line 178 of file DifferentialOperator.cpp.

References polynomials_m, sDerivatives_m, and xDerivatives_m.

Referenced by polynomial::RecursionRelation::evaluatePolynomial().

◆ getSDerivatives()

std::size_t polynomial::DifferentialOperator::getSDerivatives ( ) const
inline

Returns highest derivative in s

Definition at line 141 of file DifferentialOperator.h.

References sDerivatives_m.

Referenced by polynomial::RecursionRelation::getMaxSDerivatives().

◆ getXDerivatives()

std::size_t polynomial::DifferentialOperator::getXDerivatives ( ) const
inline

Returns highest derivative in x

Definition at line 137 of file DifferentialOperator.h.

References xDerivatives_m.

Referenced by polynomial::RecursionRelation::getMaxXDerivatives().

◆ isPolynomialZero()

bool polynomial::DifferentialOperator::isPolynomialZero ( const std::size_t &  x,
const std::size_t &  s 
) const

Check if polynomial with x x-derivaties and s s-derivatives is a zero polynomial
If x or s is larger than xDerivatives or sDerivatives true is returned

Parameters
x-> Number of x-derivatives
s-> Number of s-derivatives

Definition at line 161 of file DifferentialOperator.cpp.

References polynomials_m, sDerivatives_m, and xDerivatives_m.

Referenced by polynomial::RecursionRelation::isPolynomialZero().

◆ multiplyPolynomial()

void polynomial::DifferentialOperator::multiplyPolynomial ( const Polynomial poly)

Multiplies each term with given polynomial

Parameters
poly-> Polynomial that multiplies each term

Definition at line 111 of file DifferentialOperator.cpp.

References polynomials_m, sDerivatives_m, and xDerivatives_m.

Referenced by polynomial::RecursionRelation::applyOperator().

◆ operator=()

DifferentialOperator & polynomial::DifferentialOperator::operator= ( const DifferentialOperator doperator)

Assigment operator

Definition at line 61 of file DifferentialOperator.cpp.

References polynomials_m, sDerivatives_m, and xDerivatives_m.

◆ printOperator()

void polynomial::DifferentialOperator::printOperator ( ) const

Print operator, for internal debugging

Definition at line 131 of file DifferentialOperator.cpp.

References endl(), polynomials_m, sDerivatives_m, and xDerivatives_m.

Referenced by polynomial::RecursionRelation::printOperator().

Here is the call graph for this function:

◆ resizeS()

void polynomial::DifferentialOperator::resizeS ( const std::size_t &  sDerivatives)

Set highest derivative in s to sDerivatives

Parameters
sDerivatives-> Highest derivative in s

Definition at line 80 of file DifferentialOperator.cpp.

References polynomials_m, sDerivatives_m, and xDerivatives_m.

Referenced by addOperator(), doubleDifferentiateS(), polynomial::RecursionRelation::resizeS(), and setPolynomial().

◆ resizeX()

void polynomial::DifferentialOperator::resizeX ( const std::size_t &  xDerivatives)

Set highest derivative in x to xDerivatives

Parameters
xDerivatives-> Highest derivative in x

Definition at line 69 of file DifferentialOperator.cpp.

References polynomials_m, sDerivatives_m, and xDerivatives_m.

Referenced by addOperator(), differentiateX(), polynomial::RecursionRelation::resizeX(), and setPolynomial().

◆ setPolynomial()

void polynomial::DifferentialOperator::setPolynomial ( const std::vector< int > &  poly,
const std::size_t &  x,
const std::size_t &  s 
)

Assign the input polynomial
If x or s is greater than xDerivatives_m or sDerivatives_m, they are adjusted accordingly and polynomials_m is resized

Parameters
poly-> Polynomial to be assigned to the operator
x-> Number of x-derivatives
s-> Number of s-derivatives

Definition at line 119 of file DifferentialOperator.cpp.

References polynomials_m, resizeS(), resizeX(), sDerivatives_m, and xDerivatives_m.

Referenced by polynomial::RecursionRelation::RecursionRelation().

Here is the call graph for this function:

◆ truncate()

void polynomial::DifferentialOperator::truncate ( const std::size_t &  truncateOrder)

Truncate all polynomials to truncateOrder
If truncateOrder is greater than the highest power of x then zeroes are appended to the end

Parameters
truncateOrder-> Highest order of x after truncation

Definition at line 170 of file DifferentialOperator.cpp.

References polynomials_m, sDerivatives_m, and xDerivatives_m.

Referenced by polynomial::RecursionRelation::truncate().

Member Data Documentation

◆ polynomials_m

std::vector<std::vector<Polynomial> > polynomial::DifferentialOperator::polynomials_m
private

◆ sDerivatives_m

std::size_t polynomial::DifferentialOperator::sDerivatives_m
private

◆ xDerivatives_m

std::size_t polynomial::DifferentialOperator::xDerivatives_m
private

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