28#ifndef DIFFERENTIAL_OPERATOR_TWO_H
29#define DIFFERENTIAL_OPERATOR_TWO_H
64 const std::size_t &sDerivatives);
75 void resizeX(
const std::size_t &xDerivatives);
79 void resizeS(
const std::size_t &sDerivatives);
95 const std::size_t &s);
114 const std::size_t &s,
115 const std::size_t &term)
const;
119 void truncate(
const std::size_t &truncateOrder);
129 const std::size_t &xDerivative,
130 const std::size_t &sDerivative,
131 const std::vector<double> &dSvalues)
const;
140 const std::size_t &sDerivatives)
const;
149 std::vector<std::size_t>
getdSFactors(
const std::size_t &xDerivatives,
150 const std::size_t &sDerivatives,
151 const std::size_t &p)
const;
void differentiateS()
Differentiate wrt s using product rule.
std::size_t getXDerivatives() const
Returns highest derivative in x.
void printOperator() const
Print operator, for internal debugging.
void setPolynomial(const TwoPolynomial &poly, const std::size_t &x, const std::size_t &s)
Assign the polynomial poly to the operator.
std::size_t sDerivatives_m
DifferentialOperatorTwo & operator=(const DifferentialOperatorTwo &doperator)
Assigment operator.
bool isPolynomialZero(const std::size_t &x, const std::size_t &s, const std::size_t &term) const
Check if polynomial with x x-derivaties and s s-derivatives is a zero polynomial If x or s are out o...
DifferentialOperatorTwo()
Default constructor, initialises identity operator.
void differentiateX()
Differentiate wrt x using product rule.
void sortTerms()
Sort the terms in each sum, with fewest S(s)-derivatives first, then in increasing powers.
std::size_t getSDerivatives() const
Returns highest derivative in s.
void multiplyPolynomial(const TwoPolynomial &poly)
Multiplies each term with given polynomial.
double evaluatePolynomial(const double &x, const double &s, const std::size_t &xDerivative, const std::size_t &sDerivative, const std::vector< double > &dSvalues) const
Evaluate polynomial specified.
void resizeX(const std::size_t &xDerivatives)
Set highest derivative in x to xDerivatives111.
void truncate(const std::size_t &truncateOrder)
Truncate all polynomials to truncateOrder.
std::size_t numberOfTerms(const std::size_t &xDerivatives, const std::size_t &sDerivatives) const
Returns number of terms in the sum with xDerivatives x-derivatives and sDerivatives s-derivatives If...
std::vector< std::vector< PolynomialSum > > polynomials_m
std::vector< std::size_t > getdSFactors(const std::size_t &xDerivatives, const std::size_t &sDerivatives, const std::size_t &p) const
Returns list of S(s)-derivatives from term p in polynomial with xDerivatives x-derivatives and sDeriv...
~DifferentialOperatorTwo()
Destructor.
std::size_t xDerivatives_m
void addOperator(const DifferentialOperatorTwo &doperator)
Add the doperator to operator, term by term.
void resizeS(const std::size_t &sDerivatives)
Set highest derivative in s to xDerivatives.