Computes the linear least squares regression of a function evaluated in 3d.
More...
#include <exploragram/optimal_transport/linear_least_squares.h>
|
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.
◆ LinearLeastSquares()
GEO::LinearLeastSquares::LinearLeastSquares |
( |
index_t |
degree | ) |
|
Constructs a new LinearLeastSquares.
- Parameters
-
[in] | degree | one of 1 (linear), 2 (quadratic) |
◆ add_point()
void GEO::LinearLeastSquares::add_point |
( |
const double * |
p, |
|
|
double |
v |
|
) |
| |
Adds a sample to the current computation.
This function needs to be called between a begin() / end() pair.
- Parameters
-
[in] | p | 3d coordinates of the point |
[in] | v | function value associated with p_in |
◆ add_point_degree_1()
void GEO::LinearLeastSquares::add_point_degree_1 |
( |
const double * |
p, |
|
|
double |
v |
|
) |
| |
|
protected |
Implementation of add_point() for degree 1.
- Parameters
-
[in] | p | 3d coordinates of the point |
[in] | v | function value associated with p_in |
◆ add_point_degree_2()
void GEO::LinearLeastSquares::add_point_degree_2 |
( |
const double * |
p, |
|
|
double |
v |
|
) |
| |
|
protected |
Implementation of add_point() for degree 2.
- Parameters
-
[in] | p | 3d coordinates of the point |
[in] | v | function value associated with p_in |
◆ end()
void GEO::LinearLeastSquares::end |
( |
| ) |
|
Ends the current computation.
Computes the current equation from the set of samples declared with add_point().
◆ eval()
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().
- Parameters
-
[in] | p | 3d coordinates of the point |
- Returns
- the linear estimate at
p
◆ eval_basis()
void GEO::LinearLeastSquares::eval_basis |
( |
const double * |
p, |
|
|
double * |
b |
|
) |
| const |
|
protected |
Evaluates the function basis at a given point.
- Parameters
-
[in] | p | 3d coordinates of the point |
[out] | b | array of size dim(), value of the function basis at p |
The documentation for this class was generated from the following file: