Isis 3 Programmer Reference
Isis::NthOrderPolynomial Class Reference

NthOrderPolynomial basis function. More...

#include <NthOrderPolynomial.h>

Inheritance diagram for Isis::NthOrderPolynomial:
Inheritance graph
Collaboration diagram for Isis::NthOrderPolynomial:
Collaboration graph

Public Member Functions

 NthOrderPolynomial (int degree)
 Create an NthOrderPolynomial.
 
 ~NthOrderPolynomial ()
 Destroys the NthOrderPolynomial object.
 
void Expand (const std::vector< double > &vars)
 This is the the overriding virtual function that provides the expansion into the nth order polynomial equation.
 
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.
 
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.
 

Private Attributes

int p_degree
 

Detailed Description

NthOrderPolynomial basis function.

This is a derived class from the BasisFunction class which creates an nth order polynomial.

Author
2018-01-01 Unknown
History

2018-01-01 Unknown - Initial Version

2020-01-08 Kristin Berry - Update documentation prior to checkin to dev.

Definition at line 29 of file NthOrderPolynomial.h.

Constructor & Destructor Documentation

◆ NthOrderPolynomial()

Isis::NthOrderPolynomial::NthOrderPolynomial ( int degree)

Create an NthOrderPolynomial.

Parameters
degreeThe order/degree of the polynomial

Definition at line 24 of file NthOrderPolynomial.cpp.

◆ ~NthOrderPolynomial()

Isis::NthOrderPolynomial::~NthOrderPolynomial ( )
inline

Destroys the NthOrderPolynomial object.

Definition at line 34 of file NthOrderPolynomial.h.

Member Function Documentation

◆ Coefficient()

double Isis::BasisFunction::Coefficient ( int i) const
inlineinherited

Returns the ith coefficient.

Parameters
iThe index for the desired coefficient.
Returns
The ith coefficient

Definition at line 107 of file BasisFunction.h.

References Isis::BasisFunction::p_coefs.

Referenced by Isis::PolynomialUnivariate::DerivativeVar(), Isis::SurfaceModel::MinMax(), and Isis::OverlapNormalization::Solve().

◆ Coefficients()

int Isis::BasisFunction::Coefficients ( ) const
inlineinherited

Returns the number of coefficients for the equation.

Returns
The number of coefficients.

Definition at line 64 of file BasisFunction.h.

References Isis::BasisFunction::p_numCoefs.

Referenced by Isis::PolynomialUnivariate::DerivativeCoef(), Isis::PolynomialUnivariate::DerivativeVar(), Isis::OverlapNormalization::Solve(), Isis::LeastSquares::SolveQRD(), and Isis::LeastSquares::SolveSVD().

◆ Evaluate() [1/2]

double Isis::BasisFunction::Evaluate ( const double & var)
inherited

Compute the equation using the input variable.

Parameters
varA single double value to use for the equation.
Returns
The output double value resulting from the equation.

Definition at line 101 of file BasisFunction.cpp.

References Isis::BasisFunction::Evaluate().

◆ Evaluate() [2/2]

double Isis::BasisFunction::Evaluate ( const std::vector< double > & vars)
inherited

Compute the equation using the input variables.

Parameters
varsA 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.
Returns
The output value.

Definition at line 64 of file BasisFunction.cpp.

References Isis::BasisFunction::Expand(), Isis::BasisFunction::p_coefs, Isis::BasisFunction::p_numCoefs, Isis::BasisFunction::p_numVars, Isis::BasisFunction::p_terms, Isis::IException::Programmer, and Isis::toString().

Referenced by Isis::BasisFunction::Evaluate(), Isis::LeastSquares::Evaluate(), Isis::LeastSquares::SolveQRD(), and Isis::LeastSquares::SolveSVD().

◆ Expand()

void Isis::NthOrderPolynomial::Expand ( const std::vector< double > & vars)
virtual

This is the the overriding virtual function that provides the expansion into the nth order polynomial equation.

See BasisFunction for more information.

Parameters
varsA vector of double values to use for the expansion.

Reimplemented from Isis::BasisFunction.

Definition at line 38 of file NthOrderPolynomial.cpp.

References Isis::BasisFunction::p_terms, Isis::IException::Programmer, and Isis::BasisFunction::Variables().

◆ Name()

QString Isis::BasisFunction::Name ( ) const
inlineinherited

Returns the name of the equation.

Returns
The name of the equation.

Definition at line 80 of file BasisFunction.h.

References Isis::BasisFunction::p_name.

Referenced by Isis::LeastSquares::AddKnown().

◆ SetCoefficients()

void Isis::BasisFunction::SetCoefficients ( const std::vector< double > & coefs)
inherited

◆ Term()

double Isis::BasisFunction::Term ( int c) const
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,

\[ x = C1 + C2*x + C3*y + C4*x*y \]

would return x*y for the 3rd term (zero-based)

Parameters
cThe index for the desired coefficient.
Returns
The cth term.

Definition at line 97 of file BasisFunction.h.

References Isis::BasisFunction::p_terms.

Referenced by Isis::LeastSquares::FillSparseA(), Isis::LeastSquares::SolveQRD(), and Isis::LeastSquares::SolveSVD().

◆ Variables()

int Isis::BasisFunction::Variables ( ) const
inlineinherited

Returns the number of variables in the equation.

Returns
The number of variables.

Definition at line 72 of file BasisFunction.h.

References Isis::BasisFunction::p_numVars.

Referenced by Isis::LeastSquares::AddKnown(), and Expand().

Member Data Documentation

◆ p_coefs

std::vector<double> Isis::BasisFunction::p_coefs
protectedinherited

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::Coefficient(), Isis::BasisFunction::Evaluate(), and Isis::BasisFunction::SetCoefficients().

◆ p_degree

int Isis::NthOrderPolynomial::p_degree
private

Definition at line 39 of file NthOrderPolynomial.h.

◆ p_name

QString Isis::BasisFunction::p_name
protectedinherited

The name of the equation. Call it by using Name()

Definition at line 113 of file BasisFunction.h.

Referenced by Isis::BasisFunction::BasisFunction(), and Isis::BasisFunction::Name().

◆ p_numCoefs

int Isis::BasisFunction::p_numCoefs
protectedinherited

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().

◆ p_numVars

int Isis::BasisFunction::p_numVars
protectedinherited

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().

◆ p_terms

std::vector<double> Isis::BasisFunction::p_terms
protectedinherited

The documentation for this class was generated from the following files: