|
Isis 3.0 Object Programmers' Reference |
Home |
#include <Basis1VariableFunction.h>
Inheritance diagram for Isis::Basis1VariableFunction:


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,
For internal use only.
Definition at line 63 of file Basis1VariableFunction.h.
Public Member Functions | |
| Basis1VariableFunction (const std::string &name, int numCoefs) | |
| Creates a Basis Function with a single variable. | |
| virtual | ~Basis1VariableFunction () |
| Destroys the Basis1VariableFunction object. | |
| virtual double | DerivativeVar (const double value)=0 |
| virtual double | DerivativeCoef (const double value, const int coefIndex)=0 |
| 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. | |
| 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. | |
| std::string | 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 | |
| std::string | 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. | |
| Isis::Basis1VariableFunction::Basis1VariableFunction | ( | const std::string & | 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. |
Definition at line 41 of file Basis1VariableFunction.cpp.
| virtual Isis::Basis1VariableFunction::~Basis1VariableFunction | ( | ) | [inline, virtual] |
| double Isis::BasisFunction::Coefficient | ( | int | i | ) | const [inline, inherited] |
Returns the ith coefficient.
| i | The index for the desired coefficient. |
Definition at line 109 of file BasisFunction.h.
Referenced by Isis::PolynomialUnivariate::DerivativeVar(), Isis::SurfaceModel::MinMax(), Isis::AutoReg::ModelSurface(), Isis::SpicePosition::ReloadCache(), Isis::SpicePosition::SetPolynomial(), Isis::OverlapNormalization::Solve(), Isis::Affine::Solve(), and Isis::BundleAdjust::Update().
| int Isis::BasisFunction::Coefficients | ( | ) | const [inline, inherited] |
Returns the number of coefficients for the equation.
Definition at line 74 of file BasisFunction.h.
References Isis::BasisFunction::p_numCoefs.
Referenced by Isis::PolynomialUnivariate::DerivativeCoef(), Isis::PolynomialUnivariate::DerivativeVar(), Isis::SpicePosition::SetPolynomial(), Isis::OverlapNormalization::Solve(), Isis::LeastSquares::SolveQRD(), and Isis::LeastSquares::SolveSVD().
| 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. |
Definition at line 73 of file BasisFunction.cpp.
References _FILEINFO_, Isis::BasisFunction::Expand(), Isis::iException::Message(), Isis::BasisFunction::p_coefs, Isis::BasisFunction::p_numCoefs, Isis::BasisFunction::p_numVars, and Isis::BasisFunction::p_terms.
Referenced by Isis::LeastSquares::Evaluate(), Isis::SpicePosition::ReloadCache(), Isis::LeastSquares::SolveQRD(), Isis::LeastSquares::SolveSparse(), and Isis::LeastSquares::SolveSVD().
| void Isis::BasisFunction::Expand | ( | const std::vector< double > & | vars | ) | [virtual, inherited] |
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::Parabola, Isis::PolynomialBivariate, and Isis::PolynomialUnivariate.
Definition at line 108 of file BasisFunction.cpp.
References Isis::BasisFunction::p_terms.
Referenced by Isis::BasisFunction::Evaluate(), Isis::LeastSquares::FillSparseA(), Isis::LeastSquares::SolveQRD(), and Isis::LeastSquares::SolveSVD().
| std::string Isis::BasisFunction::Name | ( | ) | const [inline, inherited] |
Returns the name of the equation.
Definition at line 86 of file BasisFunction.h.
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. |
Definition at line 55 of file BasisFunction.cpp.
References _FILEINFO_, Isis::iException::Message(), Isis::BasisFunction::p_coefs, and Isis::BasisFunction::p_numCoefs.
Referenced by Isis::SpicePosition::SetPolynomial(), Isis::LeastSquares::SolveQRD(), Isis::LeastSquares::SolveSparse(), and Isis::LeastSquares::SolveSVD().
| 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. |
Definition at line 101 of file BasisFunction.h.
References Isis::BasisFunction::p_terms.
Referenced by Isis::LeastSquares::FillSparseA(), Isis::LeastSquares::SolveQRD(), and Isis::LeastSquares::SolveSVD().
| int Isis::BasisFunction::Variables | ( | ) | const [inline, inherited] |
Returns the number of variables in the equation.
Definition at line 80 of file BasisFunction.h.
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()
Definition at line 123 of file BasisFunction.h.
Referenced by Isis::BasisFunction::Evaluate(), and Isis::BasisFunction::SetCoefficients().
std::string Isis::BasisFunction::p_name [protected, inherited] |
The name of the equation. Call it by using Name().
Definition at line 109 of file BasisFunction.h.
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()
Definition at line 119 of file BasisFunction.h.
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().
Definition at line 115 of file BasisFunction.h.
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()
Definition at line 127 of file BasisFunction.h.
Referenced by Isis::BasisFunction::Evaluate(), Isis::PolynomialUnivariate::Expand(), Isis::PolynomialBivariate::Expand(), Isis::Parabola::Expand(), Isis::BasisFunction::Expand(), and Isis::BasisFunction::Term().