Public Types | Public Member Functions | Protected Attributes | Private Attributes | List of all members
towr::Polynomial Class Reference

A polynomial of arbitrary order and dimension. More...

#include <polynomial.h>

Inheritance diagram for towr::Polynomial:
Inheritance graph
[legend]

Public Types

enum  Coefficients {
  A =0, B, C, D,
  E, F, G, H,
  I, J
}
 
using CoeffIDVec = std::vector< Coefficients >
 
using VectorXd = Eigen::VectorXd
 

Public Member Functions

double GetDerivativeWrtCoeff (double t, Dx poly_deriv, Coefficients coeff) const
 The derivative of the polynomial with respect to the coefficients. More...
 
State GetPoint (double t) const
 
 Polynomial (int poly_order, int poly_dim)
 Constructs a polynomial with zero coefficient values. More...
 
virtual ~Polynomial ()=default
 

Protected Attributes

std::vector< VectorXdcoeff_
 

Private Attributes

CoeffIDVec coeff_ids_
 

Detailed Description

A polynomial of arbitrary order and dimension.

A polynomial, e.g. 5th order is defined as: f(t) = Ft^5 + Et^4 + Dt^3 + Ct^2 + Bt + A fd(t) = 5Ft^4 + 4Et^3 + 3Dt^2 + 2Ct + B fdd(t) = 20Ft^3 + 12Et^2 + 6Dt + 2C

This class is responsible for calculating the values f(t) and higher order derivatives from the coefficient values.

Definition at line 53 of file polynomial.h.

Member Typedef Documentation

◆ CoeffIDVec

Definition at line 56 of file polynomial.h.

◆ VectorXd

using towr::Polynomial::VectorXd = Eigen::VectorXd

Definition at line 57 of file polynomial.h.

Member Enumeration Documentation

◆ Coefficients

Enumerator

Definition at line 55 of file polynomial.h.

Constructor & Destructor Documentation

◆ Polynomial()

towr::Polynomial::Polynomial ( int  poly_order,
int  poly_dim 
)
explicit

Constructs a polynomial with zero coefficient values.

Parameters
poly_orderThe highest exponent of t, e.g. 5-th order -> t^5.
poly_dimThe dimensions of f(t), e.g. x,y,z.

Definition at line 38 of file polynomial.cc.

◆ ~Polynomial()

virtual towr::Polynomial::~Polynomial ( )
virtualdefault

Member Function Documentation

◆ GetDerivativeWrtCoeff()

double towr::Polynomial::GetDerivativeWrtCoeff ( double  t,
Dx  poly_deriv,
Coefficients  coeff 
) const

The derivative of the polynomial with respect to the coefficients.

Parameters
tThe time at which the derivative should be evaluated.
poly_derivWhich polynomial derivative f(t), fd(t), function to use.
coeffThe coefficient with respect to which to calculate the derivative.

Definition at line 64 of file polynomial.cc.

◆ GetPoint()

State towr::Polynomial::GetPoint ( double  t) const
Returns
The state of the polyomial at a specific time t.

Definition at line 47 of file polynomial.cc.

Member Data Documentation

◆ coeff_

std::vector<VectorXd> towr::Polynomial::coeff_
protected

Definition at line 83 of file polynomial.h.

◆ coeff_ids_

CoeffIDVec towr::Polynomial::coeff_ids_
private

Definition at line 86 of file polynomial.h.


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


towr
Author(s): Alexander W. Winkler
autogenerated on Mon Feb 28 2022 23:54:22