A concept for computing an approximation of a weighted point set.
This approximation can be used to fit other points to the point set.
- Has Models:
CGAL::Weighted_PCA_approximation_3
|
void | set_point (unsigned int i, const Point &p, const FT &w) |
| changes a weighted point in the set. More...
|
|
std::size_t | size () const |
| gives the size of the weighted point set.
|
|
|
bool | compute () |
| computes the approximation. More...
|
|
bool | is_computed () const |
| checks whether the approximation has been computed successfully.
|
|
WeightedApproximation_3::WeightedApproximation_3 |
( |
unsigned int |
size) | |
|
constructs an approximation of a undefined point set.
The point set holds a fixed number of points with undefined coordinates.
- Parameters
-
size | is the size of the points set. |
- Note
- this does not compute the approximation.
bool WeightedApproximation_3::compute |
( |
) | |
|
computes the approximation.
- Returns
- whether the approximation converges. If the approximation does not converge this may indicate that the point set is too small, or the affine hull of the points cannot contain the approximation.
Point WeightedApproximation_3::fit |
( |
const Point & |
p) | |
|
fits a point to the approximation.
- Parameters
-
- Returns
- the point on the approximation closest to
p
.
- Precondition
- The approximation must have been computed.
void WeightedApproximation_3::set_point |
( |
unsigned int |
i, |
|
|
const Point & |
p, |
|
|
const FT & |
w |
|
) |
| |
changes a weighted point in the set.
This invalidates the approximation. compute()
should be called after all points have been set.
- Precondition
- i must be smaller than the total size of the point set.