|
Isis 3.0 Developer's Reference (API) |
Home |
Nth degree Polynomial with one variable. More...
#include <PolynomialUnivariate.h>
Inherits Isis::Basis1VariableFunction.
Public Member Functions | |
| PolynomialUnivariate (int degree) | |
| Create a PolynomialUnivariate object. | |
| ~PolynomialUnivariate () | |
| Destroys the PolynomialUnivariate object. | |
| void | Expand (const std::vector< double > &vars) |
| This is the the overriding virtual function that provides the expansion of the two input variables into the polynomial equation. | |
| double | DerivativeVar (const double value) |
| This will take the Derivative with respect to the variable and evaluate at given value. | |
| double | DerivativeCoef (const double value, const int coefIndex) |
| Evaluate the derivative of the polynomial defined by the given coefficients with respect to the coefficient at the given index, at the current value. | |
| void | SetCoefficients (const std::vector< double > &coefs) |
| Set the coefficients for the equation. | |
| double | Evaluate (const std::vector< double > &vars) |
| Compute the equation using the input variables. | |
| int | Coefficients () const |
| Returns the number of coefficients for the equation. | |
| int | Variables () const |
| Returns the number of variables in the equation. | |
| QString | Name () const |
| Returns the name of the equation. | |
| double | Term (int c) const |
| Returns the cth term. | |
| double | Coefficient (int i) const |
| Returns the ith coefficient. | |
Protected Attributes | |
| QString | p_name |
| The name of the equation. Call it by using Name(). | |
| int | p_numVars |
| The number of variables in the equation. Call it by using Variables(). | |
| int | p_numCoefs |
| The number of coefficients in the equation. | |
| std::vector< double > | p_coefs |
| A vector of the coefficients in the equation. | |
| std::vector< double > | p_terms |
| A vector of the terms in the equation. | |
Nth degree Polynomial with one variable.
This is a derived class from Basis1VariableFunction which provides the capabilities of a polynomial equation in one variable with degree n, where n is specified during the object construction. For example, Degree = 1 z = a + b*x Degree = 2 z = a + b*x + c*x**2 Degree = 3 z = a + b*x + c*x**2 + d*x**3 In general the number of coefficients will be degree + 1.
| Isis::PolynomialUnivariate::PolynomialUnivariate | ( | int | degree | ) |
Create a PolynomialUnivariate object.
| degree | The order/degree of the polynomial |
| Isis::PolynomialUnivariate::~PolynomialUnivariate | ( | ) | [inline] |
Destroys the PolynomialUnivariate object.
| double Isis::BasisFunction::Coefficient | ( | int | i | ) | const [inline, inherited] |
Returns the ith coefficient.
| i | The index for the desired coefficient. |
References Isis::BasisFunction::p_coefs.
Referenced by DerivativeVar(), Isis::SpicePosition::LoadHermiteCache(), Isis::SurfaceModel::MinMax(), Isis::SpicePosition::SetPolynomial(), Isis::OverlapNormalization::Solve(), and Isis::Affine::Solve().
| int Isis::BasisFunction::Coefficients | ( | ) | const [inline, inherited] |
Returns the number of coefficients for the equation.
References Isis::BasisFunction::p_numCoefs.
Referenced by DerivativeCoef(), DerivativeVar(), Isis::SpicePosition::SetPolynomial(), and Isis::OverlapNormalization::Solve().
| double Isis::PolynomialUnivariate::DerivativeCoef | ( | const double | value, | |
| const int | coefIndex | |||
| ) | [virtual] |
Evaluate the derivative of the polynomial defined by the given coefficients with respect to the coefficient at the given index, at the current value.
| [in] | value | (const double) value at which to evaluate derivative |
| [in] | coefIndex | (const int) The index of the coefficient to differentiate with respect to |
Implements Isis::Basis1VariableFunction.
References _FILEINFO_, Isis::BasisFunction::Coefficients(), and Isis::IException::Programmer.
| double Isis::PolynomialUnivariate::DerivativeVar | ( | const double | value | ) | [virtual] |
This will take the Derivative with respect to the variable and evaluate at given value.
| [in] | value | (const double) value at which to evaluate derivative |
Implements Isis::Basis1VariableFunction.
References Isis::BasisFunction::Coefficient(), and Isis::BasisFunction::Coefficients().
| double Isis::BasisFunction::Evaluate | ( | const std::vector< double > & | vars | ) | [inherited] |
Compute the equation using the input variables.
| vars | A vector of double values to use for the equation. After setting the coefficients, this can be invoked many times to compute output values given input values. |
References _FILEINFO_, Isis::BasisFunction::Expand(), Isis::BasisFunction::p_coefs, Isis::BasisFunction::p_numCoefs, Isis::BasisFunction::p_numVars, Isis::BasisFunction::p_terms, and Isis::IException::Programmer.
Referenced by Isis::LeastSquares::Evaluate(), Isis::SpicePosition::LoadHermiteCache(), and Isis::SpicePosition::SetEphemerisTimePolyFunction().
| void Isis::PolynomialUnivariate::Expand | ( | const std::vector< double > & | vars | ) | [virtual] |
This is the the overriding virtual function that provides the expansion of the two input variables into the polynomial equation.
See BasisFunction for more information.
| vars | A vector of double values to use for the expansion. |
Reimplemented from Isis::BasisFunction.
References Isis::BasisFunction::p_terms.
| QString Isis::BasisFunction::Name | ( | ) | const [inline, inherited] |
Returns the name of the equation.
References Isis::BasisFunction::p_name.
Referenced by Isis::LeastSquares::AddKnown().
| void Isis::BasisFunction::SetCoefficients | ( | const std::vector< double > & | coefs | ) | [inherited] |
Set the coefficients for the equation.
| coefs | A vector of coefficients for the equation. |
References _FILEINFO_, Isis::BasisFunction::p_coefs, Isis::BasisFunction::p_numCoefs, and Isis::IException::Programmer.
Referenced by Isis::SpicePosition::LoadHermiteCache(), Isis::SpicePosition::SetEphemerisTimePolyFunction(), and Isis::SpicePosition::SetPolynomial().
| double Isis::BasisFunction::Term | ( | int | c | ) | const [inline, inherited] |
Returns the cth term.
This is only valid after a Evalute/Expand has been invoked. It represents the expansion of the variables into the ith term. For example,
would return x*y for the 3rd term (zero-based)
| c | The index for the desired coefficient. |
References Isis::BasisFunction::p_terms.
| int Isis::BasisFunction::Variables | ( | ) | const [inline, inherited] |
Returns the number of variables in the equation.
References Isis::BasisFunction::p_numVars.
Referenced by Isis::LeastSquares::AddKnown(), and Isis::Parabola::Expand().
std::vector<double> Isis::BasisFunction::p_coefs [protected, inherited] |
A vector of the coefficients in the equation.
Call it by using Coefficient()
Referenced by Isis::BasisFunction::Coefficient(), Isis::BasisFunction::Evaluate(), and Isis::BasisFunction::SetCoefficients().
QString Isis::BasisFunction::p_name [protected, inherited] |
The name of the equation. Call it by using Name().
Referenced by Isis::BasisFunction::BasisFunction(), and Isis::BasisFunction::Name().
int Isis::BasisFunction::p_numCoefs [protected, inherited] |
The number of coefficients in the equation.
Call it by using Coefficients()
Referenced by Isis::BasisFunction::BasisFunction(), Isis::BasisFunction::Coefficients(), Isis::BasisFunction::Evaluate(), and Isis::BasisFunction::SetCoefficients().
int Isis::BasisFunction::p_numVars [protected, inherited] |
The number of variables in the equation. Call it by using Variables().
Referenced by Isis::BasisFunction::BasisFunction(), Isis::BasisFunction::Evaluate(), and Isis::BasisFunction::Variables().
std::vector<double> Isis::BasisFunction::p_terms [protected, inherited] |
A vector of the terms in the equation.
Call it by using Term()
Referenced by Isis::BasisFunction::Evaluate(), Expand(), Isis::PolynomialBivariate::Expand(), Isis::Parabola::Expand(), Isis::BasisFunction::Expand(), and Isis::BasisFunction::Term().