|
Geogram Version 1.9.7
A programming library of geometric algorithms
|
Computes the linear least squares regression of a function evaluated in 3d. More...
#include <exploragram/optimal_transport/linear_least_squares.h>
Public Member Functions | |
| LinearLeastSquares (index_t degree) | |
| Constructs a new LinearLeastSquares. | |
| void | begin () |
| Starts a new computation. | |
| void | end () |
| Ends the current computation. | |
| void | add_point (const double *p, double v) |
| Adds a sample to the current computation. | |
| double | eval (const double *p) const |
| Evaluates the least-squares linear estimate at a given point. | |
Protected Member Functions | |
| void | add_point_degree_1 (const double *p, double v) |
| Implementation of add_point() for degree 1. | |
| void | add_point_degree_2 (const double *p, double v) |
| Implementation of add_point() for degree 2. | |
| index_t | dim () const |
| Gets the dimension of the function basis. | |
| void | eval_basis (const double *p, double *b) const |
| Evaluates the function basis at a given point. | |
Static Protected Attributes | |
| static const int | MAX_DIM = 10 |
| Maximum dimension of the function basis. | |
Computes the linear least squares regression of a function evaluated in 3d.
\TODO: have a linear solve function that does not require a template argument...
Definition at line 63 of file linear_least_squares.h.
| GEO::LinearLeastSquares::LinearLeastSquares | ( | index_t | degree | ) |
Constructs a new LinearLeastSquares.
| [in] | degree | one of 1 (linear), 2 (quadratic) |
| void GEO::LinearLeastSquares::add_point | ( | const double * | p, |
| double | v | ||
| ) |
|
protected |
Implementation of add_point() for degree 1.
| [in] | p | 3d coordinates of the point |
| [in] | v | function value associated with p_in |
|
protected |
Implementation of add_point() for degree 2.
| [in] | p | 3d coordinates of the point |
| [in] | v | function value associated with p_in |
|
inlineprotected |
Gets the dimension of the function basis.
Definition at line 121 of file linear_least_squares.h.
| void GEO::LinearLeastSquares::end | ( | ) |
Ends the current computation.
Computes the current equation from the set of samples declared with add_point().
| double GEO::LinearLeastSquares::eval | ( | const double * | p | ) | const |
Evaluates the least-squares linear estimate at a given point.
This function beeds to be called after end().
| [in] | p | 3d coordinates of the point |
p
|
protected |
Evaluates the function basis at a given point.
| [in] | p | 3d coordinates of the point |
| [out] | b | array of size dim(), value of the function basis at p |
|
staticprotected |
Maximum dimension of the function basis.
Definition at line 137 of file linear_least_squares.h.