Wildmeshing Toolkit
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
wmtk::optimization::ExactDistanceEnergy2D Class Reference

The true w * d^2 to the exact piecewise-linear input with its TRUE Hessian. More...

#include <EnvelopeEnergy.hpp>

Inheritance diagram for wmtk::optimization::ExactDistanceEnergy2D:

Public Member Functions

 ExactDistanceEnergy2D (const std::shared_ptr< SampleEnvelope > &envelope, const double weight=1)
 
double value (const TVector &x) override
 
void gradient (const TVector &x, TVector &gradv) override
 
void hessian (const TVector &x, THessian &hessian) override
 
void hessian (const TVector &x, MatrixXd &hessian) override
 
void solution_changed (const TVector &new_x) override
 

Private Attributes

std::shared_ptr< SampleEnvelopem_envelope
 
double m_weight
 

Detailed Description

The true w * d^2 to the exact piecewise-linear input with its TRUE Hessian.

Within each closest-feature region the distance to a PL input is exactly quadratic, so the true Hessian is computable and cheap: 2w n n^T over a segment interior (n the segment normal), 2w I at a polyline corner. Value and gradient are the true distance and its true gradient, re-queried fresh at every evaluation; unlike the Gauss-Newton model, all three callbacks agree under finite differences everywhere off a region boundary.

Behaviorally, the geometry decides where sliding is free: segment interiors slide, corners hold isotropically.


The documentation for this class was generated from the following files: