Wildmeshing Toolkit
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
wmtk::optimization::NewtonCounters Struct Reference

How the vertex solves of a smoothing pass ended: Newton iterations taken and the status polysolve stopped on, counted per pass. More...

#include <SmoothVertex.hpp>

Public Member Functions

void record (const polysolve::nonlinear::Solver &s, const bool did_throw)
 One solve that just returned from minimize(), or threw out of it (did_throw).
 
size_t solves () const
 
void reset ()
 
std::string to_string () const
 

Static Public Member Functions

static const char * status_name (const size_t i)
 

Public Attributes

std::array< std::atomic< size_t >, kIterBuckets > iterations {}
 
std::array< std::atomic< size_t >, kStatuses > status {}
 
std::atomic< size_t > iterations_total {0}
 
std::atomic< size_t > threw {0}
 

Static Public Attributes

static constexpr size_t kIterBuckets = 12
 0 .. 10 iterations, and one bucket for more than 10.
 
static constexpr size_t kStatuses = 14
 polysolve::nonlinear::Status, NotStarted (-1) .. UpdateDirectionFailed (12), shifted by 1.
 

Detailed Description

How the vertex solves of a smoothing pass ended: Newton iterations taken and the status polysolve stopped on, counted per pass.

The solver runs basic_nonlinear_solver_params (solver.hpp): DenseNewton, at most 10 iterations, allow_out_of_iterations, rel_grad_norm_tol 0. So a solve stops on an absolute tolerance, on the iteration cap without complaint, or on a failure polysolve reports by throwing (a failed line search on the last strategy, a NaN). The accepted / rejected line cannot tell a pass whose solves all hit the cap from one whose solves converge in two iterations; this does.

Read from the solver object, not from info(): status() and current_criteria().iterations are set before polysolve throws, while info() is not updated on that path, so a thrown solve is still classified by the status it stopped on.

Member Function Documentation

◆ to_string()

std::string wmtk::optimization::NewtonCounters::to_string ( ) const
inline

solves=N mean_iterations=m | iterations 0=a 1=b ... 10=k >10=l | stop <nonzero statuses> | threw=t. Every iteration bucket is printed, zeros included, so the histogram's shape reads at a glance.


The documentation for this struct was generated from the following file: