USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::PolynomialBivariate Class Reference
[Math]

#include <PolynomialBivariate.h>

Inheritance diagram for Isis::PolynomialBivariate:

Inheritance graph
[legend]
Collaboration diagram for Isis::PolynomialBivariate:

Collaboration graph
[legend]
List of all members.

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

For internal use only.

History:
2005-03-11 Elizabeth Ribelin - Modified file to support Doxygen documentation

2008-02-05 Jeannie Walldren, Renamed from Poly2D.

Todo:
2005-03-11 Jeff Anderson - add coded and implementation examples to class documentation

Definition at line 53 of file PolynomialBivariate.h.

Public Member Functions

 PolynomialBivariate (int degree)
 Create a PolynomialBivariate object.
 ~PolynomialBivariate ()
 Destroys the PolynomialBivariate 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.
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.
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.

Private Attributes

int p_degree
 The order/degree of the polynomial.


Constructor & Destructor Documentation

Isis::PolynomialBivariate::PolynomialBivariate ( int  degree  ) 

Create a PolynomialBivariate object.

Parameters:
degree The order/degree of the polynomial

Definition at line 33 of file PolynomialBivariate.cpp.

References p_degree.

Isis::PolynomialBivariate::~PolynomialBivariate (  )  [inline]

Destroys the PolynomialBivariate object.

Definition at line 58 of file PolynomialBivariate.h.


Member Function Documentation

double Isis::BasisFunction::Coefficient ( int  i  )  const [inline, inherited]

Returns the ith coefficient.

Parameters:
i The index for the desired coefficient.
Returns:
The ith 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.

Returns:
The number of coefficients.

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.

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

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::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:
vars A vector of double values to use for the expansion.

Reimplemented from Isis::BasisFunction.

Definition at line 45 of file PolynomialBivariate.cpp.

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

std::string Isis::BasisFunction::Name (  )  const [inline, inherited]

Returns the name of the equation.

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.

Parameters:
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,

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

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

Parameters:
c The index for the desired coefficient.
Returns:
The cth term.

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.

Returns:
The number of variables.

Definition at line 80 of file BasisFunction.h.

References Isis::BasisFunction::p_numVars.

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


Member Data Documentation

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

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

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(), Expand(), Isis::Parabola::Expand(), Isis::BasisFunction::Expand(), and Isis::BasisFunction::Term().


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