Class for function approximation by recording points and linearly interpolating. More...
#include <linear_approx.h>

Public Member Functions | |
| virtual double | evalAt (double x) |
| Evaluate the function approximator at point x. | |
| virtual void | leastSquaresWeights (double *X, double *Y, int n_pts) |
| Computes the least squares weights given a set of data points. | |
| LinearApprox () | |
| LinearApprox (std::vector< double > X, std::vector< double > Y) | |
| virtual | ~LinearApprox () |
Private Attributes | |
| std::vector< pt_pair > | points |
Class for function approximation by recording points and linearly interpolating.
Definition at line 53 of file linear_approx.h.
Definition at line 55 of file linear_approx.cpp.
| dmp::LinearApprox::LinearApprox | ( | std::vector< double > | X, |
| std::vector< double > | Y | ||
| ) |
Definition at line 61 of file linear_approx.cpp.
| dmp::LinearApprox::~LinearApprox | ( | ) | [virtual] |
Definition at line 75 of file linear_approx.cpp.
| double dmp::LinearApprox::evalAt | ( | double | x | ) | [virtual] |
Evaluate the function approximator at point x.
| x | The point at which to evaluate |
Implements dmp::FunctionApprox.
Definition at line 80 of file linear_approx.cpp.
| void dmp::LinearApprox::leastSquaresWeights | ( | double * | X, |
| double * | Y, | ||
| int | n_pts | ||
| ) | [virtual] |
Computes the least squares weights given a set of data points.
| X | A vector of the domain values of the points |
| Y | A vector of the target values of the points |
Implements dmp::FunctionApprox.
Definition at line 124 of file linear_approx.cpp.
std::vector<pt_pair> dmp::LinearApprox::points [private] |
Definition at line 74 of file linear_approx.h.