An official website of the United States government
Here’s how you know
Official websites use .gov
A
.gov website belongs to an official government
organization in the United States.
Secure .gov websites use HTTPS
A
lock
( ) or https:// means you’ve safely connected to
the .gov website. Share sensitive information only on official,
secure websites.
Isis Developer Reference
|
Time based linear equation class. More...
#include <Basis1VariableFunction.h>
Public Member Functions | |
Basis1VariableFunction (const QString &name, int numCoefs) | |
Creates a Basis Function with a single variable. | |
virtual | ~Basis1VariableFunction () |
Destroys the Basis1VariableFunction object. | |
virtual double | DerivativeVar (const double value)=0 |
This will take the Derivative with respect to the variable and evaluate at given value. | |
virtual double | DerivativeCoef (const double value, const int coefIndex)=0 |
Evaluate the derivative 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. | |
double | Evaluate (const double &var) |
Compute the equation using the input variable. | |
virtual void | Expand (const std::vector< double > &vars) |
This is the function you should replace depending on your needs. | |
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. | |
Time based linear equation class.
This is a class for generating a general one-variable equation for the Isis least squares fitting algorithm (IsisLSQ). It allows the programmer to set up equations in the form of:
where C1-CN are coefficients and T1-TN are terms with a single variable. For example,
Isis::Basis1VariableFunction::Basis1VariableFunction | ( | const QString & | name, |
int | numCoefs ) |
Creates a Basis Function with a single variable.
name | Name of the Basis1VariableFunction. For example, "affine". |
numCoefs | Number of coefficients in the equation. For example:
has three coefficients: C1, C2 & C3. |
References Isis::BasisFunction::BasisFunction().
Referenced by Isis::PolynomialUnivariate::PolynomialUnivariate(), and Isis::PolynomialUnivariate::PolynomialUnivariate().
|
inlinevirtual |
Destroys the Basis1VariableFunction object.
|
inlineinherited |
Returns the ith coefficient.
i | The index for the desired coefficient. |
References p_coefs.
Referenced by Isis::PolynomialUnivariate::DerivativeVar(), Isis::SpicePosition::LoadHermiteCache(), Isis::SpicePosition::SetPolynomial(), Isis::SpiceRotation::SetPolynomial(), and Isis::Affine::Solve().
|
inlineinherited |
Returns the number of coefficients for the equation.
References p_numCoefs.
Referenced by Isis::PolynomialUnivariate::DerivativeCoef(), Isis::PolynomialUnivariate::DerivativeVar(), Isis::SpicePosition::SetPolynomial(), and Isis::SpiceRotation::SetPolynomial().
|
pure virtual |
Evaluate the derivative 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 |
Implemented in Isis::PolynomialUnivariate.
|
pure 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 |
Implemented in Isis::PolynomialUnivariate.
|
inherited |
Compute the equation using the input variable.
var | A single double value to use for the equation. |
References Evaluate().
|
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_, Expand(), p_coefs, p_numCoefs, p_numVars, p_terms, Isis::IException::Programmer, and Isis::toString().
Referenced by Evaluate(), Isis::SpiceRotation::EvaluatePolyFunction(), Isis::SpicePosition::LoadHermiteCache(), Isis::SpicePosition::SetEphemerisTimePolyFunction(), and Isis::SpiceRotation::setEphemerisTimePolyFunction().
|
virtualinherited |
This is the function you should replace depending on your needs.
It will expand the variables into the terms of the equation. For example,
must be expanded into the p_terms vector as (1.0, y, z, y*z). Note that the term expansion is not limited, you can use cos, sin, sqrt, abs, etc. This virtual method is automatically invoked by the Evaluate method. We provide a default expansion of p_terms = vars, just a linear combination of the variables.
vars | A vector of double values to use for the expansion. |
Reimplemented in Isis::NthOrderPolynomial, Isis::PolynomialBivariate, and Isis::PolynomialUnivariate.
References p_terms.
Referenced by Evaluate().
|
inlineinherited |
|
inherited |
Set the coefficients for the equation.
coefs | A vector of coefficients for the equation. |
References _FILEINFO_, p_coefs, p_numCoefs, Isis::IException::Programmer, and Isis::toString().
Referenced by Isis::SpiceRotation::DCJdt(), Isis::SpiceRotation::EvaluatePolyFunction(), Isis::SpicePosition::LoadHermiteCache(), Isis::PolynomialUnivariate::PolynomialUnivariate(), Isis::SpicePosition::SetEphemerisTimePolyFunction(), Isis::SpiceRotation::setEphemerisTimePolyFunction(), Isis::SpicePosition::SetPolynomial(), and Isis::SpiceRotation::SetPolynomial().
|
inlineinherited |
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 p_terms.
|
inlineinherited |
Returns the number of variables in the equation.
References p_numVars.
Referenced by Isis::NthOrderPolynomial::Expand().
|
protectedinherited |
A vector of the coefficients in the equation.
Call it by using Coefficient()
Referenced by Coefficient(), Evaluate(), and SetCoefficients().
|
protectedinherited |
The name of the equation. Call it by using Name()
Referenced by BasisFunction(), and Name().
|
protectedinherited |
The number of coefficients in the equation.
Call it by using Coefficients()
Referenced by BasisFunction(), Coefficients(), Evaluate(), and SetCoefficients().
|
protectedinherited |
The number of variables in the equation. Call it by using Variables()
Referenced by BasisFunction(), Evaluate(), and Variables().
|
protectedinherited |
A vector of the terms in the equation.
Call it by using Term()
Referenced by Evaluate(), Expand(), Isis::NthOrderPolynomial::Expand(), Isis::PolynomialBivariate::Expand(), Isis::PolynomialUnivariate::Expand(), and Term().