Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
bertini::tracking::correct::NewtonCorrector Class Reference

/class NewtonCorrector More...

#include <newton_corrector.hpp>

Public Member Functions

 NewtonCorrector (const System &S)
 Construct a Newton corrector for a system, at the current default precision.
void Settings (const NewtonConfig &newton_settings)
 Sets the Newton configuration settings.
void ChangePrecision (unsigned new_precision)
 Change the precision of the predictor variables and reassign the Butcher table variables.
unsigned precision () const
 Get the corrector's current working precision.
void ChangeSystem (const System &S)
 Change the system(number of total functions) that the predictor uses.
void RefreshRandomDirection ()
 (Re)draw the random probe direction used to estimate ||J^{-1}|| (the condition number) from this thread's RNG engine.
std::tuple< Vec< complex_dbl >, Vec< complex_mp > > ConditionProbe () const
 The condition-number probe direction as drawn (both precisions), so the tracker can share the SAME per-path probe with the predictor – making the predictor's and corrector's ||J^{-1}|| estimates use one consistent direction.
template<typename ComplexT>
SuccessCode Correct (Vec< ComplexT > &next_space, StepMetadata &meta, System const &S, Vec< ComplexT > const &current_space, ComplexT const &current_time, NumErrorT const &tracking_tolerance, unsigned min_num_newton_iterations, unsigned max_num_newton_iterations, AdaptiveMultiplePrecisionConfig const *AMP_config=nullptr)
 Run Newton's method, optionally with adaptive multiple precision.

Detailed Description

/class NewtonCorrector

A command class which performs a newton correction step.

Purpose

Stores information computed during implementation of the method.

Use

To perform a correction step, you must instantiate an object and call Correct:

NewtonCorrect<Complex,Real> newton(sys)
success_code = newton.Correct( ... )

Constructor & Destructor Documentation

◆ NewtonCorrector()

bertini::tracking::correct::NewtonCorrector::NewtonCorrector ( const System & S)
inline

Construct a Newton corrector for a system, at the current default precision.

Member Function Documentation

◆ ChangePrecision()

void bertini::tracking::correct::NewtonCorrector::ChangePrecision ( unsigned new_precision)
inline

Change the precision of the predictor variables and reassign the Butcher table variables.

Parameters
new_precisionThe new precision.

◆ ChangeSystem()

void bertini::tracking::correct::NewtonCorrector::ChangeSystem ( const System & S)
inline

Change the system(number of total functions) that the predictor uses.

Parameters
SNew system

◆ ConditionProbe()

std::tuple< Vec< complex_dbl >, Vec< complex_mp > > bertini::tracking::correct::NewtonCorrector::ConditionProbe ( ) const
inline

The condition-number probe direction as drawn (both precisions), so the tracker can share the SAME per-path probe with the predictor – making the predictor's and corrector's ||J^{-1}|| estimates use one consistent direction.

The multiprecision half is the stored copy, at the precision it was drawn at, not the working copy the corrector holds at its current precision.

See also
RefreshRandomDirection.

◆ Correct()

template<typename ComplexT>
SuccessCode bertini::tracking::correct::NewtonCorrector::Correct ( Vec< ComplexT > & next_space,
StepMetadata & meta,
System const & S,
Vec< ComplexT > const & current_space,
ComplexT const & current_time,
NumErrorT const & tracking_tolerance,
unsigned min_num_newton_iterations,
unsigned max_num_newton_iterations,
AdaptiveMultiplePrecisionConfig const * AMP_config = nullptr )
inline

Run Newton's method, optionally with adaptive multiple precision.

One method replaces the former fixed/AMP/out-param overloads. When AMP_config is null it is a plain fixed-precision Newton loop (convergence only). When AMP_config is non-null it additionally fills the step metadata (norm_delta_z, norm_J, norm_J_inverse, condition_number_estimate) and enforces AMP criteria B and C, returning HigherPrecisionNecessary on violation.

Parameters
[out]next_spaceThe computed next space point.
[out]metaStep metadata (corrector fields; only filled in the AMP path).
SThe system we are tracking on.
current_spaceThe base point for newton correcting.
current_timeThe current time value.
tracking_toleranceIterate until the step is shorter than this.
min_num_newton_iterationsTake at least this many steps (>= 1).
max_num_newton_iterationsThe maximum number of iterations.
AMP_configAdaptive-precision settings, or nullptr for fixed precision.

◆ precision()

unsigned bertini::tracking::correct::NewtonCorrector::precision ( ) const
inline

Get the corrector's current working precision.

◆ RefreshRandomDirection()

void bertini::tracking::correct::NewtonCorrector::RefreshRandomDirection ( )
inline

(Re)draw the random probe direction used to estimate ||J^{-1}|| (the condition number) from this thread's RNG engine.

The tracker calls this once at the start of a path track (see Tracker::TrackPath's caller / the per-path reseed point), so the direction is held fixed for the ENTIRE track of that point – every Newton step and the endgame's sample-circle sub-tracks – and, given a per-path RNG reseed, is reproducible regardless of how paths were distributed across workers. It is NOT redrawn per Newton step or per TrackPath, which would both perturb condition estimates and (in the endgame) churn the RNG mid-track.

◆ Settings()

void bertini::tracking::correct::NewtonCorrector::Settings ( const NewtonConfig & newton_settings)
inline

Sets the Newton configuration settings.

Parameters
newton_settingsA Newton struct holding configuration settings.