70 double derivative = 0;
73 derivative += i *
Coefficient(i) * pow(value, i - 1);
92 const int coefIndex) {
96 derivative = pow(value, coefIndex);
98 else if(coefIndex == 0) {
102 QString msg =
"Unable to evaluate the derivative of the univariate polynomial for the given "
103 "coefficient index [" +
toString(coefIndex) +
"]. "
104 "Index is negative or exceeds degree of polynomial ["
int Coefficients() const
Returns the number of coefficients for the equation.
std::vector< double > p_terms
A vector of the terms in the equation.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
This error is for when a programmer made an API call that was illegal.
#define _FILEINFO_
Macro for the filename and line number.
double DerivativeVar(const double value)
This will take the Derivative with respect to the variable and evaluate at given value.
double Coefficient(int i) const
Returns the ith coefficient.
void Expand(const std::vector< double > &vars)
This is the the overriding virtual function that provides the expansion of the two input variables in...
Time based linear equation class.
double DerivativeCoef(const double value, const int coefIndex)
Evaluate the derivative of the polynomial defined by the given coefficients with respect to the coeff...
PolynomialUnivariate(int degree)
Create a PolynomialUnivariate object.
int p_degree
The order/degree of the polynomial.