Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
bertini::endgame::FixedPrecEndgame< TrackerT > Class Template Reference

Fixed-precision endgame precision policy (refines and ensures precision at a single working precision). More...

#include <fixed_prec_endgame.hpp>

Inheritance diagram for bertini::endgame::FixedPrecEndgame< TrackerT >:
[legend]
Collaboration diagram for bertini::endgame::FixedPrecEndgame< TrackerT >:
[legend]

Public Types

using TrackerType = TrackerT
 The path-tracker type.
using BaseComplexT = typename tracking::TrackerTraits<TrackerType>::BaseComplexT
 The complex number type.
using BaseRealT = typename tracking::TrackerTraits<TrackerType>::BaseRealT
 The real number type.
using BCT = BaseComplexT
 The complex number type.
using BRT = BaseRealT
 The real number type.

Public Member Functions

SuccessCode RefineSampleImpl (Vec< BCT > &result, Vec< BCT > const &current_sample, BCT const &current_time, NumErrorT tol, unsigned max_iterations) const
 Refine a single sample point at the (fixed) working precision.
 FixedPrecEndgame (TrackerT const &new_tracker)
 Construct the fixed-precision endgame policy for a tracker.
virtual ~FixedPrecEndgame ()=default
void SetTracker (TrackerT const &new_tracker)
 Tell the endgame to use the given tracker.
const TrackerT & GetTracker () const
 Getter for the tracker used inside an instance of the endgame.
const System & GetSystem () const
 Get the system being tracked on, which is referred to by the tracker.
void ChangePrecision (unsigned p)
 Change the working precision of the underlying tracker.
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.

Static Public Member Functions

template<typename... T>
static unsigned EnsureAtUniformPrecision (T &...args)
 Bring a set of values to a common precision (a no-op of effect under fixed precision).
template<typename T>
static void EnsureAtPrecision (T const &obj, unsigned prec)
 Assert that an object is already at the given precision (throws otherwise).

Protected Member Functions

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).

Detailed Description

template<typename TrackerT>
class bertini::endgame::FixedPrecEndgame< TrackerT >

Fixed-precision endgame precision policy (refines and ensures precision at a single working precision).

Member Typedef Documentation

◆ BaseComplexT

template<typename TrackerT>
using bertini::endgame::FixedPrecEndgame< TrackerT >::BaseComplexT = typename tracking::TrackerTraits<TrackerType>::BaseComplexT

The complex number type.

◆ BaseRealT

template<typename TrackerT>
using bertini::endgame::FixedPrecEndgame< TrackerT >::BaseRealT = typename tracking::TrackerTraits<TrackerType>::BaseRealT

The real number type.

◆ BCT

template<typename TrackerT>
using bertini::endgame::FixedPrecEndgame< TrackerT >::BCT = BaseComplexT

The complex number type.

◆ BRT

template<typename TrackerT>
using bertini::endgame::FixedPrecEndgame< TrackerT >::BRT = BaseRealT

The real number type.

◆ TrackerType

template<typename TrackerT>
using bertini::endgame::FixedPrecEndgame< TrackerT >::TrackerType = TrackerT

The path-tracker type.

Constructor & Destructor Documentation

◆ FixedPrecEndgame()

template<typename TrackerT>
bertini::endgame::FixedPrecEndgame< TrackerT >::FixedPrecEndgame ( TrackerT const & new_tracker)
inlineexplicit

Construct the fixed-precision endgame policy for a tracker.

◆ ~FixedPrecEndgame()

template<typename TrackerT>
virtual bertini::endgame::FixedPrecEndgame< TrackerT >::~FixedPrecEndgame ( )
virtualdefault

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).

◆ ChangePrecision()

template<typename TrackerT>
void bertini::endgame::EndgamePrecPolicyBase< TrackerT >::ChangePrecision ( unsigned p)
inlineinherited

Change the working precision of the underlying tracker.

◆ EnsureAtPrecision()

template<typename TrackerT>
template<typename T>
void bertini::endgame::FixedPrecEndgame< TrackerT >::EnsureAtPrecision ( T const & obj,
unsigned prec )
inlinestatic

Assert that an object is already at the given precision (throws otherwise).

◆ EnsureAtUniformPrecision()

template<typename TrackerT>
template<typename... T>
unsigned bertini::endgame::FixedPrecEndgame< TrackerT >::EnsureAtUniformPrecision ( T &... args)
inlinestatic

Bring a set of values to a common precision (a no-op of effect under fixed precision).

◆ GetSystem()

template<typename TrackerT>
const System & bertini::endgame::EndgamePrecPolicyBase< TrackerT >::GetSystem ( ) const
inlineinherited

Get the system being tracked on, which is referred to by the tracker.

◆ GetTracker()

template<typename TrackerT>
const TrackerT & bertini::endgame::EndgamePrecPolicyBase< TrackerT >::GetTracker ( ) const
inlineinherited

Getter for the tracker used inside an instance of the endgame.

◆ 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.

◆ 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.

◆ 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 >.

◆ RefineSampleImpl()

template<typename TrackerT>
SuccessCode bertini::endgame::FixedPrecEndgame< TrackerT >::RefineSampleImpl ( Vec< BCT > & result,
Vec< BCT > const & current_sample,
BCT const & current_time,
NumErrorT tol,
unsigned max_iterations ) const
inline

Refine a single sample point at the (fixed) working precision.

◆ 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.

◆ SetTracker()

template<typename TrackerT>
void bertini::endgame::EndgamePrecPolicyBase< TrackerT >::SetTracker ( TrackerT const & new_tracker)
inlineinherited

Tell the endgame to use the given tracker.

Takes a reference.

Note
Ensure the tracker you are using doesn not go out of scope!