|
Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
|
Collects an endgame's approach to the root as a time-indexed sequence, for callers that need to watch a quantity BEHAVE as the point improves rather than judge it at a single point. More...
#include <observers.hpp>
Public Types | |
| using | EmitterT = EndgameT |
| The endgame type emitting the observed events. | |
| using | BCT = typename EndgameT::BaseComplexT |
| The boundary complex type of the observed endgame. | |
Public Member Functions | |
| void | Clear () |
| Forget everything collected so far, so one collector can be reused across paths. | |
| size_t | NumRuns () const |
| size_t | NumSamples () const |
| virtual ObserveResult | Observe (AnyEvent const &e) override |
| Observe the observable object being observed. | |
| std::type_index | ObservedKind () const override |
| The type this observer expects to observe. | |
| virtual std::vector< std::type_index > | SubscribedEventTypes () const |
| Declares which event types this observer wants to receive. | |
| virtual std::vector< std::type_index > | SubscribedEventTypes () const |
| Declares which event types this observer wants to receive. | |
Public Attributes | |
| std::vector< Vec< BCT > > | path_samples |
| Points on the path, from ComputedSamplePoint – the sequence. | |
| std::vector< BCT > | path_times |
| The time at which each path sample was computed. | |
| std::vector< Vec< BCT > > | circle_samples |
| Circle-track points, from CircleAdvanced (Cauchy only). | |
| std::vector< BCT > | circle_times |
| The time of each circle sample. | |
| std::vector< Vec< BCT > > | approximations |
| Root approximations, from ApproximatedRoot. | |
| std::vector< BCT > | approximation_times |
| The endgame's latest time at each approximation. | |
| std::vector< NumErrorT > | approximation_errors |
| The endgame's reported error at each approximation. | |
| std::vector< unsigned > | cycle_numbers |
| The endgame's cycle number at each approximation. | |
| std::vector< BCT > | advance_times |
| Times at which TimeAdvanced fired (that event carries no payload). | |
| std::vector< size_t > | run_path_starts |
| Index into path_samples where each run's samples begin. | |
| std::vector< size_t > | run_circle_starts |
| Index into circle_samples where each run's circle points begin. | |
| std::vector< size_t > | run_approx_starts |
| Index into approximations where each run's approximations begin. | |
| size_t | num_precision_increases = 0 |
| How many times the endgame raised its working precision (PrecisionChanged), over every run observed. When that happens before the first approximation the sample window is recomputed at the new precision and the superseded samples are dropped from the sequence (SamplesRecomputedAtHigherPrecision). | |
Collects an endgame's approach to the root as a time-indexed sequence, for callers that need to watch a quantity BEHAVE as the point improves rather than judge it at a single point.
A single spectrum cannot separate a genuinely tiny singular value from a perturbation artifact – the two are numerically identical at one point. What separates them is the trend: a truly-zero value is bounded by the point's own error, so it tracks the distance to the root down, while a genuinely nonzero one plateaus. Reading that trend needs the approach itself, not just its final answer, which is what this collects.
THREE BUCKETS, kept apart because they are different evidence:
advance_times records TimeAdvanced, which carries no payload of its own – it marks that the approach axis moved, and is emitted by the Cauchy endgame only.
Attach one of these per path. It is an ordinary C++ observer, so the observable filters by event type before any virtual call, and a run that emits thousands of events pays only for the handful this asks for.
| using bertini::endgame::SampleSequenceCollector< EndgameT >::BCT = typename EndgameT::BaseComplexT |
The boundary complex type of the observed endgame.
| using bertini::endgame::SampleSequenceCollector< EndgameT >::EmitterT = EndgameT |
The endgame type emitting the observed events.
|
inline |
Forget everything collected so far, so one collector can be reused across paths.
|
inline |
|
inline |
|
inlineoverridevirtual |
Observe the observable object being observed.
This is probably in response to NotifyObservers.
This virtual function must be overridden by actual observers, defining how they observe the observable they are observing, probably filtering events and doing something specific for different ones.
| e | The event which was emitted by the observed object. |
Implements bertini::AnyObserver.
|
inlineoverridevirtualinherited |
The type this observer expects to observe.
Used by Observable::AddObserver to reject attaching an observer to an incompatible observable (which would otherwise silently never fire). The default is typeid(void), a wildcard meaning "attach me anywhere"; Observer<ObservedT> reports typeid(ObservedT).
Reimplemented from bertini::AnyObserver.
|
inlinevirtualinherited |
Declares which event types this observer wants to receive.
Return a non-empty vector to opt into type-indexed dispatch: the observable will only call Observe() for events whose dynamic type exactly matches one of the returned type_index values. Return an empty vector (the default) to receive every event — this is the correct choice for observers that handle many or all event types, and is the automatic behavior for Python-defined observers.
Reimplemented in bertini::TypedObserver< Derived, ObservedT, ConcreteEvents >, bertini::TypedObserver< AMPPathAccumulator< TrackerT, SuccessfulStep >, TrackerT, SuccessfulStep< TrackerTraits< TrackerT >::EventEmitterType > >, bertini::TypedObserver< FirstPrecisionRecorder< TrackerT >, TrackerT, Initializing< TrackerTraits< TrackerT >::EventEmitterType, TrackerTraits< TrackerT >::BaseComplexT >, TrackingStarted< TrackerTraits< TrackerT >::EventEmitterType >, PrecisionChanged< TrackerTraits< TrackerT >::EventEmitterType > >, bertini::TypedObserver< MinMaxPrecisionRecorder< TrackerT >, TrackerT, Initializing< TrackerTraits< TrackerT >::EventEmitterType, TrackerTraits< TrackerT >::BaseComplexT >, TrackingStarted< TrackerTraits< TrackerT >::EventEmitterType >, PrecisionChanged< TrackerTraits< TrackerT >::EventEmitterType > >, bertini::TypedObserver< PathPrecisionRecorder< TrackerT >, TrackerT, TrackingStarted< TrackerTraits< TrackerT >::EventEmitterType >, PrecisionChanged< TrackerTraits< TrackerT >::EventEmitterType > >, bertini::TypedObserver< PathPrecisionRecorder< TrackerType >, TrackerType, TrackingStarted< TrackerTraits< TrackerType >::EventEmitterType >, PrecisionChanged< TrackerTraits< TrackerType >::EventEmitterType > >, and bertini::TypedObserver< StepFailScreenPrinter< TrackerT >, TrackerT, FailedStep< TrackerTraits< TrackerT >::EventEmitterType > >.
|
inlinevirtualinherited |
Declares which event types this observer wants to receive.
Return a non-empty vector to opt into type-indexed dispatch: the observable will only call Observe() for events whose dynamic type exactly matches one of the returned type_index values. Return an empty vector (the default) to receive every event — this is the correct choice for observers that handle many or all event types, and is the automatic behavior for Python-defined observers.
| std::vector<BCT> bertini::endgame::SampleSequenceCollector< EndgameT >::advance_times |
Times at which TimeAdvanced fired (that event carries no payload).
| std::vector<NumErrorT> bertini::endgame::SampleSequenceCollector< EndgameT >::approximation_errors |
The endgame's reported error at each approximation.
| std::vector<BCT> bertini::endgame::SampleSequenceCollector< EndgameT >::approximation_times |
The endgame's latest time at each approximation.
| std::vector<Vec<BCT> > bertini::endgame::SampleSequenceCollector< EndgameT >::approximations |
Root approximations, from ApproximatedRoot.
| std::vector<Vec<BCT> > bertini::endgame::SampleSequenceCollector< EndgameT >::circle_samples |
Circle-track points, from CircleAdvanced (Cauchy only).
| std::vector<BCT> bertini::endgame::SampleSequenceCollector< EndgameT >::circle_times |
The time of each circle sample.
| std::vector<unsigned> bertini::endgame::SampleSequenceCollector< EndgameT >::cycle_numbers |
The endgame's cycle number at each approximation.
| size_t bertini::endgame::SampleSequenceCollector< EndgameT >::num_precision_increases = 0 |
How many times the endgame raised its working precision (PrecisionChanged), over every run observed. When that happens before the first approximation the sample window is recomputed at the new precision and the superseded samples are dropped from the sequence (SamplesRecomputedAtHigherPrecision).
| std::vector<Vec<BCT> > bertini::endgame::SampleSequenceCollector< EndgameT >::path_samples |
Points on the path, from ComputedSamplePoint – the sequence.
| std::vector<BCT> bertini::endgame::SampleSequenceCollector< EndgameT >::path_times |
The time at which each path sample was computed.
| std::vector<size_t> bertini::endgame::SampleSequenceCollector< EndgameT >::run_approx_starts |
Index into approximations where each run's approximations begin.
| std::vector<size_t> bertini::endgame::SampleSequenceCollector< EndgameT >::run_circle_starts |
Index into circle_samples where each run's circle points begin.
| std::vector<size_t> bertini::endgame::SampleSequenceCollector< EndgameT >::run_path_starts |
Index into path_samples where each run's samples begin.