|
Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
|
Class used to finish tracking paths during Homotopy Continuation. More...
#include <cauchy.hpp>
Public Types | |
| using | BaseEGT = EndgameBase<CauchyEndgame<PrecT>, PrecT> |
| The base endgame type. | |
| using | FinalEGT = CauchyEndgame<PrecT> |
| The final (derived) endgame type. | |
| using | TrackerType = typename PrecT::TrackerType |
| 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 | EmitterType = CauchyEndgame<PrecT> |
| The event-emitter type. | |
| using | Config |
| The configuration bundle this endgame reads, public so that generic machinery which works in terms of an object's configs – the Python bindings' ConfiguredVisitor, which needs Config::UsedConfigs – can serve an endgame the same way it serves a tracker or a solver. | |
| using | UsedConfigs = TypeList<Ts...> |
| The list of configuration types this object holds. | |
Public Member Functions | |
| template<typename ComplexT> | |
| void | ClearTimesAndSamples () |
| Function that clears all samples and times from data members for the Cauchy endgame. | |
| template<typename ComplexT> | |
| void | SetPSEGTimes (TimeCont< ComplexT > pseg_times_to_set) |
| Setter for the time values for the power series approximation of the Cauchy endgame. | |
| template<typename ComplexT> | |
| TimeCont< ComplexT > & | GetPSEGTimes () |
| Getter for the time values for the power series approximation of the Cauchy endgame. | |
| template<typename ComplexT> | |
| const TimeCont< ComplexT > & | GetPSEGTimes () const |
| Const overload returning the power-series time values. | |
| template<typename ComplexT> | |
| void | SetPSEGSamples (SampCont< ComplexT > const &pseg_samples_to_set) |
| Setter for the space values for the power series approximation of the Cauchy endgame. | |
| template<typename ComplexT> | |
| SampCont< ComplexT > & | GetPSEGSamples () |
| Getter for the space values for the power series approximation of the Cauchy endgame. | |
| template<typename ComplexT> | |
| const SampCont< ComplexT > & | GetPSEGSamples () const |
| Const overload returning the power-series sample values. | |
| template<typename ComplexT> | |
| void | SetCauchySamples (SampCont< ComplexT > const &cauchy_samples_to_set) |
| Setter for the space values for the Cauchy endgame. | |
| template<typename ComplexT> | |
| SampCont< ComplexT > & | GetCauchySamples () |
| Getter for the space values for the Cauchy endgame. | |
| template<typename ComplexT> | |
| const SampCont< ComplexT > & | GetCauchySamples () const |
| Const overload returning the Cauchy sample values. | |
| template<typename ComplexT> | |
| void | SetCauchyTimes (TimeCont< ComplexT > const &cauchy_times_to_set) |
| Setter for the time values for the Cauchy endgame. | |
| template<typename ComplexT> | |
| TimeCont< ComplexT > & | GetCauchyTimes () |
| Getter for the time values for the Cauchy endgame. | |
| template<typename ComplexT> | |
| const TimeCont< ComplexT > & | GetCauchyTimes () const |
| Const overload returning the Cauchy time values. | |
| const BCT & | LatestTimeImpl () const |
| void | SetCauchySettings (CauchyConfig const &new_cauchy_settings) |
| Setter for the specific settings in tracking_conifg.hpp under Cauchy. | |
| const auto & | GetCauchySettings () const |
| Getter for the specific settings in tracking_conifg.hpp under Cauchy. | |
| CauchyEndgame (TrackerType const &tr, const ConfigsAsTuple &settings) | |
| Construct the Cauchy endgame for a tracker, with its configuration as a tuple. | |
| template<typename... Ts> | |
| CauchyEndgame (TrackerType const &tr, const Ts &... ts) | |
| Construct the Cauchy endgame for a tracker, with configs given in any order. | |
| virtual | ~CauchyEndgame ()=default |
| void | ValidateConfigs () |
| Validate the endgame configuration (e.g. require >= 3 sample points for circle tracking). | |
| template<typename ComplexT> | |
| SuccessCode | CircleTrack (ComplexT const &target_time) |
| Function to track around the origin. | |
| template<typename ComplexT> | |
| void | AddToCauchyData (ComplexT const &time, Vec< ComplexT > const &sample) |
| Append a (time, sample) pair to the Cauchy data containers. | |
| template<typename ComplexT> | |
| void | AddToPSData (ComplexT const &time, Vec< ComplexT > const &sample) |
| Append a (time, sample) pair to the power-series data containers. | |
| template<typename ComplexT> | |
| bool | CheckClosedLoop () |
| Function that determines if we have closed a loop after calling CircleTrack(). | |
| template<typename ComplexT> | |
| bool | RatioEGOperatingZoneTest (ComplexT const &target_time) const |
| After we have used CircleTrack and have successfully closed the loop using CheckClosedLoop we need to check the maximum and minimum norms of the samples collected. | |
| template<typename ComplexT> | |
| SuccessCode | InitialCauchyLoops (ComplexT const &target_time) |
| template<typename ComplexT> | |
| void | RotateOntoPS (ComplexT const &next_time, Vec< ComplexT > const &next_sample) |
| Shift the power-series sample window forward by one (time, sample) pair. | |
| template<typename ComplexT> | |
| void | ClearAndSeedCauchyData () |
| Clear the Cauchy data and re-seed it from the current power-series samples. | |
| template<typename ComplexT> | |
| SuccessCode | InitialApproximation (ComplexT const &start_time, Vec< ComplexT > const &start_point, ComplexT const &target_time, Vec< ComplexT > &approximation) |
| template<typename ComplexT> | |
| SuccessCode | GetIntoEGZone (ComplexT const &start_time, Vec< ComplexT > const &start_point, ComplexT const &target_time) |
| Track from the boundary inward until the path enters the endgame (Cauchy) operating zone. | |
| template<typename ComplexT> | |
| SuccessCode | ComputeCauchyApproximationOfXAtT0 (Vec< ComplexT > &result) |
| Function that computes the mean of the samples that were collected while tracking around the origin. | |
| template<typename ComplexT> | |
| NumErrorT | MinDehomNormOverLoopSamples () const |
| The FLOOR of the current Cauchy loop: the smallest dehomogenized infinity-norm over the loop samples. | |
| template<typename ComplexT> | |
| SuccessCode | ComputeCauchySamples (ComplexT const &target_time) |
| Collects samples while tracking around the target time, until we close the loop, or exceed the limit on # of loops. | |
| template<typename ComplexT> | |
| SuccessCode | AdvanceTime (ComplexT const &target_time) |
| Advances time, marching toward the target time. | |
| template<typename ComplexT> | |
| NumErrorT | PoleComponentMass () const |
| The pole-component mass of the current Cauchy loop: the endgame operating-zone measurement. | |
| template<typename Dummy = void> | |
| NumErrorT | PoleComponentMassAMP () const |
| PoleComponentMass read from whichever numeric lane the adaptive (double-first) endgame is currently computing in. | |
| bool | PoleMassSignificant (NumErrorT mass, NumErrorT approx_scale) const |
| Is a pole-component mass SIGNIFICANT, i.e. | |
| template<typename ComplexT> | |
| SuccessCode | RunImpl (ComplexT const &start_time, Vec< ComplexT > const &start_point, ComplexT const &target_time) |
| Primary function that runs the Cauchy endgame. | |
| template<typename Dummy = void> | |
| SuccessCode | RunImplAMP (BCT const &start_time, Vec< BCT > const &start_point, BCT const &target_time) |
| Run the Cauchy endgame via the double-first adaptive-numeric-type driver, migrating up to mpfr only on tracker escalation. | |
| template<typename ComplexT> | |
| SuccessCode | RunInitSegmentT (ComplexT const &start_time, Vec< ComplexT > const &start_point, ComplexT const &target_time) |
| Run the initialization segment (seed the PSEG window and reach the EG zone) in a given numeric type. | |
| template<typename Dummy = void> | |
| SuccessCode | ComputeCauchyApproxAMP () |
| Compute the Cauchy mean (extrapolation) at the active numeric type, migrating-and-retrying in mpfr on escalation. | |
| template<typename Dummy = void> | |
| SuccessCode | AdvanceTimeAMP (BCT const &target_time) |
| Advance time at the active numeric type, migrating-and-retrying in mpfr on escalation. | |
| template<typename Dummy = void> | |
| SuccessCode | ComputeCauchySamplesAMP (BCT const &target_time) |
| Build a closed Cauchy loop's samples at the active numeric type, migrating-and-retrying in mpfr on escalation. | |
| template<typename Dummy = void> | |
| void | MigrateContainersToPrecision (unsigned newprec) |
| Widen this flavor's Cauchy containers from the complex_dbl slot up to complex_mp at the new precision. | |
| auto | ComputeCOverK (SampCont< ComplexT > const &samples) const -> typename Eigen::NumTraits< ComplexT >::Real |
| An estimate of c/k from the three most recent geometric samples. | |
| bool | CheckForCOverKStabilization (std::deque< T > const &c_over_k_array) const |
| Have the last few c/k estimates settled to within the user's threshold? | |
| void | SetBoundaryTime (BCT const &t) |
| Set the endgame boundary (start) time. | |
| void | SetTargetTime (BCT const &t) |
| Set the final target time. | |
| BCT const & | BoundaryTime () const |
| BCT const & | TargetTime () const |
| SuccessCode | Run (Vec< BCT > const &start_point) |
| Run the endgame from the stored boundary time to the stored target time. | |
| void | EmitComputedSample (Vec< ComplexT > const &sample, ComplexT const &time) |
| Announce a completed sample point on the path, as a ComputedSamplePoint. | |
| SuccessCode | RefineAllSamples (SampCont< ComplexT > &samples, TimeCont< ComplexT > ×) |
| Refine every sample point to the endgame's refinement tolerance. | |
| SuccessCode | RefineSample (Vec< ComplexT > &result, Vec< ComplexT > const ¤t_sample, ComplexT const ¤t_time, NumErrorT tol, unsigned max_iterations) const |
| A function passed off to the precision-specific endgame part. | |
| SuccessCode | EndgameTrackPath (Vec< ComplexT > &result, ComplexT const &start_time, ComplexT const &end_time, Vec< ComplexT > const &start_point) const |
| Track through the tracker, adapting at the numeric-type boundary. | |
| SuccessCode | EscalateAndMigrate (unsigned guard) |
| Raise the endgame to the next precision and migrate the containers' complex_dbl slot up to complex_mp when the tracker's authority escalates. | |
| const auto & | EndgameSettings () const |
| This function is inferior to the templated Get<ConfigT> function provided. | |
| const auto & | SecuritySettings () const |
| bool | BeyondSecurityMaxNorm (RealT const &norm) const |
| unsigned | CycleNumber () const |
| void | CycleNumber (unsigned c) |
| Set the cycle number. | |
| void | IncrementCycleNumber (unsigned inc) |
| Increase the cycle number by the given increment. | |
| const auto & | FinalTolerance () const |
| Get the final tolerance to which we are tracking the solution. | |
| void | SetFinalTolerance (NumErrorT const &ft) |
| Setter for the final tolerance. | |
| const Vec< ComplexT > & | FinalApproximation () const |
| Get the most-recent approximation. | |
| const Vec< ComplexT > & | PreviousApproximation () const |
| Get the second-most-recent approximation. | |
| NumErrorT | ApproximateError () const |
| Get the most recent accuracy estimate. | |
| const BCT & | LatestTime () const |
| Get the latest time at which a point on the path was computed. | |
| SuccessCode | ComputeInitialSamples (const ComplexT &start_time, const ComplexT &target_time, const Vec< ComplexT > &x_endgame_start, TimeCont< ComplexT > ×, SampCont< ComplexT > &samples) |
| Get the system being tracked on, which is referred to by the tracker. | |
| template<typename T, typename = typename std::enable_if<IsTemplateParameter<T,Ts...>::value>::type> | |
| const T & | Get () const |
| Get the held configuration object of type T. | |
| 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. | |
| 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. | |
Public Attributes | |
| std::tuple< Ts... > | configuration_ |
| The held configuration objects, one per config type. | |
Protected Types | |
| using | TupleOfTimes = typename BaseEGT::TupleOfTimes |
| A tuple of time containers, one per precision. | |
| using | TupleOfSamps = typename BaseEGT::TupleOfSamps |
| A tuple of sample containers, one per precision. | |
| using | TupOfVec = typename BaseEGT::TupOfVec |
| A tuple of vector containers, one per precision. | |
| using | BCT = BaseComplexT |
| The complex number type. | |
| using | BRT = BaseRealT |
| The real number type. | |
| using | Configs = typename AlgoTraits<FinalEGT>::NeededConfigs |
| The configuration bundle (Configured base). | |
| using | ConfigsAsTuple = typename Configs::ToTuple |
| The configuration structs as a tuple. | |
| using | Configured |
| The Configured base type. | |
| using | NeededTypes |
| Arithmetic types this endgame may compute in (sourced from the tracker). | |
| using | TupOfReal |
| A tuple of real values, one per numeric type. | |
Protected Member Functions | |
| void | RefreshCOverKProbe (unsigned size) const |
| Draw the c/k probe direction for a run. | |
| Vec< ComplexT > const & | GetCOverKProbe (unsigned size, unsigned prec) const |
| The fixed random direction the c/k estimate is projected along. | |
| const CauchyEndgame< PrecT > & | AsFlavor () const |
| convert the base endgame into the derived type. | |
| CauchyEndgame< PrecT > & | AsFlavor () |
| Non-const version of AsFlavor. | |
| 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 | |
| TupleOfTimes | pseg_times_ |
| A deque of times that are specifically used to compute the power series approximation for the Cauchy endgame. | |
| TupleOfSamps | pseg_samples_ |
| A deque of samples that are in correspondence with the pseg_times_. | |
| TupleOfTimes | cauchy_times_ |
| A deque of times that are collected by CircleTrack. | |
| TupleOfSamps | cauchy_samples_ |
| A deque of samples collected by CircleTrack. | |
| BCT | latest_time_cache_ |
| Scratch so LatestTimeImpl can return a BCT reference while in the double fast lane. | |
| Vec< BCT > | final_approximation_ |
| The latest computed approximation of the endpoint. | |
| Vec< BCT > | previous_approximation_ |
| The previous approximation of the endpoint. | |
| unsigned int | cycle_number_ |
| The current estimate of the cycle number. | |
| NumErrorT | approximate_error_ |
| The error estimate between successive approximations. | |
| BCT | start_time_ |
| The endgame boundary time; set via SetBoundaryTime(). | |
| BCT | target_time_ |
| The final target time (default 0); set via SetTargetTime(). | |
| Vec< complex_dbl > | c_over_k_probe_as_drawn_ |
| The random direction the c/k estimate is projected along, as drawn: in double precision, so that it is exact in every lane and at every multiple precision. | |
| TupOfVec | c_over_k_probe_ |
| The c/k probe in each numeric type the endgame computes in: exact conversions of c_over_k_probe_as_drawn_, re-derived when their size or precision is wrong, never rounded. | |
Class used to finish tracking paths during Homotopy Continuation.
The bertini::CauchyEngame class enables us to finish tracking on possibly singular paths on an arbitrary square homotopy. The intended usage is to:
Below we demonstrate a basic usage of the CauchyEndgame class to find the singularity at $t = 0$. The pattern is as described above: create an instance of the class, feeding it the system to be used, and the endgame boundary time and other variable values at the endgame boundary.
If this documentation is insufficient, please contact the authors with suggestions, or get involved! Pull requests welcomed.
Test suite driving this class: endgames_test. File: test/endgames/generic_cauchy_test.hpp File: test/endgames/amp_cauchy_test.cpp File: test/endgames/fixed_double_cauchy_test.cpp FIle: test/endgames/fixed_multiple_cauchy_test.cpp
| using bertini::endgame::CauchyEndgame< PrecT >::BaseComplexT = typename tracking::TrackerTraits<TrackerType>::BaseComplexT |
The complex number type.
| using bertini::endgame::CauchyEndgame< PrecT >::BaseEGT = EndgameBase<CauchyEndgame<PrecT>, PrecT> |
The base endgame type.
| using bertini::endgame::CauchyEndgame< PrecT >::BaseRealT = typename tracking::TrackerTraits<TrackerType>::BaseRealT |
The real number type.
|
protected |
The complex number type.
|
protected |
The real number type.
|
inherited |
The configuration bundle this endgame reads, public so that generic machinery which works in terms of an object's configs – the Python bindings' ConfiguredVisitor, which needs Config::UsedConfigs – can serve an endgame the same way it serves a tracker or a solver.
The same type as the protected Configured alias below.
|
protected |
The configuration bundle (Configured base).
|
protected |
The configuration structs as a tuple.
|
protectedinherited |
The Configured base type.
| using bertini::endgame::CauchyEndgame< PrecT >::EmitterType = CauchyEndgame<PrecT> |
The event-emitter type.
| using bertini::endgame::CauchyEndgame< PrecT >::FinalEGT = CauchyEndgame<PrecT> |
The final (derived) endgame type.
|
protectedinherited |
Arithmetic types this endgame may compute in (sourced from the tracker).
| using bertini::endgame::CauchyEndgame< PrecT >::TrackerType = typename PrecT::TrackerType |
The path-tracker type.
|
protected |
A tuple of sample containers, one per precision.
|
protected |
A tuple of time containers, one per precision.
|
protectedinherited |
A tuple of real values, one per numeric type.
|
protected |
A tuple of vector containers, one per precision.
|
inherited |
The list of configuration types this object holds.
|
inlineexplicit |
Construct the Cauchy endgame for a tracker, with its configuration as a tuple.
|
inline |
Construct the Cauchy endgame for a tracker, with configs given in any order.
|
virtualdefault |
|
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.
| IncompatibleObserver | if the observer's ObservedKind() is not one this observable can be observed as. |
|
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.)
| IncompatibleObserver | if incompatible (see the reference overload). |
|
inline |
Append a (time, sample) pair to the Cauchy data containers.
|
inline |
Append a (time, sample) pair to the power-series data containers.
|
inline |
Advances time, marching toward the target time.
Works from the most recent time-sample pair stored in the power series data.
If the distance between next and target is too small, dies (returns not success).
|
inline |
Advance time at the active numeric type, migrating-and-retrying in mpfr on escalation.
|
inlineinherited |
Get the most recent accuracy estimate.
|
inlineprotectedinherited |
Non-const version of AsFlavor.
|
inlineprotectedinherited |
convert the base endgame into the derived type.
This enables the CRPT as used by the endgames
|
inlineinherited |
|
inlineinherited |
|
inline |
Function that determines if we have closed a loop after calling CircleTrack().
None: all data needed are class data members
true: if we have closed the loop false: if we have not closed the loop
| ComplexT | The complex number type |
|
inlineinherited |
Have the last few c/k estimates settled to within the user's threshold?
The operating-zone test: consecutive estimates agreeing to within minimum_for_c_over_k_stabilization, for num_needed_for_stabilization of them, is taken as the cycle-number estimate having settled. Both endgames use this and mean the same thing by it (b2#402).
| T | The element type of the estimate window; real or complex, since only its magnitude is read (the Cauchy endgame keeps reals, the power series endgame keeps its numeric type). |
| c_over_k_array | The estimates so far, oldest first. |
|
inline |
Function to track around the origin.
starting_time: time value that we start from to track around the origin target_time: the time value that we are centering out loops around, default is t = 0 starting_sample: an approximate solution of the homotopy at t = starting_time
SuccessCode: This reports back if we were successful in advancing time.
| ComplexT | The complex number type. Depeding on the number of samples points, we make a polgon around the origin with that many vertices. This function should be called the same number of times as paths converging to the solution we are approximating. |
|
inline |
Clear the Cauchy data and re-seed it from the current power-series samples.
|
inline |
Function that clears all samples and times from data members for the Cauchy endgame.
|
inline |
Compute the Cauchy mean (extrapolation) at the active numeric type, migrating-and-retrying in mpfr on escalation.
|
inline |
Function that computes the mean of the samples that were collected while tracking around the origin.
This value is the approximation of the value at the origin.
result: This vector, passed by reference, holds the approximation that we calculate.
SuccessCode deeming if we were suceessful, or if we encountered an error.
| ComplexT | The complex number type. We can compute the Cauchy Integral Formula in this particular instance by computing the mean of the samples we have collected around the origin. |
/todo i believe this function works incorrectly when the target time is not 0. hence, the target time needs to be passed in.
|
inline |
Collects samples while tracking around the target time, until we close the loop, or exceed the limit on # of loops.
the target time, at which we are computing roots of a system
SuccessCode deeming if we were able to collect all samples around the origin, or if we encounted an error at some point.
the starting time and point for this routine are the most recent power series samples.
| ComplexT | The complex number type. This function populates the deque cauchy_samples and cauchy_times. These are data members of the class and are not passed in. This function will continue to call CircleTrack until we have closed the loop. |
|
inline |
Build a closed Cauchy loop's samples at the active numeric type, migrating-and-retrying in mpfr on escalation.
|
inlineinherited |
An estimate of c/k from the three most recent geometric samples.
Assumes the path is in the endgame operating zone, where the Puiseux asymptotics dominate; as the cycle-number estimate settles, successive values of this estimate settle with it, which is what CheckForCOverKStabilization watches for.
It reads only the geometrically-spaced approach samples and the fixed probe, which every endgame flavor maintains – the power series endgame's samples_ and the Cauchy endgame's pseg_samples_ are the same window under two names – so it belongs here rather than to either flavor (b2#402). Consult page 53 of [4] for the heuristic.
| ComplexT | The complex number type. |
| samples | The geometric approach samples; the first three are used. |
|
inlineinherited |
Get the system being tracked on, which is referred to by the tracker.
Populates time and space samples so that we are ready to start the endgame.
start_time: is the time when we start the endgame process usually this is .1
x_endgame_start: is the space value at start_time
times: a deque of time values. These values will be templated to be ComplexT
samples: a deque of sample values that are in correspondence with the values in times. These values will be vectors with entries of ComplexT.
SuccessCode indicating whether tracking to all samples was successful.
The first sample will be (x_endgame_start) and the first time is start_time. From there we do a geometric progression using the sample factor (which by default is 1/2). Hence, next_time = start_time * sample_factor. We track then to the next_time and construct the next_sample.
| start_time | The time value at which we start the endgame. |
| target_time | The time value that we are trying to find a solution to. |
| x_endgame_start | The current space point at start_time. |
| times | A deque that will hold all the time values of the samples we are going to use to start the endgame. |
| samples | a deque that will hold all the samples corresponding to the time values in times. |
| ComplexT | The complex number type. |
|
inlineinherited |
|
inlineinherited |
Set the cycle number.
|
inlineinherited |
Announce a completed sample point on the path, as a ComputedSamplePoint.
The payload rides at BaseComplexT, so the adaptive endgame's hardware-double fast lane must convert – and only pays for that when something is actually observing. Shared by the initial window here and by each flavor's time advance, so the conversion rule lives in one place.
| sample | The newly completed sample point on the path. |
| time | The time value at which it was computed. |
| ComplexT | The complex number type the endgame is currently working in. |
|
inlineinherited |
This function is inferior to the templated Get<ConfigT> function provided.
|
inlineinherited |
Track through the tracker, adapting at the numeric-type boundary.
The tracker's TrackPath I/O is fixed to BaseComplexT (its TrackerLoopInitialization / CopySolution are non-templatable virtuals). When the adaptive-numeric-type endgame is computing in the hardware complex_dbl fast lane (ComplexT != BCT, i.e. the AMP case), we convert at the boundary: hand the tracker mpfr points at DoublePrecision – so the AMP tracker uses its hardware-double slot internally – then downcast the result back to complex_dbl. If the tracker escalated internally (GetCurrentPrecision() > DoublePrecision()), the caller's escalation hook discards this result and migrates the endgame to mpfr, so the truncating downcast is harmless.
When ComplexT == BCT (every fixed-precision tracker, and the AMP endgame's mpfr lane) this is a direct, zero-overhead call to the tracker – byte-identical to calling TrackPath itself.
MICRO-OPT (future): a native complex_dbl TrackPath overload on the AMP tracker would remove the boundary conversion churn (~1-2% of a track). Deferred – see the sprint notes.
|
inlineinherited |
Raise the endgame to the next precision and migrate the containers' complex_dbl slot up to complex_mp when the tracker's authority escalates.
|
inlineinherited |
Get the most-recent approximation.
|
inlineinherited |
Get the final tolerance to which we are tracking the solution.
|
inlineinherited |
Get the held configuration object of type T.
|
inline |
Getter for the space values for the Cauchy endgame.
Available in const and non-const flavors
|
inline |
Const overload returning the Cauchy sample values.
|
inline |
Getter for the specific settings in tracking_conifg.hpp under Cauchy.
|
inline |
Getter for the time values for the Cauchy endgame.
|
inline |
Const overload returning the Cauchy time values.
|
inlineprotectedinherited |
The fixed random direction the c/k estimate is projected along.
An exact conversion of the direction as drawn, at the requested precision. Converted, not rounded in place: the drawn values are doubles, which every multiple precision holds exactly, so the direction is the same in both lanes and survives any change of precision.
| ComplexT | The complex number type. |
| size | The number of coordinates the probe must have. |
| prec | The working precision to supply it at. |
|
inline |
Track from the boundary inward until the path enters the endgame (Cauchy) operating zone.
|
inline |
Getter for the space values for the power series approximation of the Cauchy endgame.
Available in const and non-const flavors
|
inline |
Const overload returning the power-series sample values.
|
inline |
Getter for the time values for the power series approximation of the Cauchy endgame.
|
inline |
Const overload returning the power-series time values.
|
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.
|
inlineinherited |
Increase the cycle number by the given increment.
|
inline |
\brief Tracks til we believe we are in the Endgame Operating Zone, and then does a cauchy approximation
## Input:
start_time: time value for which we start to make a power series approximation
start_point: approximate solution to our homotopy H at the start_time
approximation_time: time at which we are trying to find the solution, usually t = 0
approximation approximate solution to our homotopy H at the approxmation_time
## Output:
SuccessCode reporting if any errors had occurred. All data collected is stored in class data members.
##Details:
| ComplexT | The complex number type. |
This function is in charge of finding the very first approximation of the origin. It does this by first computing some initial samples like what is done in the Power Series Endgame. We continue to track forward in this manner until we have stabilization of the cycle number being approximated. This prevents the unnecessary circle tracking if we are possibly not in the endgame operating zone. Once we have stabilization we then perform InitialCauchyLoops while getting the accurate cycle number, and check the norms of the samples and make sure we are ready to approximate.
|
inline |
\brief This function tracks into origin while computing loops around the origin. The function is checking to make sure we have reached a time when the ratio of the
maximum and minimum norms are withing some tolerance. When this is the case we return success. If this does not happen we will return an error depending on the error encountered.
## Input:
target_time: the time value that we are creating loops around, default set to t= 0
## Output:
initial_cauchy_loop_success: This variable returns any error code we have encountered or success if we have sucessfully
tracked to an appropriate time.
##Details:
\tparam ComplexT The complex number type.
|
inlineinherited |
Get the latest time at which a point on the path was computed.
|
inline |
|
inline |
Widen this flavor's Cauchy containers from the complex_dbl slot up to complex_mp at the new precision.
|
inline |
The FLOOR of the current Cauchy loop: the smallest dehomogenized infinity-norm over the loop samples.
This is the divergence signal the mean cannot give: around a closed loop the branches of a fractional pole t^(-p/q) cancel, so the Cauchy mean stays near 0 while every SAMPLE has norm ~r^(-p/q). The floor exceeds a bound only when the ENTIRE loop is beyond it, so a transient single-sample spike (the cyclic-6 hazard that forbade watching samples directly) cannot lift it. NaN samples are skipped; a loop with no finite samples returns the largest value (a fully-poisoned loop counts as beyond any bound).
| ComplexT | The complex number type of the samples to inspect. |
|
inlineprotectedinherited |
Notify all observers of a (mutable) event.
|
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.
|
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 >.
|
inline |
The pole-component mass of the current Cauchy loop: the endgame operating-zone measurement.
The loop samples are a discrete Fourier series of the Puiseux/Laurent expansion of the path around the target time. Every CLEAN Puiseux term t^{k/c} with k >= 0 contributes exactly zero to the twisted means below (roots-of-unity orthogonality), so any surviving mass in the negative modes k = -1..-c measures structure the operating zone forbids:
The two cases separate as the radius shrinks: an inside singularity's mass dies once r < |t*| (then the endgame may proceed – the zone finally reached); a pole at the target time has mass GROWING like 1/r, so it never reaches the operating zone and never accepts convergence (the acceptance gate in RunImpl).
Uses exactly the samples the mean uses: the closed c-circuit loop, uniform in angle, the duplicate closing sample excluded. Coordinates only – no function values, so system scaling cannot affect the verdict.
| ComplexT | The complex number type of the samples. |
|
inline |
PoleComponentMass read from whichever numeric lane the adaptive (double-first) endgame is currently computing in.
|
inline |
Is a pole-component mass SIGNIFICANT, i.e.
above the noise floor of the refined samples, relative to the approximation's own scale?
| mass | The pole-component mass (PoleComponentMass). |
| approx_scale | The infinity norm of the current approximation. |
|
inlineinherited |
Get the second-most-recent approximation.
|
inline |
After we have used CircleTrack and have successfully closed the loop using CheckClosedLoop we need to check the maximum and minimum norms of the samples collected.
If the ratio of the maximum and minimum norm are within the threshold maximum_cauchy_ratio, and the difference is greater than final tolerance than we are successful.
target_time: Used to stay correct if we are using the endgame for a non-zero target time.
true: If we are within the ratio cutoff time, or have a ratio within the thresholds. false: otherwise
| ComplexT | The complex number type. It is important to know if we are within the endgame operating zone. This function allows us to have a check that heuristcially will tell us if we are. |
|
inlineinherited |
Refine every sample point to the endgame's refinement tolerance.
|
inlineinherited |
A function passed off to the precision-specific endgame part.
Templated on ComplexT so the adaptive-numeric-type endgame can refine in the hardware-complex_dbl fast lane as well as in complex_mp. The precision policy (FixedPrecEndgame / AMPEndgame) provides the matching RefineSampleImpl overload(s). Fixed precision only ever instantiates this at BCT.
|
inlineprotectedinherited |
Draw the c/k probe direction for a run.
Called at the start of every run, after whatever reseed the caller does for the path, so the direction is a function of the random-number stream at that point and nothing else.
| size | The number of coordinates the probe must have. |
|
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.
|
inline |
Shift the power-series sample window forward by one (time, sample) pair.
|
inlineinherited |
Run the endgame from the stored boundary time to the stored target time.
Re-precisions the stored times to match start_point before dispatching to RunImpl, so the caller never needs to worry about precision alignment.
Call SetBoundaryTime() before invoking Run().
|
inline |
Primary function that runs the Cauchy endgame.
To begin, this function will compute a first approximation using the power series endgame notion. This approximation is made after a heuristic on the stabilization of the cyle number is made, and after the maximum and minimum norms of tracked space values around the origin are withing a certain tolerance.
## Input:
start_time: the time value at which we start the endgame
start_point: an approximate solution to our homotopy H at start_time
target_time: the time value that we are using the endgame to interpolate to.
## Output:
SuccessCode: reporting if we were successful in the endgame or if we encountered an error
##Details:
| ComplexT | The complex number type. This function runs the entire Cauchy Endgame. We first take our endgame boundary time value and sample to find a first approximation of the origin. This is done by using the idea for the power series endgame. We check for stabilization of the cycle number, and check to see when the ratios of the maximum and minimum norm of samples collected by CircleTrack are withing a tolerance. When both of these conditions are met we do a Hermite interpolation. At this point we can start tracking in to the origin while using CircleTrack to compute samples and calculating their mean to get an approximation of the origin using the Cauchy Integral Formula. |
|
inline |
Run the Cauchy endgame via the double-first adaptive-numeric-type driver, migrating up to mpfr only on tracker escalation.
|
inline |
Run the initialization segment (seed the PSEG window and reach the EG zone) in a given numeric type.
|
inlineinherited |
|
inlineinherited |
Set the held configuration object of type T.
|
inlineinherited |
Set the endgame boundary (start) time.
|
inline |
Setter for the space values for the Cauchy endgame.
|
inline |
Setter for the specific settings in tracking_conifg.hpp under Cauchy.
|
inline |
Setter for the time values for the Cauchy endgame.
|
inlineinherited |
Setter for the final tolerance.
|
inline |
Setter for the space values for the power series approximation of the Cauchy endgame.
|
inline |
Setter for the time values for the power series approximation of the Cauchy endgame.
|
inlineinherited |
Set the final target time.
|
inlineinherited |
|
inline |
Validate the endgame configuration (e.g. require >= 3 sample points for circle tracking).
|
mutableprotectedinherited |
The error estimate between successive approximations.
Initialized to infinity, not left indeterminate: ApproximateError() is a public accessor, so a caller may read it before any endgame has run. Infinity is also the only safe sentinel here – every convergence gate in the flavors has the shape approximate_error_ < FinalTolerance(), and an indeterminate value that happened to be small would be a false convergence.
|
mutableprotectedinherited |
The c/k probe in each numeric type the endgame computes in: exact conversions of c_over_k_probe_as_drawn_, re-derived when their size or precision is wrong, never rounded.
|
mutableprotectedinherited |
The random direction the c/k estimate is projected along, as drawn: in double precision, so that it is exact in every lane and at every multiple precision.
Drawn at the start of every run (RefreshCOverKProbe) and fixed for the run, so consecutive estimates differ only because the samples differ. A fresh random probe every call made the stabilization test noisy – it could certify the operating zone spuriously – and churned mpfr allocations. See z_notes/20260629.
|
mutableprotected |
A deque of samples collected by CircleTrack.
Computed a mean of the values of this deque, after a loop has been closed, will give an approximation of the origin.
|
mutableprotected |
A deque of times that are collected by CircleTrack.
These samples are used to compute all approximations of the origin after the first.
|
inherited |
The held configuration objects, one per config type.
|
mutableprotectedinherited |
The current estimate of the cycle number.
|
mutableprotectedinherited |
The latest computed approximation of the endpoint.
|
mutableprotected |
Scratch so LatestTimeImpl can return a BCT reference while in the double fast lane.
|
mutableprotectedinherited |
The previous approximation of the endpoint.
|
mutableprotected |
A deque of samples that are in correspondence with the pseg_times_.
These samples are also used to compute the first power series approximation for the Cauchy endgame.
|
mutableprotected |
A deque of times that are specifically used to compute the power series approximation for the Cauchy endgame.
|
protectedinherited |
The endgame boundary time; set via SetBoundaryTime().
|
protectedinherited |
The final target time (default 0); set via SetTargetTime().