Isis 3 Programmer Reference
Isis::PolynomialBivariate Class Reference

Nth degree Polynomial with two variables. More...

#include <PolynomialBivariate.h>

Inheritance diagram for Isis::PolynomialBivariate:
Inheritance graph
Collaboration diagram for Isis::PolynomialBivariate:
Collaboration graph

Public Member Functions

 PolynomialBivariate (int degree)
 Create a PolynomialBivariate object. More...
 
 ~PolynomialBivariate ()
 Destroys the PolynomialBivariate object. More...
 
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. More...
 
void SetCoefficients (const std::vector< double > &coefs)
 Set the coefficients for the equation. More...
 
double Evaluate (const std::vector< double > &vars)
 Compute the equation using the input variables. More...
 
double Evaluate (const double &var)
 Compute the equation using the input variable. More...
 
int Coefficients () const
 Returns the number of coefficients for the equation. More...
 
int Variables () const
 Returns the number of variables in the equation. More...
 
QString Name () const
 Returns the name of the equation. More...
 
double Term (int c) const
 Returns the cth term. More...
 
double Coefficient (int i) const
 Returns the ith coefficient. More...
 

Protected Attributes

QString p_name
 The name of the equation. Call it by using Name() More...
 
int p_numVars
 The number of variables in the equation. Call it by using Variables() More...
 
int p_numCoefs
 The number of coefficients in the equation. More...
 
std::vector< double > p_coefs
 A vector of the coefficients in the equation. More...
 
std::vector< double > p_terms
 A vector of the terms in the equation. More...
 

Private Attributes

int p_degree
 The order/degree of the polynomial. More...
 

Detailed Description

Nth degree Polynomial with two variables.

This is a derived class from BasisFunction which provides the capabilities of a polynomial equation in two variables with degree n, where n is specified during the object construction. For example, Degree = 1 z = a + b*x + c*y Degree = 2 z = a + b*x + c*y + d*x**2 + e*x*y + f*y**2 Degree = 3 z = a + b*x + c*y + d*x**2 + e*x*y + f*y**2 + g*x**3 + h*x**2*y

  • i*x*y**2 + j*y**3 In general the number of coefficients will be ((degree+1)*(degree+2))/2.
Author
2004-06-24 Jeff Anderson
History:
2005-03-11 Elizabeth Ribelin - Modified file to support Doxygen documentation
Todo:
2005-03-11 Jeff Anderson - add coded and implementation examples to class documentation
History:
2008-02-05 Jeannie Walldren, Renamed from Poly2D.

Definition at line 53 of file PolynomialBivariate.h.

Constructor & Destructor Documentation

◆ PolynomialBivariate()

Isis::PolynomialBivariate::PolynomialBivariate ( int  degree)

Create a PolynomialBivariate object.

Parameters
degreeThe order/degree of the polynomial

Definition at line 33 of file PolynomialBivariate.cpp.

References p_degree.

◆ ~PolynomialBivariate()

Isis::PolynomialBivariate::~PolynomialBivariate ( )
inline

Destroys the PolynomialBivariate object.

Definition at line 58 of file PolynomialBivariate.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 123 of file BasisFunction.h.

References Isis::BasisFunction::p_coefs.

Referenced by Isis::PolynomialUnivariate::DerivativeVar(), Isis::SpicePosition::LoadHermiteCache(), Isis::SurfaceModel::MinMax(), Isis::SpicePosition::SetPolynomial(), Isis::SpiceRotation::SetPolynomial(), and Isis::Affine::Solve().

◆ Coefficients()

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

◆ Evaluate() [1/2]

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

◆ Evaluate() [2/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 117 of file BasisFunction.cpp.

References Isis::BasisFunction::Evaluate().

◆ Expand()

void Isis::PolynomialBivariate::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.

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

Reimplemented from Isis::BasisFunction.

Definition at line 45 of file PolynomialBivariate.cpp.

References p_degree, and Isis::BasisFunction::p_terms.

◆ Name()

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

Returns the name of the equation.

Returns
The name of the equation.

Definition at line 96 of file BasisFunction.h.

References Isis::BasisFunction::p_name.

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

◆ SetCoefficients()

◆ 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 113 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 88 of file BasisFunction.h.

References Isis::BasisFunction::p_numVars.

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

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 139 of file BasisFunction.h.

Referenced by Isis::BasisFunction::Coefficient(), Isis::BasisFunction::Evaluate(), and Isis::BasisFunction::SetCoefficients().

◆ p_degree

int Isis::PolynomialBivariate::p_degree
private

The order/degree of the polynomial.

Definition at line 63 of file PolynomialBivariate.h.

Referenced by Expand(), and PolynomialBivariate().

◆ p_name

QString Isis::BasisFunction::p_name
protectedinherited

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

Definition at line 125 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 135 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 131 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

A vector of the terms in the equation.

Call it by using Term()

Definition at line 143 of file BasisFunction.h.

Referenced by Isis::BasisFunction::Evaluate(), Expand(), Isis::PolynomialUnivariate::Expand(), Isis::BasisFunction::Expand(), and Isis::BasisFunction::Term().


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