PolyFit Class Template Reference
[Mathematical algorithms]

#include <PolyFit.hpp>

Inheritance diagram for PolyFit:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class T>
class gpstk::PolyFit< T >

Compute a polynomial fit of the form sum[X(i)*t**i] = d, that is solve for coefficients X given a set of data pairs (t,d).

The dimension of X is n, the degree of the polynomial.

 unsigned int i,n=4;
 double dat[17]={...}, times[17]={...};
 PolyFit<double> PF(n);
 for(i=0; i<17; i++)
    PF.Add(dat[i],times[i]);
 
 cout << "Solution vector: " << PF.Solution() << endl;
 cout << "Covariance matrix: " << PF.Covariance() << endl;
 for(i=0; i<17; i++)
    cout << times[i] << " " << dat[i] << " " << PF.Evaluate(times[i]) << endl;

Definition at line 79 of file PolyFit.hpp.

Public Member Functions

 PolyFit ()
 Empty constructor.
 PolyFit (unsigned int n)
 Constructor given an initial size.
void Reset (unsigned int n=0)
 Reset the estimation, i.e.
void Add (T d, T t, T w=T(1))
 Add a single (optional: weighted) datum to the estimation.
void Add (const Vector< T > &d, const Vector< T > &t)
 Add a gpstk::Vector of data to the estimation.
void Add (const std::vector< T > &d, const std::vector< T > &t)
 Add a std::vector of data to the estimation.
Evaluate (T t)
 Evaluate the polynomial at the given time; singular problems return zero.
Vector< T > Evaluate (const Vector< T > &Vt)
 Evaluate the polynomial at a Vector of times; singular problems return an empty vector.
bool isSingular (void)
 is the problem singular?
Vector< T > Solution (void)
 get the solution vector (coefficients)
Matrix< T > Covariance (void)
 get the covariance matrix
unsigned int Degree (void) const
 get the degree of the polynomial
unsigned int N (void) const
 get the number of data points processed


Constructor & Destructor Documentation

PolyFit  )  [inline]
 

Empty constructor.

Definition at line 83 of file PolyFit.hpp.

PolyFit unsigned int  n  )  [inline]
 

Constructor given an initial size.

Definition at line 86 of file PolyFit.hpp.


Member Function Documentation

void Add const std::vector< T > &  d,
const std::vector< T > &  t
[inline]
 

Add a std::vector of data to the estimation.

Definition at line 158 of file PolyFit.hpp.

void Add const Vector< T > &  d,
const Vector< T > &  t
[inline]
 

Add a gpstk::Vector of data to the estimation.

Definition at line 135 of file PolyFit.hpp.

void Add d,
t,
w = T(1)
[inline]
 

Add a single (optional: weighted) datum to the estimation.

Definition at line 116 of file PolyFit.hpp.

Referenced by GDCPass::EstimateGFslipFix(), PolyTest(), and GDCPass::prepareGFdata().

Matrix<T> Covariance void   )  [inline]
 

get the covariance matrix

Definition at line 225 of file PolyFit.hpp.

Referenced by PolyTest().

unsigned int Degree void   )  const [inline]
 

get the degree of the polynomial

Definition at line 227 of file PolyFit.hpp.

Vector<T> Evaluate const Vector< T > &  Vt  )  [inline]
 

Evaluate the polynomial at a Vector of times; singular problems return an empty vector.

Definition at line 200 of file PolyFit.hpp.

T Evaluate t  )  [inline]
 

Evaluate the polynomial at the given time; singular problems return zero.

Definition at line 182 of file PolyFit.hpp.

Referenced by GDCPass::EstimateGFslipFix(), and PolyTest().

bool isSingular void   )  [inline]
 

is the problem singular?

Definition at line 221 of file PolyFit.hpp.

Referenced by GDCPass::prepareGFdata().

unsigned int N void   )  const [inline]
 

get the number of data points processed

Definition at line 229 of file PolyFit.hpp.

Referenced by GDCPass::EstimateGFslipFix().

void Reset unsigned int  n = 0  )  [inline]
 

Reset the estimation, i.e.

restart with new data, with new dimension. Default dimension is 0, meaning do not change dimension.

Definition at line 97 of file PolyFit.hpp.

Referenced by GDCPass::EstimateGFslipFix(), PolyTest(), and GDCPass::prepareGFdata().

Vector<T> Solution void   )  [inline]
 

get the solution vector (coefficients)

Definition at line 223 of file PolyFit.hpp.

Referenced by PolyTest().


The documentation for this class was generated from the following file:
Generated on Wed Feb 8 03:31:40 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1