Geogram
Version 1.9.1-rc
A programming library of geometric algorithms
|
Voronoi Square Distance Minimization. More...
#include <exploragram/optimal_transport/VSDM.h>
Public Member Functions | |
VSDM (Mesh *S, Mesh *T) | |
VSDM constructor. More... | |
virtual | ~VSDM () |
VSDM destructor. | |
void | set_affinity (double x) |
Sets the affinity. More... | |
void | optimize (index_t nb_iter) |
Optimizes the fitting. More... | |
void | set_progress (ProgressTask *progress) |
Sets an optional progress bar to track progress during calls of optimize() More... | |
void | set_subdivision_surface (Mesh *mesh, index_t nb_subdiv) |
Sets a subdivision surface. More... | |
Static Public Member Functions | |
static void | funcgrad_CB (index_t n, double *x, double &f, double *g) |
The callback to evaluate the objective function, used by the optimizer. More... | |
static void | newiteration_CB (index_t n, const double *x, double f, const double *g, double gnorm) |
The callback for each iteration of the optimizer. More... | |
Protected Member Functions | |
virtual void | funcgrad (index_t n, double *x, double &f, double *g) |
Evaluates the objective function and its gradient. More... | |
virtual void | newiteration () |
Updates the progress bar (if specified) and graphics. More... | |
void | add_funcgrad_affinity (index_t n, double *x, double &f, double *g) |
Adds the value and gradient of the affinity to the currently evaluated objective function. More... | |
Static Protected Member Functions | |
static VSDM * | instance () |
Gets the instance. More... | |
static void | compute_graph_Laplacian (Mesh *S, NLSparseMatrix *L) |
Computes the graph Laplacian of a surface mesh. More... | |
Protected Attributes | |
Delaunay_var | delaunay_ |
RestrictedVoronoiDiagram_var | RVD_ |
Mesh * | S_ |
Mesh * | T_ |
double | affinity_ |
double | affinity_scaling_ |
ProgressTask * | progress_ |
Optimizer_var | optimizer_ |
index_t | nb_iter_ |
index_t | cur_iter_ |
NLSparseMatrix | L_ |
vector< double > | temp_V1_ |
vector< double > | temp_V2_ |
NLMatrix | subd_matrix_ |
Mesh * | subd_ |
vector< double > | subd_g_ |
Static Protected Attributes | |
static VSDM * | instance_ |
Voronoi Square Distance Minimization.
Fits a surface mesh to a target surface mesh. The algorithm is described in the following references:
VSDM constructor.
[in] | S | the surface mesh to be fitted. |
[in] | T | the target surface mesh. |
|
protected |
Adds the value and gradient of the affinity to the currently evaluated objective function.
[in] | n | dimension of the problem (here, three times the number of vertices of the surface S). |
[in] | x | a pointer to the current vector of variables, of dimension n. |
[in,out] | f | the value of the objective function. |
[in,out] | g | a pointer to a vector of dimension n with the gradient of the objective function. |
|
staticprotected |
Computes the graph Laplacian of a surface mesh.
[in] | S | a pointer to a surface mesh. |
[out] | L | the graph Laplacian of S. |
|
protectedvirtual |
Evaluates the objective function and its gradient.
[in] | n | dimension of the problem (here, three times the number of vertices of the surface S). |
[in] | x | a pointer to the current vector of variables, of dimension n. |
[out] | f | the value of the objective function. |
[out] | g | a pointer to a vector of dimension n with the gradient of the objective function. |
|
static |
The callback to evaluate the objective function, used by the optimizer.
[in] | n | dimension of the problem (here, three times the number of vertices of the surface S). |
[in] | x | a pointer to the current vector of variables, of dimension n. |
[out] | f | the value of the objective function. |
[out] | g | a pointer to a vector of dimension n with the gradient of the objective function. |
|
inlinestaticprotected |
|
protectedvirtual |
Updates the progress bar (if specified) and graphics.
This function is called after each iteration of the optimizer.
|
static |
The callback for each iteration of the optimizer.
[in] | n | dimension of the problem (here, three times the number of vertices of the surface S). |
[in] | x | a pointer to the current vector of variables, of dimension n. |
[in] | f | the current value of the objective function. |
[in] | g | a pointer to a vector of dimension n with the gradient of the objective function. |
[in] | gnorm | the norm of the gradient. |
void GEO::VSDM::optimize | ( | index_t | nb_iter | ) |
Optimizes the fitting.
[in] | nb_iter | maximum number of iterations. |
|
inline |
|
inline |
Sets an optional progress bar to track progress during calls of optimize()
[in] | progress | a pointer to a ProgressTask. |
Sets a subdivision surface.
If this function is called, then the S mesh passed to the constructor is considered as the control mesh of a subdivision surface.
[in] | mesh | a pointer to the mesh that will store the subdivision surface. |
[in] | nb_subdiv | the number of Catmull-Clark subdivisions. |