Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
bertini::tracking::FixedPrecisionTracker< DerivedT > Class Template Referenceabstract

CRTP base for trackers that work at a single fixed precision (double or fixed multiple). More...

#include <fixed_precision_tracker.hpp>

Inheritance diagram for bertini::tracking::FixedPrecisionTracker< DerivedT >:
[legend]
Collaboration diagram for bertini::tracking::FixedPrecisionTracker< DerivedT >:
[legend]

Public Types

using BaseComplexT = typename TrackerTraits<DerivedT>::BaseComplexT
 The complex number type.
using BaseRealT = typename TrackerTraits<DerivedT>::BaseRealT
 The real number type.
using ComplexT = BaseComplexT
 The complex number type.
using RealT = BaseRealT
 The real number type.
using EmitterType = FixedPrecisionTracker<DerivedT>
 The event-emitter type for this tracker.
using Base = Tracker<FixedPrecisionTracker<DerivedT>>
 The base tracker type.
using Config = typename Base::Config
 The configuration-holding base type.
using Stepping = typename Base::Stepping
 The stepping configuration type.
using Newton = typename Base::Newton
 The Newton corrector configuration type.
using PrecConf
 The precision configuration type for this tracker.
using UsedConfigs = TypeList<Ts...>
 The list of configuration types this object holds.

Public Member Functions

virtual ~FixedPrecisionTracker ()=default
 FixedPrecisionTracker (System const &sys)
 Construct a fixed-precision tracker for a system.
void PrecisionSetup (FixedPrecisionConfig const &)
 An additional no-op call, provided for conformity of interface with AMP tracker in generic code.
Vec< ComplexT > CurrentPoint () const override
 Get the current space point of the track.
void ResetCounters () const override
 Reset counters used during tracking.
SuccessCode PreIterationCheck () const override
 Ensure that number of steps, stepsize, and precision still ok.
void PostTrackCleanup () const override
 Function to be called before exiting the tracker loop.
void CopySolution (Vec< ComplexT > &solution_at_endtime) const override
 Copy from the internally stored current solution into a final solution.
SuccessCode TrackerIteration () const override
 Run an iteration of the tracker loop.
SuccessCode CheckGoingToInfinity () const override
 Check whether the path is going to infinity.
SuccessCode UpdateStepsize () const
 Commit the next stepsize, and adjust internals.
void OnStepSuccess () const override
 Increment and reset counters after a successful TrackerIteration().
void OnStepFail () const override
 Increment and reset counters after a failed TrackerIteration().
void OnInfiniteTruncation () const override
 React to a path being truncated for going to infinity, by notifying observers.
SuccessCode Predict (Vec< ComplexT > &predicted_space, Vec< ComplexT > const &current_space, ComplexT const &current_time, ComplexT const &delta_t) const
 Wrapper function for calling the correct predictor.
SuccessCode Correct (Vec< ComplexT > &corrected_space, Vec< ComplexT > const &current_space, ComplexT const &current_time) const
 Run Newton's method.
SuccessCode RefineImpl (Vec< ComplexT > &new_space, Vec< ComplexT > const &start_point, ComplexT const &current_time) const
 Run Newton's method from a start point with a current time.
SuccessCode RefineImpl (Vec< ComplexT > &new_space, Vec< ComplexT > const &start_point, ComplexT const &current_time, NumErrorT const &tolerance, unsigned max_iterations) const
 Run Newton's method from a start point with a current time.
void Setup (Predictor new_predictor_choice, NumErrorT const &tracking_tolerance, SteppingConfig const &stepping, NewtonConfig const &newton)
 Get the tracker set up for tracking.
void Setup (Predictor new_predictor_choice, NumErrorT const &tracking_tolerance, NumErrorT const &path_truncation_threshold, SteppingConfig const &stepping, NewtonConfig const &newton)
 Get the tracker set up for tracking, and set its truncation threshold too.
void SetTrackingTolerance (NumErrorT const &tracking_tolerance)
 Set how tightly to track the path.
void SetInfiniteTruncationTolerance (NumErrorT const &tol)
 Set the threshold beyond which a path is judged to be going to infinity (and truncated).
void RefreshConditionDirection ()
 (Re)draw the random probe direction used for condition-number estimation.
SuccessCode TrackPath (Vec< ComplexT > &solution_at_endtime, ComplexT const &start_time, ComplexT const &endtime, Vec< ComplexT > const &start_point) const
 Track a start point through time, from a start time to a target time.
SuccessCode Refine (Vec< C > &new_space, Vec< C > const &start_point, C const &current_time) const
 Refine a point to tolerance implicitly internally set.
SuccessCode Refine (Vec< C > &new_space, Vec< C > const &start_point, C const &current_time, NumErrorT const &tolerance, unsigned max_iterations) const
 Refine a point to a given tolerance.
void SetPredictor (Predictor new_predictor_choice)
 Change tracker to use a predictor.
Predictor GetPredictor () const
 Query the currently set predictor.
void SyncSettings () const
 Bring state derived from the settings in line with the settings.
void SetSystem (const System &new_sys)
 get a const reference to the system.
const System & GetSystem () const
 get a const reference to the system.
unsigned NumTotalStepsTaken () const
 See how many steps have been taken.
void ResetCumulativeStepCounts () const
 Zero the cumulative step counts.
unsigned CumulativeSuccessfulSteps () const
 Successful steps since the last ResetCumulativeStepCounts, across every TrackPath call in between.
unsigned CumulativeFailedSteps () const
 Failed steps since the last ResetCumulativeStepCounts, across every TrackPath call in between.
void SetMaxWallClockTime (std::chrono::steady_clock::time_point deadline) const
 Give the tracker a wall-clock deadline: a point in time after which any track in progress is abandoned between steps with SuccessCode::WallClockLimitReached.
void SetMaxWallClockDuration (std::chrono::duration< Rep, Period > duration) const
 Give the tracker a wall-clock budget counted from now: SetMaxWallClockTime(now + duration).
void ClearMaxWallClockTime () const
 Remove the wall-clock deadline; tracking is unlimited again.
std::optional< std::chrono::steady_clock::time_point > MaxWallClockTime () const
 The wall-clock deadline in force, if any.
void SetStepSize (RealT const &new_stepsize) const
 Set how large the stepsize should be.
void ReinitializeInitialStepSize (bool should_reinitialize_stepsize)
 Switch resetting of initial step size to that of the stepping settings.
auto TrackingTolerance () const
 Get the currently set tracking tolerance.
unsigned DigitsTrackingTolerance () const
 The number of digits tracking to the current tolerance demands, condition number notwithstanding.
auto InfiniteTruncationTolerance () const
 Get the currently set infinite-truncation (path) threshold.
NumErrorT LatestConditionNumber () const
 Get the condition-number estimate from the most recent predict/correct step.
NumErrorT LatestErrorEstimate () const
 Get the error estimate from the most recent predict/correct step.
NumErrorT LatestNormOfStep () const
 Get the norm of the Newton step from the most recent predict/correct step.
void SetInfiniteTruncation (bool b)
 Turn the going-to-infinity path truncation check on or off.
auto InfiniteTruncation ()
 Query whether the going-to-infinity path truncation check is enabled.
unsigned NumVariables () const
 Get the number of variables in the system being tracked.
auto CurrentTime () const
 Get the current time value of the track.
auto DeltaT () const
 Get the current time-step increment (delta t).
auto CurrentStepsize () const
 Get the current step size.
virtual unsigned CurrentPrecision () const=0
 Get the current working precision of the tracker.
const T & Get () const
 Bring the configuration getter into scope, for querying config settings.
void AddObserver (AnyObserver &new_observer) const
 Add an observer (non-owning) to observe this observable.
void AddObserver (std::shared_ptr< AnyObserver > const &new_observer) const
 Add an observer whose lifetime is co-owned by this observable.
void RemoveObserver (AnyObserver &observer) const
 Remove an observer from this observable.
virtual bool ObservableIsA (std::type_index t) const
 Whether this observable may be observed as the given type.
template<typename T, typename = typename std::enable_if<IsTemplateParameter<T,Ts...>::value>::type>
void Set (T const &t)
 Set the held configuration object of type T.

Public Attributes

std::tuple< Ts... > configuration_
 The held configuration objects, one per config type.

Protected Types

using TupOfVec
 A tuple of complex vectors, one per numeric type the tracker uses.
using TupOfReal
 A tuple of real vectors, one per numeric type the tracker uses.

Protected Member Functions

void ResetCountersBase () const
 Reset the base-class step counters (successes, failures, consecutive runs, total) to zero.
void IncrementBaseCountersSuccess () const
 Increment and reset counters after a successful TrackerIteration().
void IncrementBaseCountersFail () const
 Increment and reset counters after a failed TrackerIteration().
void NotifyObservers (AnyEvent const &e) const
 Sends an event to observers that subscribed to its exact dynamic type, then to all catch-all (untyped) observers.
void NotifyObservers (AnyEvent &e) const
 Notify all observers of a (mutable) event.
bool HasObservers () const
 Whether anyone is currently observing (conservative).

Protected Attributes

std::reference_wrapper< const System > tracked_system_
 Reference to the system being tracked.
bool infinite_path_truncation_
 Whether should check if the path is going to infinity while tracking. On by default.
bool reinitialize_stepsize_
 Whether should re-initialize the stepsize with each call to Trackpath. On by default.
unsigned num_successful_steps_taken_
 The number of successful steps taken so far.
unsigned num_consecutive_successful_steps_
 The number of CONSECUTIVE successful steps taken in a row.
unsigned num_consecutive_failed_steps_
 The number of CONSECUTIVE failed steps taken in a row.
unsigned num_failed_steps_taken_
 The total number of failed steps taken.
unsigned num_successful_steps_cumulative_
 Successful steps since ResetCumulativeStepCounts, across TrackPath calls.
unsigned num_failed_steps_cumulative_
 Failed steps since ResetCumulativeStepCounts, across TrackPath calls.
std::optional< std::chrono::steady_clock::time_point > wall_clock_deadline_
 Give up between steps once this passes; none by default.
predict::ExplicitRKPredictor predictor_
 The predictor to use while tracking.
unsigned predictor_order_
 The order of the predictor – one less than the error estimate order. Derived from the setting by SyncPredictor, not written when the setting is.
correct::NewtonCorrector corrector_
 The Newton corrector used to refine predicted points.
unsigned digits_final_
 The number of digits to track to, due to being in endgame zone.
ComplexT endtime_
 The time we are tracking to.
ComplexT current_time_
 The current time.
ComplexT delta_t_
 The current delta_t.
RealT current_stepsize_
 The current stepsize.
RealT next_stepsize_
 The next stepsize.
SuccessCode step_success_code_
 The code for step success.
unsigned num_steps_since_last_condition_number_computation_
 How many steps have passed since the most recent condition number estimate.
unsigned num_successful_steps_since_stepsize_increase_
 How many successful steps have been taken since increased stepsize.
TupOfVec current_space_
 The current space value.
TupOfVec tentative_space_
 After correction, the tentative next space value.
TupOfVec temporary_space_
 After prediction, the tentative next space value.
StepMetadata last_step_
 Metadata from the most recent predict or correct step (norms, condition number, size proportion, error estimate, norm of the Newton step).

Detailed Description

template<class DerivedT>
class bertini::tracking::FixedPrecisionTracker< DerivedT >

CRTP base for trackers that work at a single fixed precision (double or fixed multiple).

Member Typedef Documentation

◆ Base

template<class DerivedT>
using bertini::tracking::FixedPrecisionTracker< DerivedT >::Base = Tracker<FixedPrecisionTracker<DerivedT>>

The base tracker type.

◆ BaseComplexT

template<class DerivedT>
using bertini::tracking::FixedPrecisionTracker< DerivedT >::BaseComplexT = typename TrackerTraits<DerivedT>::BaseComplexT

The complex number type.

◆ BaseRealT

template<class DerivedT>
using bertini::tracking::FixedPrecisionTracker< DerivedT >::BaseRealT = typename TrackerTraits<DerivedT>::BaseRealT

The real number type.

◆ ComplexT

template<class DerivedT>
using bertini::tracking::FixedPrecisionTracker< DerivedT >::ComplexT = BaseComplexT

The complex number type.

◆ Config

template<class DerivedT>
using bertini::tracking::FixedPrecisionTracker< DerivedT >::Config = typename Base::Config

The configuration-holding base type.

◆ EmitterType

template<class DerivedT>
using bertini::tracking::FixedPrecisionTracker< DerivedT >::EmitterType = FixedPrecisionTracker<DerivedT>

The event-emitter type for this tracker.

◆ Newton

template<class DerivedT>
using bertini::tracking::FixedPrecisionTracker< DerivedT >::Newton = typename Base::Newton

The Newton corrector configuration type.

◆ PrecConf

using bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::PrecConf
inherited

The precision configuration type for this tracker.

◆ RealT

template<class DerivedT>
using bertini::tracking::FixedPrecisionTracker< DerivedT >::RealT = BaseRealT

The real number type.

◆ Stepping

template<class DerivedT>
using bertini::tracking::FixedPrecisionTracker< DerivedT >::Stepping = typename Base::Stepping

The stepping configuration type.

◆ TupOfReal

using bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::TupOfReal
protectedinherited

A tuple of real vectors, one per numeric type the tracker uses.

◆ TupOfVec

using bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::TupOfVec
protectedinherited

A tuple of complex vectors, one per numeric type the tracker uses.

◆ UsedConfigs

template<typename ... Ts>
using bertini::detail::Configured< Ts >::UsedConfigs = TypeList<Ts...>
inherited

The list of configuration types this object holds.

Constructor & Destructor Documentation

◆ ~FixedPrecisionTracker()

template<class DerivedT>
virtual bertini::tracking::FixedPrecisionTracker< DerivedT >::~FixedPrecisionTracker ( )
virtualdefault

◆ FixedPrecisionTracker()

template<class DerivedT>
bertini::tracking::FixedPrecisionTracker< DerivedT >::FixedPrecisionTracker ( System const & sys)
inline

Construct a fixed-precision tracker for a system.

Member Function Documentation

◆ AddObserver() [1/2]

void bertini::Observable::AddObserver ( AnyObserver & new_observer) const
inlineinherited

Add an observer (non-owning) to observe this observable.

Stores only a raw reference: the caller is responsible for keeping the observer alive while it is attached. This is the right overload for stack-allocated C++ observers added and removed within a scope. For an observer whose lifetime you would rather have tracked, see the shared_ptr overload.

Observers that override SubscribedEventTypes() with a non-empty list are registered in a type-indexed map so NotifyObservers only calls them for events they declared interest in. Observers returning an empty list (the default) are placed in a catch-all list and receive every event.

Safe to call from inside an observer's Observe() (i.e. during a notification): the add is deferred and applied once the current notification loop finishes. This is what lets a "meta-observer" attach new observers in response to events.

Exceptions
IncompatibleObserverif the observer's ObservedKind() is not one this observable can be observed as.

◆ AddObserver() [2/2]

void bertini::Observable::AddObserver ( std::shared_ptr< AnyObserver > const & new_observer) const
inlineinherited

Add an observer whose lifetime is co-owned by this observable.

The observable keeps a shared_ptr, so the observer stays alive (and keeps receiving events) for as long as it is attached, even after the caller drops their own reference — "attach it and forget it", with no dangling. It is released when RemoveObserver is called or this observable is destroyed. (Stack-allocated C++ observers can't be shared_ptr-owned; use the reference overload for those.)

Exceptions
IncompatibleObserverif incompatible (see the reference overload).

◆ CheckGoingToInfinity()

template<class DerivedT>
SuccessCode bertini::tracking::FixedPrecisionTracker< DerivedT >::CheckGoingToInfinity ( ) const
inlineoverridevirtual

Check whether the path is going to infinity.

Implements bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >.

◆ ClearMaxWallClockTime()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::ClearMaxWallClockTime ( ) const
inlineinherited

Remove the wall-clock deadline; tracking is unlimited again.

◆ CopySolution()

template<class DerivedT>
void bertini::tracking::FixedPrecisionTracker< DerivedT >::CopySolution ( Vec< ComplexT > & solution_at_endtime) const
inlineoverridevirtual

Copy from the internally stored current solution into a final solution.

If preservation of precision is on, this function first returns to the initial precision.

Parameters
[out]solution_at_endtimeThe solution at the end time

Implements bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >.

◆ Correct()

template<class DerivedT>
SuccessCode bertini::tracking::FixedPrecisionTracker< DerivedT >::Correct ( Vec< ComplexT > & corrected_space,
Vec< ComplexT > const & current_space,
ComplexT const & current_time ) const
inline

Run Newton's method.

Wrapper function for calling Correct and getting the error estimates etc directly into the tracker object.

Parameters
[out]corrected_spaceThe spatial result of the correction loop.
current_spaceThe start point in space for running the corrector loop.
current_timeThe current time value.
Returns
A SuccessCode indicating whether the loop was successful in converging in the max number of allowable newton steps, to the current path tolerance.

◆ CumulativeFailedSteps()

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::CumulativeFailedSteps ( ) const
inlineinherited

Failed steps since the last ResetCumulativeStepCounts, across every TrackPath call in between.

◆ CumulativeSuccessfulSteps()

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::CumulativeSuccessfulSteps ( ) const
inlineinherited

Successful steps since the last ResetCumulativeStepCounts, across every TrackPath call in between.

◆ CurrentPoint()

template<class DerivedT>
Vec< ComplexT > bertini::tracking::FixedPrecisionTracker< DerivedT >::CurrentPoint ( ) const
inlineoverridevirtual

Get the current space point of the track.

Implements bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >.

◆ CurrentPrecision()

virtual unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::CurrentPrecision ( ) const
pure virtualinherited

Get the current working precision of the tracker.

◆ CurrentStepsize()

auto bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::CurrentStepsize ( ) const
inlineinherited

Get the current step size.

◆ CurrentTime()

auto bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::CurrentTime ( ) const
inlineinherited

Get the current time value of the track.

◆ DeltaT()

auto bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::DeltaT ( ) const
inlineinherited

Get the current time-step increment (delta t).

◆ DigitsTrackingTolerance()

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::DigitsTrackingTolerance ( ) const
inlineinherited

The number of digits tracking to the current tolerance demands, condition number notwithstanding.

Derived on demand rather than cached at set time, so it cannot go stale behind a setting written through the ordinary config surface.

◆ Get()

( ) const
inherited

Bring the configuration getter into scope, for querying config settings.

◆ GetPredictor()

Predictor bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::GetPredictor ( ) const
inlineinherited

Query the currently set predictor.

◆ GetSystem()

const System & bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::GetSystem ( ) const
inlineinherited

get a const reference to the system.

◆ HasObservers()

bool bertini::Observable::HasObservers ( ) const
inlineprotectedinherited

Whether anyone is currently observing (conservative).

Lets an emitter skip constructing an event – and any work needed to build its payload, such as a numeric-type conversion – when there is no observer to receive it. Conservative: returns true if any watcher list is non-empty (even if a stale, emptied typed bucket lingers), so it never wrongly suppresses a real observer.

◆ IncrementBaseCountersFail()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::IncrementBaseCountersFail ( ) const
inlineprotectedinherited

Increment and reset counters after a failed TrackerIteration().

Your custom override, if provided, should almost certainly call this function.

◆ IncrementBaseCountersSuccess()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::IncrementBaseCountersSuccess ( ) const
inlineprotectedinherited

Increment and reset counters after a successful TrackerIteration().

Your custom override, if provided, should almost certainly call this function.

◆ InfiniteTruncation()

auto bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::InfiniteTruncation ( )
inlineinherited

Query whether the going-to-infinity path truncation check is enabled.

◆ InfiniteTruncationTolerance()

auto bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::InfiniteTruncationTolerance ( ) const
inlineinherited

Get the currently set infinite-truncation (path) threshold.

◆ LatestConditionNumber()

NumErrorT bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::LatestConditionNumber ( ) const
inlineinherited

Get the condition-number estimate from the most recent predict/correct step.

◆ LatestErrorEstimate()

NumErrorT bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::LatestErrorEstimate ( ) const
inlineinherited

Get the error estimate from the most recent predict/correct step.

◆ LatestNormOfStep()

NumErrorT bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::LatestNormOfStep ( ) const
inlineinherited

Get the norm of the Newton step from the most recent predict/correct step.

◆ MaxWallClockTime()

std::optional< std::chrono::steady_clock::time_point > bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::MaxWallClockTime ( ) const
inlineinherited

The wall-clock deadline in force, if any.

◆ NotifyObservers() [1/2]

void bertini::Observable::NotifyObservers ( AnyEvent & e) const
inlineprotectedinherited

Notify all observers of a (mutable) event.

◆ NotifyObservers() [2/2]

void bertini::Observable::NotifyObservers ( AnyEvent const & e) const
inlineprotectedinherited

Sends an event to observers that subscribed to its exact dynamic type, then to all catch-all (untyped) observers.

Mutations of the observer lists are deferred for the duration of a notification (see AddObserver/RemoveObserver), so iterating the live lists here is safe even when an observer subscribes/unsubscribes mid-dispatch. An observer that returns ObserveResult::Unsubscribe is dropped once the (possibly nested) notification completes. The depth counter keeps this correct under re-entrant emission.

◆ NumTotalStepsTaken()

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::NumTotalStepsTaken ( ) const
inlineinherited

See how many steps have been taken.

Returns
The total number of steps taken, including successes and fails.

◆ NumVariables()

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::NumVariables ( ) const
inlineinherited

Get the number of variables in the system being tracked.

◆ ObservableIsA()

virtual bool bertini::Observable::ObservableIsA ( std::type_index t) const
inlinevirtualinherited

Whether this observable may be observed as the given type.

Drives the compatibility check in AddObserver. The default accepts the wildcard typeid(void) and this observable's own dynamic type. An observable that emits its events templated on a base type (so a single observer type serves many concrete observables) should also accept that base type — e.g. ZeroDim accepts AnyZeroDim.

Reimplemented in bertini::algorithm::HomotopySolver< TrackerType, EndgameType, SystemType >, and bertini::algorithm::HomotopySolver< A, B, C >.

◆ OnInfiniteTruncation()

template<class DerivedT>
void bertini::tracking::FixedPrecisionTracker< DerivedT >::OnInfiniteTruncation ( ) const
inlineoverridevirtual

React to a path being truncated for going to infinity, by notifying observers.

Implements bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >.

◆ OnStepFail()

template<class DerivedT>
void bertini::tracking::FixedPrecisionTracker< DerivedT >::OnStepFail ( ) const
inlineoverridevirtual

Increment and reset counters after a failed TrackerIteration().

Implements bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >.

◆ OnStepSuccess()

template<class DerivedT>
void bertini::tracking::FixedPrecisionTracker< DerivedT >::OnStepSuccess ( ) const
inlineoverridevirtual

Increment and reset counters after a successful TrackerIteration().

Implements bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >.

◆ PostTrackCleanup()

template<class DerivedT>
void bertini::tracking::FixedPrecisionTracker< DerivedT >::PostTrackCleanup ( ) const
inlineoverridevirtual

Function to be called before exiting the tracker loop.

Reimplemented from bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >.

◆ PrecisionSetup()

template<class DerivedT>
void bertini::tracking::FixedPrecisionTracker< DerivedT >::PrecisionSetup ( FixedPrecisionConfig const & )
inline

An additional no-op call, provided for conformity of interface with AMP tracker in generic code.

◆ Predict()

template<class DerivedT>
SuccessCode bertini::tracking::FixedPrecisionTracker< DerivedT >::Predict ( Vec< ComplexT > & predicted_space,
Vec< ComplexT > const & current_space,
ComplexT const & current_time,
ComplexT const & delta_t ) const
inline

Wrapper function for calling the correct predictor.

This function computes the next predicted space value, and sets some internals based on the prediction, such as the norm of the Jacobian.

The real type and complex type must be commensurate.

Parameters
[out]predicted_spaceThe result of the prediction
current_spaceThe current space point.
current_timeThe current time value.
delta_tThe time differential for this step. Allowed to be complex.

◆ PreIterationCheck()

template<class DerivedT>
SuccessCode bertini::tracking::FixedPrecisionTracker< DerivedT >::PreIterationCheck ( ) const
inlineoverridevirtual

Ensure that number of steps, stepsize, and precision still ok.

Returns
Success if ok to keep going, and a different code otherwise.

Implements bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >.

◆ Refine() [1/2]

SuccessCode bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::Refine ( Vec< C > & new_space,
Vec< C > const & start_point,
C const & current_time ) const
inlineinherited

Refine a point to tolerance implicitly internally set.

Runs Newton's method using the current settings for tracking, including the min and max number of iterations allowed, the tracking tolerance, precision, etc. YOU must ensure that the input point has the correct precision.

Returns
The SuccessCode indicating whether the refinement completed.
Parameters
[out]new_spaceThe result of refinement.
start_pointThe seed for Newton's method for refinement.
current_timeThe current time value for refinement.

◆ Refine() [2/2]

SuccessCode bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::Refine ( Vec< C > & new_space,
Vec< C > const & start_point,
C const & current_time,
NumErrorT const & tolerance,
unsigned max_iterations ) const
inlineinherited

Refine a point to a given tolerance.

Runs Newton's method using the current settings for tracking, including the min and max number of iterations allowed, precision, etc, EXCEPT for the tracking tolerance and max number of iterations, which you feed in here. YOU must ensure that the input point has the correct precision.

Returns
The SuccessCode indicating whether the refinement completed.
Parameters
[out]new_spaceThe result of refinement.
start_pointThe seed for Newton's method for refinement.
current_timeThe current time value for refinement.
toleranceThe tolerance to which to refine.
max_iterationsThe maximum number of iterations to use to refine.

◆ RefineImpl() [1/2]

template<class DerivedT>
SuccessCode bertini::tracking::FixedPrecisionTracker< DerivedT >::RefineImpl ( Vec< ComplexT > & new_space,
Vec< ComplexT > const & start_point,
ComplexT const & current_time ) const
inline

Run Newton's method from a start point with a current time.

Returns new space point by reference, as new_space. Operates at current precision. The tolerance is the tracking tolerance specified during Setup(...).

Parameters
[out]new_spaceThe result of running the refinement.
start_pointThe base point for running Newton's method.
current_timeThe current time value.
Returns
Code indicating whether was successful or not. Regardless, the value of new_space is overwritten with the correction result.

◆ RefineImpl() [2/2]

template<class DerivedT>
SuccessCode bertini::tracking::FixedPrecisionTracker< DerivedT >::RefineImpl ( Vec< ComplexT > & new_space,
Vec< ComplexT > const & start_point,
ComplexT const & current_time,
NumErrorT const & tolerance,
unsigned max_iterations ) const
inline

Run Newton's method from a start point with a current time.

Returns new space point by reference, as new_space. Operates at current precision.

Parameters
[out]new_spaceThe result of running the refinement.
start_pointThe base point for running Newton's method.
current_timeThe current time value.
toleranceThe tolerance for convergence. This is a tolerance on $\Delta x$, not on function residuals.
max_iterationsThe maximum number of permitted Newton iterations.
Returns
Code indicating whether was successful or not. Regardless, the value of new_space is overwritten with the correction result.

◆ RefreshConditionDirection()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::RefreshConditionDirection ( )
inlineinherited

(Re)draw the random probe direction used for condition-number estimation.

Call this once, from the algorithm, at the start of tracking a point – after any per-path RNG reseed and before TrackPath – so the direction is fixed for that whole point's track (pre-endgame tracking and the endgame both) and is reproducible across runs/ranks. Do NOT call it per TrackPath: the endgame issues many TrackPath calls per point, and refreshing the direction mid-track perturbs condition estimates and churns the RNG.

◆ ReinitializeInitialStepSize()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::ReinitializeInitialStepSize ( bool should_reinitialize_stepsize)
inlineinherited

Switch resetting of initial step size to that of the stepping settings.

By default, initial step size is retrieved from the stepping settings at the start of each path track. To turn this off, and re-use the previous step size from the previously tracked path, turn off by calling this function with false.

◆ RemoveObserver()

void bertini::Observable::RemoveObserver ( AnyObserver & observer) const
inlineinherited

Remove an observer from this observable.

Like AddObserver, this is safe to call during a notification: the removal is deferred until the current notification loop finishes.

◆ ResetCounters()

template<class DerivedT>
void bertini::tracking::FixedPrecisionTracker< DerivedT >::ResetCounters ( ) const
inlineoverridevirtual

Reset counters used during tracking.

Your custom tracker type should almost certainly call this function.

Implements bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >.

◆ ResetCountersBase()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::ResetCountersBase ( ) const
inlineprotectedinherited

Reset the base-class step counters (successes, failures, consecutive runs, total) to zero.

◆ ResetCumulativeStepCounts()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::ResetCumulativeStepCounts ( ) const
inlineinherited

Zero the cumulative step counts.

The per-call counters (NumTotalStepsTaken and friends) start over at every call to TrackPath. The cumulative counts start over only here, so a caller that issues many TrackPath calls for one logical path – an endgame issues hundreds for its sample circles – can read the total work of the whole path afterwards. The solver zeroes them at the start of each path and stamps them into that path's metadata.

◆ Set()

template<typename ... Ts>
template<typename T, typename = typename std::enable_if<IsTemplateParameter<T,Ts...>::value>::type>
void bertini::detail::Configured< Ts >::Set ( T const & t)
inlineinherited

Set the held configuration object of type T.

◆ SetInfiniteTruncation()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::SetInfiniteTruncation ( bool b)
inlineinherited

Turn the going-to-infinity path truncation check on or off.

◆ SetInfiniteTruncationTolerance()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::SetInfiniteTruncationTolerance ( NumErrorT const & tol)
inlineinherited

Set the threshold beyond which a path is judged to be going to infinity (and truncated).

Parameters
tolThe new (strictly positive) truncation threshold.

◆ SetMaxWallClockDuration()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::SetMaxWallClockDuration ( std::chrono::duration< Rep, Period > duration) const
inlineinherited

Give the tracker a wall-clock budget counted from now: SetMaxWallClockTime(now + duration).

Parameters
durationHow long from now to give up, e.g. std::chrono::seconds(30) or std::chrono::duration<double>(0.5).

◆ SetMaxWallClockTime()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::SetMaxWallClockTime ( std::chrono::steady_clock::time_point deadline) const
inlineinherited

Give the tracker a wall-clock deadline: a point in time after which any track in progress is abandoned between steps with SuccessCode::WallClockLimitReached.

The primitive is a point in time, not a length of time, because it has to hold across calls: an endgame issues hundreds of TrackPath calls for one path, and a per-call budget would start over with each. The deadline stays armed until cleared or replaced, so a caller limiting one path at a time sets it before the path and clears it after. "Time" here is the clock on the wall; the path variable t is unaffected.

Parameters
deadlineThe steady-clock time point to give up at.

◆ SetPredictor()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::SetPredictor ( Predictor new_predictor_choice)
inlineinherited

Change tracker to use a predictor.

Parameters
new_predictor_choiceThe new predictor to be used.
See also
Predictor

◆ SetStepSize()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::SetStepSize ( RealT const & new_stepsize) const
inlineinherited

Set how large the stepsize should be.

Parameters
new_stepsizeThe new value.

◆ SetSystem()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::SetSystem ( const System & new_sys)
inlineinherited

get a const reference to the system.

◆ SetTrackingTolerance()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::SetTrackingTolerance ( NumErrorT const & tracking_tolerance)
inlineinherited

Set how tightly to track the path.

Smaller values tracks the path more tightly, at the expense of higher computational time.

Parameters
tracking_toleranceThe new value. Newton iterations are performed until the step length is less than this number, or the max number of iterations has been reached, in which case the overall predict-correct step is viewed as a failure, and the step is undone. This number must be positive.

◆ Setup() [1/2]

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::Setup ( Predictor new_predictor_choice,
NumErrorT const & tracking_tolerance,
NumErrorT const & path_truncation_threshold,
SteppingConfig const & stepping,
NewtonConfig const & newton )
inlineinherited

Get the tracker set up for tracking, and set its truncation threshold too.

The four-argument form leaves the truncation threshold alone, which is what a caller that does not own it should do – it is the tracker's own setting (tracking::TruncationConfig), reachable by Set like any other, and the solver no longer hands one over (b2#457). This form is the convenience for a caller configuring a bare tracker from scratch.

Parameters
new_predictor_choiceThe predictor to use.
tracking_toleranceHow tightly Newton must correct onto the path.
path_truncation_thresholdThe size at which a path is abandoned as divergent.
steppingThe stepping settings.
newtonThe Newton corrector settings.

◆ Setup() [2/2]

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::Setup ( Predictor new_predictor_choice,
NumErrorT const & tracking_tolerance,
SteppingConfig const & stepping,
NewtonConfig const & newton )
inlineinherited

Get the tracker set up for tracking.

Pass the tracker the configuration for tracking, to get it set up.

◆ SyncSettings()

void bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::SyncSettings ( ) const
inlineinherited

Bring state derived from the settings in line with the settings.

The configs are the truth; anything computed from them is derived state, rebuilt when the two disagree rather than at the moment somebody writes a config. That ordering is the point: a setting written through the ordinary config surface never passes through a bespoke setter, so state cached at set-time goes stale silently, and the bespoke setters that avoided this are exactly why these settings were not configs in the first place (b2#457).

Called at the top of every path – late enough to catch a setting written by any route, and cheap enough not to matter, since each check is a comparison and the rebuild happens only on a real change. The predictor object is the one piece of derived state left; the digit count the AMP precision rule wants is simply computed where it is used.

◆ TrackerIteration()

template<class DerivedT>
SuccessCode bertini::tracking::FixedPrecisionTracker< DerivedT >::TrackerIteration ( ) const
inlineoverridevirtual

Run an iteration of the tracker loop.

Predict and correct, adjusting precision and stepsize as necessary.

Returns
Success if the step was successful, and a non-success code if something went wrong, such as a linear algebra failure or AMP Criterion violation.

Implements bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >.

◆ TrackingTolerance()

auto bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::TrackingTolerance ( ) const
inlineinherited

Get the currently set tracking tolerance.

◆ TrackPath()

SuccessCode bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::TrackPath ( Vec< ComplexT > & solution_at_endtime,
ComplexT const & start_time,
ComplexT const & endtime,
Vec< ComplexT > const & start_point ) const
inlineinherited

Track a start point through time, from a start time to a target time.

Parameters
[out]solution_at_endtimeThe value of the solution at the end time.
start_timeThe time at which to start tracking.
endtimeThe time to track to.
start_pointThe intial space values for tracking.
Returns
A success code indicating whether tracking was successful. Will be SuccessCode::Success if was successful, and something else otherwise.

The is the fundamental method for the tracker. First, you create and set up the tracker, telling it what system you will solve, and the settings to use. Then, you actually do the tracking.

◆ UpdateStepsize()

template<class DerivedT>
SuccessCode bertini::tracking::FixedPrecisionTracker< DerivedT >::UpdateStepsize ( ) const
inline

Commit the next stepsize, and adjust internals.

Member Data Documentation

◆ configuration_

template<typename ... Ts>
std::tuple<Ts...> bertini::detail::Configured< Ts >::configuration_
inherited

The held configuration objects, one per config type.

◆ corrector_

correct::NewtonCorrector bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::corrector_
mutableprotectedinherited

The Newton corrector used to refine predicted points.

◆ current_space_

TupOfVec bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::current_space_
mutableprotectedinherited

The current space value.

◆ current_stepsize_

RealT bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::current_stepsize_
mutableprotectedinherited

The current stepsize.

◆ current_time_

ComplexT bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::current_time_
mutableprotectedinherited

The current time.

◆ delta_t_

ComplexT bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::delta_t_
mutableprotectedinherited

The current delta_t.

◆ digits_final_

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::digits_final_
protectedinherited

The number of digits to track to, due to being in endgame zone.

◆ endtime_

ComplexT bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::endtime_
mutableprotectedinherited

The time we are tracking to.

◆ infinite_path_truncation_

bool bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::infinite_path_truncation_
protectedinherited

Whether should check if the path is going to infinity while tracking. On by default.

◆ last_step_

StepMetadata bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::last_step_
mutableprotectedinherited

Metadata from the most recent predict or correct step (norms, condition number, size proportion, error estimate, norm of the Newton step).

Filled by the predictor/corrector via their StepMetadata out-parameter.

◆ next_stepsize_

RealT bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::next_stepsize_
mutableprotectedinherited

The next stepsize.

◆ num_consecutive_failed_steps_

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::num_consecutive_failed_steps_
mutableprotectedinherited

The number of CONSECUTIVE failed steps taken in a row.

◆ num_consecutive_successful_steps_

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::num_consecutive_successful_steps_
mutableprotectedinherited

The number of CONSECUTIVE successful steps taken in a row.

◆ num_failed_steps_cumulative_

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::num_failed_steps_cumulative_
mutableprotectedinherited

Failed steps since ResetCumulativeStepCounts, across TrackPath calls.

◆ num_failed_steps_taken_

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::num_failed_steps_taken_
mutableprotectedinherited

The total number of failed steps taken.

◆ num_steps_since_last_condition_number_computation_

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::num_steps_since_last_condition_number_computation_
mutableprotectedinherited

How many steps have passed since the most recent condition number estimate.

◆ num_successful_steps_cumulative_

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::num_successful_steps_cumulative_
mutableprotectedinherited

Successful steps since ResetCumulativeStepCounts, across TrackPath calls.

◆ num_successful_steps_since_stepsize_increase_

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::num_successful_steps_since_stepsize_increase_
mutableprotectedinherited

How many successful steps have been taken since increased stepsize.

◆ num_successful_steps_taken_

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::num_successful_steps_taken_
mutableprotectedinherited

The number of successful steps taken so far.

◆ predictor_

predict::ExplicitRKPredictor bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::predictor_
mutableprotectedinherited

The predictor to use while tracking.

◆ predictor_order_

unsigned bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::predictor_order_
mutableprotectedinherited

The order of the predictor – one less than the error estimate order. Derived from the setting by SyncPredictor, not written when the setting is.

◆ reinitialize_stepsize_

bool bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::reinitialize_stepsize_
protectedinherited

Whether should re-initialize the stepsize with each call to Trackpath. On by default.

◆ step_success_code_

SuccessCode bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::step_success_code_
mutableprotectedinherited

The code for step success.

◆ temporary_space_

TupOfVec bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::temporary_space_
mutableprotectedinherited

After prediction, the tentative next space value.

◆ tentative_space_

TupOfVec bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::tentative_space_
mutableprotectedinherited

After correction, the tentative next space value.

◆ tracked_system_

std::reference_wrapper<const System> bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::tracked_system_
protectedinherited

Reference to the system being tracked.

◆ wall_clock_deadline_

std::optional<std::chrono::steady_clock::time_point> bertini::tracking::Tracker< FixedPrecisionTracker< DerivedT > >::wall_clock_deadline_
mutableprotectedinherited

Give up between steps once this passes; none by default.