G+Smo
24.08.0
Geometry + Simulation Modules
|
This class applies hierarchical fitting of parametrized point clouds.
T | coefficient type |
Public Member Functions | |
void | applySmoothing (T lambda, gsSparseMatrix< T > &A_mat) |
void | assembleSystem (gsSparseMatrix< T > &A_mat, gsMatrix< T > &B) |
Assembles system for the least square fit. | |
void | compute (T lambda=0) |
Computes the least squares fit for a gsBasis. | |
void | computeApproxError (T &error, int type=0) const |
Computes the approximation error of the fitted curve to the original point cloud. | |
void | computeErrors () |
Computes the euclidean error for each point. | |
void | computeMaxNormErrors () |
Computes the maximum norm error for each point. | |
void | get_Error (std::vector< T > &errors, int type=0) const |
return the errors for each point | |
const std::vector< unsigned > & | get_extension () const |
Returns the chosen cell extension. | |
const gsBasis< T > & | getBasis () const |
Returns the basis of the approximation. | |
std::vector< index_t > | getBoxes (const std::vector< T > &errors, const T threshold) |
Returns boxes which define refinment area. | |
T | getRefPercentage () const |
Return the refinement percentage. | |
gsMatrix< T > & | getreturnParamValues () |
returns the parameter values | |
gsHFitting () | |
Default constructor. | |
gsHFitting (gsMatrix< T > const ¶m_values, gsMatrix< T > const &points, gsHTensorBasis< d, T > &basis, T refin, const std::vector< unsigned > &extension, T lambda=0) | |
Main constructor of the fitting class. More... | |
void | iterativeCompute (T const &tolerance, unsigned const &num_iters=10) |
Computes the least squares fit for a gsBasis. | |
void | iterativeRefine (int iterations, T tolerance, T err_threshold=-1) |
iterative_refine iteratively refine the basis More... | |
T | maxPointError () const |
Returns the maximum point-wise error from the pount cloud (or zero if not fitted) | |
T | minPointError () const |
Returns the minimum point-wise error from the pount cloud (or zero if not fitted) | |
const gsMappedSpline< 2, T > & | mresult () const |
gives back the computed approximation for multipatch geometry | |
bool | nextIteration (T tolerance, T err_threshold, index_t maxPcIter=0) |
nextIteration One step of the refinement of iterative_refine(...); More... | |
bool | nextIteration (T tolerance, T err_threshold, const std::vector< boxSide > &fixedSides, index_t maxPcIter=0) |
Like nextIteration without fixedSides but keeping the values on these sides unchanged throughout the fit. | |
size_t | numPointsBelow (T threshold) const |
Computes the number of points below the error threshold (or zero if not fitted) | |
const std::vector< T > & | pointWiseErrors () const |
Return the errors for each point. | |
gsGeometry< T > * | result () const |
gives back the computed approximation | |
gsMatrix< T > | returnPoints () const |
returns the points | |
void | setConstraints (const gsSparseMatrix< T > &lhs, const gsMatrix< T > &rhs) |
void | setConstraints (const std::vector< index_t > &indices, const std::vector< gsMatrix< T > > &coefs) |
void | setConstraints (const std::vector< boxSide > &fixedSides) |
void | setConstraints (const std::vector< boxSide > &fixedSides, const std::vector< gsBSpline< T > > &fixedCurves) |
void | setExtension (std::vector< unsigned > const &extension) |
Sets the cell extension. | |
void | setRefPercentage (double refPercent) |
Sets the refinement percentage. | |
Protected Member Functions | |
virtual void | appendBox (std::vector< index_t > &boxes, std::vector< index_t > &cells, const gsVector< T > ¶meter) |
T | setRefineThreshold (const std::vector< T > &errors) |
Identifies the threshold from where we should refine. | |
Static Protected Member Functions | |
static void | append (std::vector< index_t > &boxes, const gsVector< index_t > &box) |
Appends a box to the end of boxes (This function also works for cells) | |
static bool | isCellAlreadyInserted (const gsVector< index_t, d > &a_cell, const std::vector< index_t > &cells) |
Checks if a_cell is already inserted in container of cells. | |
Protected Attributes | |
gsFunctionSet< T > * | m_basis |
Pointer keeping the basis. | |
gsSparseMatrix< T > | m_constraintsLHS |
gsMatrix< T > | m_constraintsRHS |
std::vector< unsigned > | m_ext |
Size of the extension. | |
T | m_lambda |
Smoothing parameter. | |
T | m_max_error |
Maximum point-wise error. | |
T | m_min_error |
Minimum point-wise error. | |
gsMappedSpline< 2, T > | m_mresult |
Pointer keeping the resulting multipatch geometry. | |
gsMatrix< T > | m_param_values |
the parameter values of the point cloud | |
gsMatrix< T > | m_points |
the points of the point cloud | |
T | m_ref |
How many % to refine - 0-1 interval. | |
gsGeometry< T > * | m_result |
Pointer keeping the resulting geometry. | |
|
inline |
Main constructor of the fitting class.
param_values | a matrix containing the parameter values that parametrize the points |
points | The points to be fitted |
basis | Hiearchical basis to use for fitting |
refin | Percentage of errors to refine (if this strategy is chosen) |
extension | Extension to apply to marked cells |
lambda | Smoothing parameter |
|
protectedvirtual |
Appends a box around parameter to the boxes only if the box is not already in boxes
|
inherited |
Adds to the matrix A_mat terms for minimization of second derivative, weighted with parameter lambda.
void iterativeRefine | ( | int | iterations, |
T | tolerance, | ||
T | err_threshold = -1 |
||
) |
iterative_refine iteratively refine the basis
iterations | maximum number of iterations |
tolerance | (>=0) if the max error is below the tolerance the refinement stops |
err_threshold | if non negative all cells with errors bigger than the threshold are refined / If it is equal to -1 the m_ref percentage is used 0 = global refinement |
bool nextIteration | ( | T | tolerance, |
T | err_threshold, | ||
index_t | maxPcIter = 0 |
||
) |
nextIteration One step of the refinement of iterative_refine(...);
tolerance | (>=0) if the maximum error is below the tolerance the refinement stops; |
err_threshold | the same as in iterative_refine(...). |
|
inlineinherited |
Sets constraints that the coefficients of the resulting geometry have to conform to. More precisely, denoting the coefficient vector by x, it enforces lhs * x = rhs.
|
inherited |
Sets constraints on that the coefficients of the resulting geometry have to conform to.
indices | indices (in the coefficient vector) of the prescribed coefficients. |
coefs | prescribed coefficients. |
|
inherited |
Sets constraints in such a way that the previous values at fixedSides of the geometry remain intact.
|
inherited |
Set constraints in such a way that the resulting geometry on each of fixedSides will coincide with the corresponding curve in fixedCurves.
|
protectedinherited |
Left hand-side of the constraints that the coefficients of the resulting geometry have to conform to. This corresponds to matrix D in Prautzch, Boehm, Paluszny: Bezier and B-spline techniques, Section 4.7.
|
protectedinherited |
Right hand-side of the constraints that the coefficients of the resulting geometry have to conform to. This corresponds to vector q in Prautzch, Boehm, Paluszny: Bezier and B-spline techniques, Section 4.7.