|
Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
|
The zero-dimensional solve algorithm: given a polynomial system, form a start system and a homotopy, then run the continuation engine. More...
#include <zero_dim_solve.hpp>
Public Types | |
| using | OwnedT = zero_dim_detail::OwnedHomotopy<SystemType> |
| The system-owning base. | |
| using | EngineT = HomotopySolver<TrackerType, EndgameType, SystemType> |
| The continuation-engine base. | |
| using | FactoryT = typename OwnedT::FactoryT |
| The start-system factory type. | |
| using | TrackerT = TrackerType |
| The path-tracker type. | |
| using | EndgameT = EndgameType |
| The endgame type. | |
| using | SystemT = SystemType |
| The system type. | |
| using | StartSystemT = bertini::start_system::StartSystem |
| The start-system type (seen polymorphically). | |
| using | StartSystemBaseT = bertini::start_system::StartSystem |
| The start-system base type. | |
| using | BaseComplexT = typename tracking::TrackerTraits<TrackerType>::BaseComplexT |
| a bunch of using statements to reduce typing. | |
| using | BaseRealT = typename tracking::TrackerTraits<TrackerType>::BaseRealT |
| The real number type of the tracker. | |
| using | PrecisionConfig = typename tracking::TrackerTraits<TrackerType>::PrecisionConfig |
| The tracker's precision-configuration type. | |
| using | SolnIndT = typename SolnCont<BaseComplexT>::size_type |
| Index type for solutions/paths. | |
| using | Config |
| The Configured base storing this solver's configuration structs. | |
| using | Tolerances = TolerancesConfig |
| Tolerances configuration type. | |
| using | PostProcessing = PostProcessingConfig |
| Post-processing configuration type. | |
| using | ZeroDimConf = ZeroDimConfig |
| Zero-dim configuration type. | |
| using | AutoRetrack = AutoRetrackConfig |
| Auto-retrack configuration type. | |
| using | EGBoundaryMetaDataT = EGBoundaryMetaData<BaseComplexT> |
| Endgame-boundary metadata type. | |
| using | SolutionMetaDataT = SolutionMetaData<BaseComplexT> |
| Per-solution metadata type. | |
| using | MidpathType = MidpathChecker<BaseRealT, BaseComplexT, EGBoundaryMetaData<BaseComplexT>> |
| The midpath (path-crossing) checker type. | |
| using | UsedConfigs |
| The list of configuration types this object holds. | |
Public Member Functions | |
| ZeroDimSolver (SystemType const &target, FactoryT factory=bertini::start_system::MakeStartFactory< bertini::start_system::TotalDegreeBinomial, SystemType >()) | |
| Build the start system + homotopy from target, then construct the engine over them. | |
| SystemType const & | RecordsTargetSystem () const override |
| The records name the PRISTINE user-supplied system as this solve's target (see HomotopySolver::RecordsTargetSystem). | |
| bool | WasRandomized () const |
| Whether the supplied system was over-determined and squared-up by randomization. | |
| Mat< complex_mp > const & | RandomizationMatrix () const |
| The randomization matrix used to square up (empty if the system was already square). | |
| bool | ObservableIsA (std::type_index t) const override |
| Whether this observable may be observed as the given type. | |
| const SystemType & | TargetSystem () const |
| const StartSystemBaseT & | StartSystem () const |
| const SystemType & | Homotopy () const |
| void | Run () override |
| Main Run() function provided for calling from the blackbox mode. | |
| void | WriteMainData (std::ostream &out) const override |
Write the human-readable main-data report to out. | |
| void | WriteRawData (std::ostream &out) const override |
Write the raw-data report to out. | |
| void | WriteFiniteSolutions (std::ostream &out) const override |
Write the finite solutions (Bertini 1.7 format) to out. | |
| void | WriteRealFiniteSolutions (std::ostream &out) const override |
Write the real finite solutions (Bertini 1.7 format) to out. | |
| void | WriteNonsingularSolutions (std::ostream &out) const override |
Write the nonsingular solutions (Bertini 1.7 format) to out. | |
| void | WriteSingularSolutions (std::ostream &out) const override |
Write the singular solutions (Bertini 1.7 format) to out. | |
| void | WriteRawSolutions (std::ostream &out) const override |
Write the raw solutions (Bertini 1.7 format) to out. | |
| void | ApplyParsedConfigs (std::string const &config_str) override |
| Apply configuration settings parsed from a classic-input config string. | |
| void | DefaultSetup () |
| setup functions | |
| void | DefaultSystemSetup () |
| Read off the number of start points the (already-built) start system will produce. | |
| void | DefaultSettingsSetup () |
| Fills the tolerances and retrack settings from default values. | |
| void | SetMidpathRetrackTol (NumErrorT const &rt) |
| Set the tolerance used when re-tracking paths flagged by the midpath check. | |
| const auto & | MidpathRetrackTol () const |
| void | SetStartPointPrecision (unsigned p) |
| Set the precision at which start points are computed. | |
| unsigned | StartPointPrecision () const |
| void | DefaultMidpathSetup () |
| call this after setting up the tolerances, etc. | |
| void | SetMidpath (MidPathConfig const &mp) |
| Apply a configuration to the midpath (path-crossing) checker. | |
| void | DefaultTrackerSetup () |
| Takes the default action to set up the zero dim algorithm with the default constructed tracker. | |
| void | SetTracker (TrackerType const &new_tracker) |
| Sets the tracker to one you supply to this function. | |
| const TrackerType & | GetTracker () const |
| Gets the tracker. | |
| TrackerType & | GetTracker () |
| Gets the tracker. | |
| void | SetEndgame (EndgameType const &new_endgame) |
| endgame specific stuff | |
| const EndgameType & | GetEndgame () const |
| Gets the endgame. | |
| EndgameType & | GetEndgame () |
| Gets the endgame. | |
| template<typename T> | |
| const T & | GetFromEndgame () const |
Get a configuration struct of type T from the endgame. | |
| template<typename T> | |
| void | SetToEndgame (T const &t) |
Set a configuration struct of type T on the endgame. | |
| void | Solve () |
| the main functions | |
| const auto & | SolutionsUserCoords () const |
| Get the computed solutions, in the coordinates of the user's original variables. | |
| const auto & | SolutionsInternalCoords () const |
| Get the computed solutions in the solver's internal coordinates: homogenized, and lying on the target system's patch. | |
| template<typename Pred> | |
| SolnCont< Vec< BaseComplexT > > | SolutionsWhere (Pred pred, bool user_coords=true, bool merge_multiplicities=false) const |
| Select the solution points whose parallel metadata satisfies a predicate. | |
| SolnCont< Vec< BaseComplexT > > | FiniteSolutions (bool user_coords=true, bool merge_multiplicities=false) const |
| The finite solutions: successful, finite endpoints that ARE solutions of the target (is_finite applies the configured endpoint_finite_threshold; nonsolutions are excluded). | |
| SolnCont< Vec< BaseComplexT > > | RealSolutions (bool user_coords=true, bool merge_multiplicities=false) const |
| The real finite solutions (is_real applies the configured tolerance). | |
| SolnCont< Vec< BaseComplexT > > | NonsingularSolutions (bool user_coords=true, bool merge_multiplicities=false) const |
| The nonsingular finite solutions (simple, well-conditioned roots). | |
| SolnCont< Vec< BaseComplexT > > | SingularSolutions (bool user_coords=true, bool merge_multiplicities=false) const |
| The singular finite solutions (multiple or ill-conditioned roots). | |
| SolnCont< Vec< BaseComplexT > > | Nonsolutions (bool user_coords=true) const |
| The NONSOLUTIONS: finite, successful endpoints that are NOT solutions of the target system – the extraneous nonsolutions squaring up an over-determined system introduces. | |
| SolnCont< Vec< BaseComplexT > > | InfiniteSolutions (bool user_coords=true) const |
| The solutions at infinity: endpoints not classified finite (is_finite is false) – the complement of FiniteSolutions within the full solution list. | |
| const auto & | SolutionMetadata () const |
| Get the metadat associated with the final computed solutions. | |
| NumErrorT | DefaultPointMatchTolerance () const |
| The default point-match tolerance for MetadataForPoint / CoincidentMetadataForPoint. | |
| NumErrorT | SamePointTolerance () const |
| The same-point (clustering) tolerance: final_tolerance * same_point_tolerance_multiplier. | |
| SolutionMetaDataT | MetadataForPoint (Vec< BaseComplexT > const &point, NumErrorT tol, bool user_coords=true, bool representatives_only=true) const |
The metadata of the solution matching point – the cluster REPRESENTATIVE (issue #302). | |
| std::vector< SolutionMetaDataT > | CoincidentMetadataForPoint (Vec< BaseComplexT > const &point, NumErrorT tol, bool user_coords=true) const |
All metadata records for the paths coincident with point (issue #302). | |
| const auto & | EndgameBoundarySolutions () const |
| Get the solutions as computed at the endgame boundary. | |
| const MidpathCheckReport & | EndgameBoundaryMetadata () const |
| Get the report from the midpath (path-crossing) check performed at the endgame boundary: how many crossings were detected, which paths, how many re-track attempts were made, and whether the check ultimately passed. | |
| SolveReport | Report () const |
| A concise summary of the solve: how every path ended, by category, and whether any path was lost. | |
| void | RecordTo (std::shared_ptr< records::OutputDirectory > directory) |
| Attach a structured output directory: this solve records to (and memoizes/resumes from) it. | |
| void | RecordToPath (std::string const &path) override |
| Attach an output directory by path (the AnyZeroDim polymorphic hook). | |
| std::string | RecordsRunIdentity () const override |
| This solve's run id (the AnyZeroDim polymorphic hook). | |
| void | AppendRecordJson (std::string const &record_json) override |
| Append a raw JSON record to the attached directory (no-op if none). | |
| std::string | PutRecordsDefinition (std::string const &content, std::string const &kind, std::string const &label={}) override |
| Store a definition of the given kind (optional role label in the filename) in the attached directory (empty id if none). | |
| void | DeclareFiniteSolutionsResult () |
| Auto-declare this run's finite solutions as a result record and render the derived views – "what were my solutions?" answered by every recording solve, CLI and Python alike. | |
| std::shared_ptr< records::OutputDirectory > const & | Records () const |
| The attached output directory (null when not recording). | |
| unsigned long long | NumPaths () const |
| How many paths there are to answer: the start system's start point count. | |
| unsigned long long | NumPathsRecalled () const |
| How many paths the last Solve() recalled from records instead of computing. | |
| bool | WasStoppedEarly () const |
| Was the last Solve() stopped before it finished? | |
| unsigned long long | NumPathsNeverStarted () const |
| How many paths the last Solve() never began, because it was stopped. | |
| std::string const & | RecordsRunId () const |
| This solve's run id in the records (empty when not recording). | |
| void | MaybeAttachAmbientRecords () |
| Attach the ambient output directory (manager rank only; workers never touch the records). | |
| void | SetRecordedStartProvenance (std::vector< boost::json::object > refs, std::string start_identity) |
| Declare where this solve's start points came from, for the records (chains and givens). | |
| std::string | CanonicalSettingsText () const |
| The canonical text of this solver's FULL settings: the algorithm-level configs, then the tracker's own, then the endgame's – everything that decides what gets computed (the second plank of archiving the algorithms). | |
| boost::json::object | RecordsAsk () const |
| The ask identity of this solve: op + tracker/endgame kind (stable record names, never typeid) + target digest + settings digest + seed. | |
| template<typename... EGConfTs> | |
| void | AppendEndgameConfigEncodings (std::ostringstream &text, detail::TypeList< EGConfTs... >) const |
| Append the canonical encodings of the endgame's configs (its AlgoTraits::NeededConfigs, in declaration order) to the settings text. | |
| void | EnsureRunRecorded () |
| Ensure this solve's run header is on record (appending it if absent) and set the run id. | |
| std::vector< SolnIndT > | RecallRecordedPaths (std::vector< SolnIndT > const &all_indices) |
| Recall recorded paths into the solver's state and return the indices still to compute. | |
| void | TallyStoppedSolve (std::vector< SolnIndT > const &dispatched) |
| After dispatching paths, work out whether this solve was cut short, and say so. | |
| void | RecordCompletedPath (parallel::FullPathResult< BaseComplexT > const &r) |
| Emit the path record for one completed path into the run's results file (called from StoreFullPathResult on the main/manager thread; no-op while recalling or when not recording). | |
| template<typename T, typename = typename std::enable_if<IsTemplateParameter<T,Ts...>::value>::type> | |
| const T & | Get () const |
| Retrieve a stored configuration struct by type (inherited from Configured). | |
| 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. | |
Static Public Member Functions | |
| static bool | AbandonmentIsReusable (parallel::FullPathResult< BaseComplexT > const &r, double current_limit) |
| Under RecallPolicy::Completed, may this recorded path stand in for tracking it? | |
Public Attributes | |
| std::tuple< Ts... > | configuration_ |
| The held configuration objects, one per config type. | |
Protected Member Functions | |
| void | PostEGAction () override |
| After the engine classifies the endpoints, discard the extraneous solutions that squaring an over-determined system introduces. | |
| void | ResetSystems (SystemType const &hom, StartSystemBaseT const &start, SystemType const &target) |
| Re-seat the system references (used after an MPI broadcast re-materializes the owned systems). | |
| void | ComputePostTrackMetadata () |
| Populates the result_ member, with the post-processed results of the zero dim solve. | |
| void | ClassifyFiniteAndReal () |
| Classify each successful endpoint as finite/infinite, and (when finite) real. | |
| void | ComputeMultiplicities () |
| Cluster identical endpoints to compute multiplicities. | |
| void | ClassifySingular () |
| Classify each successful endpoint as singular or not. | |
| parallel::FullPathResult< BaseComplexT > | PackFullPathResult (SolnIndT idx) const |
| Pack everything computed for one whole path into a single result value (thread/MPI handoff). | |
| void | StoreFullPathResult (parallel::FullPathResult< BaseComplexT > const &r) |
| Install a whole-path result (from PackFullPathResult) into the shared result arrays. | |
| bool | SolveDeadlinePassed () const |
| Whether the whole-solve wall-clock budget has run out. | |
| void | ReadSolveTimeoutAsAnInterrupt (SuccessCode &code, std::chrono::steady_clock::time_point path_start) const |
| A path the WHOLE-SOLVE budget cut off reads as interrupted, not as over its own budget. | |
| 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). | |
Static Protected Member Functions | |
| static NumErrorT | EndpointSpectralConditionNumber (SystemType const &sys, Vec< BaseComplexT > const &endpoint) |
| The spectral-norm condition number of the system's Jacobian at an endpoint. | |
| static Vec< NumErrorT > | EndpointSingularValues (SystemType const &sys, Vec< BaseComplexT > const &endpoint) |
| The singular values of the system's Jacobian at an endpoint, largest first. | |
| static NumErrorT | SpectralConditionNumberOf (Vec< NumErrorT > const &singular_values) |
| The spectral condition number from a spectrum: largest over smallest singular value. | |
Protected Attributes | |
| std::reference_wrapper< const SystemType > | target_system_ |
| Reference to the caller-owned target system. | |
| std::reference_wrapper< const StartSystemBaseT > | start_system_ |
| Reference to the caller-owned start system. | |
| std::reference_wrapper< const SystemType > | homotopy_ |
| Reference to the caller-owned homotopy. | |
| std::shared_ptr< records::OutputDirectory > | records_ |
| The attached output directory (null = not recording). | |
| std::string | records_run_id_ |
| This solve's run id in the records (ask hash prefix). | |
| std::vector< boost::json::object > | records_start_refs_ |
| Per-path start provenance (point_ref/given_ref); empty = canonical start labels. | |
| std::string | records_start_identity_ |
| Identity of externally supplied start data (joins the ask); empty = starts derive from target+seed. | |
| bool | recalling_ = false |
| True while replaying recorded paths (suppresses re-emission). | |
| bool | records_run_resumed_ = false |
| True when this ask's run header pre-existed (a re-ask: emit a recall event). | |
| unsigned long long | num_recalled_ = 0 |
| Paths recalled from records in the last Solve(). | |
| bool | stopped_early_ = false |
| True when the last Solve() was asked to stop partway. | |
| std::optional< std::chrono::steady_clock::time_point > | solve_deadline_ |
| The whole-solve wall-clock deadline of the current Solve(), when one was asked for. | |
| unsigned long long | num_never_started_ = 0 |
| Paths the last Solve() never began, because it stopped. | |
| unsigned long long | num_start_points_ |
| Number of start points the start system produces. | |
| NumErrorT | midpath_retrack_tolerance_ |
| Tolerance used when re-tracking paths flagged by the midpath check. | |
| MidpathCheckReport | midpath_report_ |
| populated by EGBoundaryAction; exposed via EndgameBoundaryMetadata() | |
| unsigned | start_point_precision_ = DoublePrecision() |
| precision at which start points are computed; defaults to initial ambient precision (see PreSolveSetup) | |
| bool | start_point_precision_set_by_user_ = false |
| Whether the start-point precision was set explicitly by the user. | |
| tracking::PathPrecisionRecorder< TrackerType > | path_prec_ |
| observers used during tracking | |
| TrackerType | tracker_ |
| function objects used during the algorithm | |
| EndgameType | endgame_ |
| The endgame. | |
| MidpathType | midpath_ |
| The midpath (path-crossing) checker. | |
| SolnCont< EGBoundaryMetaDataT > | solutions_at_endgame_boundary_ |
| computed data | |
| SolnCont< Vec< BaseComplexT > > | solutions_post_endgame_ |
| Solution points after the endgame (internal coordinates). | |
| SolnCont< Vec< BaseComplexT > > | solutions_user_coords_ |
| lazy cache for SolutionsUserCoords; serial post-solve access assumed | |
| bool | solutions_user_coords_fresh_ = false |
| Whether the user-coordinate cache is up to date. | |
| SolnCont< SolutionMetaDataT > | solution_final_metadata_ |
| Final per-solution metadata. | |
The zero-dimensional solve algorithm: given a polynomial system, form a start system and a homotopy, then run the continuation engine.
The zero-dimensional solve algorithm.
Owns its systems; is-a HomotopySolver.
Owns its systems: it clones the user's target, homogenizes/patches it, builds a start system (via the injected factory) and a homotopy, then drives the continuation engine. It IS-A HomotopySolver – the engine machinery (tracking, endgame, crossing resolution, classification, reporting) is reused, not duplicated – with an OwnedHomotopy base supplying the systems the engine references.
|
inherited |
Auto-retrack configuration type.
|
inherited |
a bunch of using statements to reduce typing.
The complex number type of the tracker.
|
inherited |
The real number type of the tracker.
|
inherited |
The Configured base storing this solver's configuration structs.
|
inherited |
Endgame-boundary metadata type.
|
inherited |
The endgame type.
| using bertini::algorithm::ZeroDimSolver< TrackerType, EndgameType, SystemType >::EngineT = HomotopySolver<TrackerType, EndgameType, SystemType> |
The continuation-engine base.
| using bertini::algorithm::ZeroDimSolver< TrackerType, EndgameType, SystemType >::FactoryT = typename OwnedT::FactoryT |
The start-system factory type.
|
inherited |
The midpath (path-crossing) checker type.
| using bertini::algorithm::ZeroDimSolver< TrackerType, EndgameType, SystemType >::OwnedT = zero_dim_detail::OwnedHomotopy<SystemType> |
The system-owning base.
|
inherited |
Post-processing configuration type.
|
inherited |
The tracker's precision-configuration type.
|
inherited |
Index type for solutions/paths.
|
inherited |
Per-solution metadata type.
|
inherited |
The start-system base type.
|
inherited |
The start-system type (seen polymorphically).
|
inherited |
The system type.
|
inherited |
Tolerances configuration type.
|
inherited |
The path-tracker type.
|
inherited |
The list of configuration types this object holds.
|
inherited |
Zero-dim configuration type.
|
inline |
Build the start system + homotopy from target, then construct the engine over them.
Base initialization order is declaration order: OwnedHomotopy (which builds) runs before the HomotopySolver engine (which references the freshly built systems). The factory defaults to TotalDegreeBinomial (the interim default start system).
|
inlinestaticinherited |
Under RecallPolicy::Completed, may this recorded path stand in for tracking it?
A completed path always may. An interrupted path never may. A path a wall-clock limit cut off may only while the current per-path limit is set and asks no more patience than the recorded one – the same amount of waiting, or less, on the same machine; across machines the comparison is a heuristic, which is why the stamp (steps, precision, time reached) travels with the record too.
| r | The decoded record. |
| current_limit | This run's per-path wall-clock limit in seconds (0 = none). |
|
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). |
|
inlineinherited |
Append the canonical encodings of the endgame's configs (its AlgoTraits::NeededConfigs, in declaration order) to the settings text.
| EGConfTs | The endgame's config types, from its NeededConfigs list. |
| text | The settings text being built. |
|
inlineoverridevirtualinherited |
Append a raw JSON record to the attached directory (no-op if none).
Reimplemented from bertini::algorithm::AnyZeroDim.
|
overridevirtualinherited |
Apply configuration settings parsed from a classic-input config string.
Implements bertini::algorithm::AnyZeroDim.
|
inlineinherited |
The canonical text of this solver's FULL settings: the algorithm-level configs, then the tracker's own, then the endgame's – everything that decides what gets computed (the second plank of archiving the algorithms).
The order is the contract (fixed per solver kind): version line; ZeroDimConf, Tolerances, AutoRetrack, PostProcessing; the tracker's Stepping, Newton, Predictor, and precision config (fixed or adaptive); then the endgame's configs in its AlgoTraits::NeededConfigs declaration order; then MidPath. One encoding per line, trailing newline. The settings digest is SHA-256 over exactly this text.
MidPath sits last because the order is extended by APPENDING, never by inserting or reordering (ADR-0043) – it is an algorithm-level config and reads out of place there, which is the visible price of a rule worth keeping. It was missing until b2cfgenc/4: it governs path-crossing detection, so two solves that disagree about same_point_tolerance can reach different answers, and until the bump they were the same ask and recalled each other's results.
|
inlineprotectedinherited |
Classify each successful endpoint as finite/infinite, and (when finite) real.
Uses the same dehomogenize-then-infinity-norm measurement the endgames use for their Security::max_norm divergence test (System::InfinityNormOfDehomogenized), compared against endpoint_finite_threshold – so the metadata can never contradict the endgame's own verdict. Endpoints the endgame already flagged as diverging (GoingToInfinity / SecurityMaxNormReached) are taken as infinite without recomputation. A finite endpoint is real if the infinity norm of the imaginary parts of its dehomogenized coordinates is below real_threshold.
|
inlineprotectedinherited |
Classify each successful endpoint as singular or not.
Matching Bertini 1: an endpoint is singular if it is the endpoint of multiple paths (multiplicity > 1), or if the approximation of its condition number, in the spectral norm, exceeds condition_number_threshold. The condition number compared here is the one computed at the endpoint by EndpointSpectralConditionNumber – see that function for why the tracker's running estimate must not be substituted.
|
inlineinherited |
All metadata records for the paths coincident with point (issue #302).
Like MetadataForPoint, but returns EVERY coincident copy's record – their individual per-path diagnostics (condition number, residual, precision) – ALWAYS as a list (length 1 for a simple root). The point is matched to its cluster REPRESENTATIVE (nearest representative within tol, like MetadataForPoint), then the whole cluster is gathered: every endpoint within SamePointTolerance of that representative – i.e. exactly the paths ComputeMultiplicities grouped together. So the returned count is the multiplicity, independent of tol. Throws if no representative matches within tol.
| point | The point to look up. |
| tol | The infinity-norm match tolerance for finding the cluster's representative. |
| user_coords | Whether point is in user coordinates. |
|
inlineprotectedinherited |
Cluster identical endpoints to compute multiplicities.
Two endpoints are the same point when the infinity norm of the difference of their dehomogenized* coordinates is below final_tolerance * same_point_tolerance_multiplier. Comparing dehomogenized (user) coordinates – not the internal homogenized, on-patch coordinates, which carry the homogenizing variable and patch scaling – is essential; the infinity norm matches the convergence norm the endgames use. Only finite, successful endpoints are clustered (an at-infinity endpoint has no meaningful dehomogenized coordinates to compare).
|
inlineprotectedinherited |
Populates the result_ member, with the post-processed results of the zero dim solve.
output: result_ member variable.
|
inlineinherited |
Auto-declare this run's finite solutions as a result record and render the derived views – "what were my solutions?" answered by every recording solve, CLI and Python alike.
Called after post-processing; no-op when not recording.
|
inlineinherited |
call this after setting up the tolerances, etc.
|
inlineinherited |
The default point-match tolerance for MetadataForPoint / CoincidentMetadataForPoint.
The solver's final_tolerance – the accuracy each endpoint is computed to. This is the right scale for "does this point equal that solution", and it is deliberately NOT the (looser) same-point clustering tolerance (SamePointTolerance). MetadataForPoint matches against the multiplicity REPRESENTATIVES, which are at least SamePointTolerance apart by construction; since final_tolerance is that divided by same_point_tolerance_multiplier (>= 1), a match window this size holds at most one representative – so a point taken straight from this solver's own solution lists (solutions(), real_solutions(), ..., which return representatives by default) matches its own representative back and can never be reported ambiguous. Returned as NumErrorT, the error/tolerance type (an alias for double), matching IsDistinct.
|
inlineinherited |
Fills the tolerances and retrack settings from default values.
|
inlineinherited |
setup functions
|
inlineinherited |
Read off the number of start points the (already-built) start system will produce.
|
inlineinherited |
Takes the default action to set up the zero dim algorithm with the default constructed tracker.
|
inlineinherited |
Get the report from the midpath (path-crossing) check performed at the endgame boundary: how many crossings were detected, which paths, how many re-track attempts were made, and whether the check ultimately passed.
|
inlineinherited |
Get the solutions as computed at the endgame boundary.
|
inlinestaticprotectedinherited |
The singular values of the system's Jacobian at an endpoint, largest first.
The spectrum behind EndpointSpectralConditionNumber, kept whole: it is what a caller needs to read a numerical rank at a tolerance of its own choosing (b2#409).
| sys | The (homogenized, patched) system whose Jacobian to measure; its precision must already match the endpoint's. |
| endpoint | The solution point, in the system's own (homogenized) coordinates. |
|
inlinestaticprotectedinherited |
The spectral-norm condition number of the system's Jacobian at an endpoint.
This is the quantity Bertini 1's CondNumThreshold is specified against ("an
approximation of the condition number, in the spectral norm"):
of the homogenized, patched target system's Jacobian, evaluated AT the endpoint, at the endpoint's own precision.
The tracker's running estimate (LatestConditionNumber(): norm_J * norm_J_inverse from a random-RHS LU probe, refreshed only every frequency_of_CN_estimation steps, on the homotopy mid-path) is NOT a substitute and must not be used for classification: endpoints lying exactly on a positive-dimensional component – whose Jacobian is provably rank-deficient, spectral condition number effectively infinite – have been observed carrying tracker estimates as low as ~1e3, silently classifying as nonsingular. The tracker estimate remains available per-step via observers.
A singular-to-working-precision Jacobian (smallest singular value 0, or an empty singular value list) yields +infinity, which compares correctly against any threshold.
| sys | The (homogenized, patched) system whose Jacobian to measure; its precision must already match the endpoint's. |
| endpoint | The solution point, in the system's own (homogenized) coordinates. |
|
inlineinherited |
Ensure this solve's run header is on record (appending it if absent) and set the run id.
Requires an attached directory; call after PreSolveSetup.
|
inlineinherited |
The finite solutions: successful, finite endpoints that ARE solutions of the target (is_finite applies the configured endpoint_finite_threshold; nonsolutions are excluded).
Includes singular, nonsingular, and real solutions alike.
|
inlineinherited |
Retrieve a stored configuration struct by type (inherited from Configured).
|
inlineinherited |
Gets the endgame.
This version gets a mutable reference to it.
|
inlineinherited |
Gets the endgame.
This version gets a const reference to it.
|
inlineinherited |
Get a configuration struct of type T from the endgame.
|
inlineinherited |
Gets the tracker.
This version gets a mutable reference to it.
|
inlineinherited |
Gets the tracker.
This version gets a const reference to it.
|
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 |
|
inlineinherited |
The solutions at infinity: endpoints not classified finite (is_finite is false) – the complement of FiniteSolutions within the full solution list.
These are the paths the endgame resolved as diverging (its GoingToInfinity / SecurityMaxNormReached verdict, or a successful endpoint whose dehomogenized infinity norm exceeds endpoint_finite_threshold).
|
inlineinherited |
Attach the ambient output directory (manager rank only; workers never touch the records).
Records are ON BY DEFAULT for every solver, matching the CLI and bertini.solve (ADR-0047): the resolution – unset BERTINI_RECORDS_DIR means ./bertini_output, a value chooses the directory, none (or the POSIX-only empty string) means explicitly no records – lives in records::AmbientRecordsPath. An explicit RecordTo(...) always wins over the ambient resolution.
|
inlineinherited |
The metadata of the solution matching point – the cluster REPRESENTATIVE (issue #302).
Matches point against the solutions (user coordinates by default) with the infinity-norm tolerance tol (see IsDistinct), and returns the representative's metadata. The return type never depends on the point's multiplicity: this ALWAYS returns exactly one record (it carries multiplicity, so you still learn m). Throws if no solution matches, or if point matches more than one distinct cluster (reduce tol).
| point | The point to look up, in user (dehomogenized) coordinates unless user_coords is false. |
| tol | The infinity-norm match tolerance. Defaults (via the binding sentinel) to DefaultPointMatchTolerance. |
| user_coords | Whether point is in user coordinates (else the solver's internal coordinates). |
| representatives_only | Match point only against the multiplicity representatives (the default – one candidate per distinct solution, so a point fed back from the solver's own solution lists resolves to its representative and never reports ambiguity). Pass false to match against EVERY endpoint including non-representative multiplicity copies – a debugging view, not the usual case. |
|
inlineinherited |
|
inlineinherited |
The nonsingular finite solutions (simple, well-conditioned roots).
|
inlineinherited |
The NONSOLUTIONS: finite, successful endpoints that are NOT solutions of the target system – the extraneous nonsolutions squaring up an over-determined system introduces.
Empty for a system solved without randomization. These are excluded from FiniteSolutions / RealSolutions / etc.; a regeneration cascade reads them to discard nonsolutions.
|
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.
|
inlineinherited |
How many paths there are to answer: the start system's start point count.
Known once PreSolveSetup has run, which is before the first path event, so a watcher can size itself from the AlgorithmStarted event. Zero before that.
|
inlineinherited |
How many paths the last Solve() never began, because it was stopped.
|
inlineinherited |
How many paths the last Solve() recalled from records instead of computing.
|
inlineoverridevirtualinherited |
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 from bertini::Observable.
|
inlineprotectedinherited |
Pack everything computed for one whole path into a single result value (thread/MPI handoff).
| idx | The path index to pack. |
|
inlineoverrideprotectedvirtual |
After the engine classifies the endpoints, discard the extraneous solutions that squaring an over-determined system introduces.
Squaring replaces N equations by n generic combinations, so the square system's isolated solutions are the genuine ones PLUS spurious points that satisfy the combinations but not the original system. Re-evaluate the ORIGINAL (un-randomized) system at each finite endpoint; a residual above a solve-accuracy threshold flags the point is_nonsolution (it stays geometrically finite, but drops out of FiniteSolutions / Real / Singular and is surfaced by Nonsolutions()), and the reported function_residual is updated to that meaningful value. A no-op unless the system was squared up.
Reimplemented from bertini::algorithm::HomotopySolver< TrackerType, EndgameType, SystemType >.
|
inlineoverridevirtualinherited |
Store a definition of the given kind (optional role label in the filename) in the attached directory (empty id if none).
Reimplemented from bertini::algorithm::AnyZeroDim.
|
inline |
The randomization matrix used to square up (empty if the system was already square).
|
inlineprotectedinherited |
A path the WHOLE-SOLVE budget cut off reads as interrupted, not as over its own budget.
The tracker cannot tell which deadline it hit; both arrive as WallClockLimitReached. But they mean different things. A per-path budget is a statement about that path, recorded with it and compared on recall. The solve budget is a statement about the call, like a keyboard interrupt: the path was abandoned for a reason that has nothing to do with it, so it is ExternallyTerminated – always re-tracked on recall, and counted by WasStoppedEarly(). The solve deadline was the one that bound if it had passed and the path's own budget, if any, had not yet.
| code | The stage's outcome, rewritten in place when the solve budget was what bound. |
| path_start | When this path began, to work out whether its own budget had run out. |
|
inlineinherited |
The real finite solutions (is_real applies the configured tolerance).
|
inlineinherited |
Recall recorded paths into the solver's state and return the indices still to compute.
Each recorded path is decoded to a FullPathResult and replayed through StoreFullPathResult – recalled state is identical to computed state by construction (boundary data included, so the midpath check works on resume).
|
inlineinherited |
Emit the path record for one completed path into the run's results file (called from StoreFullPathResult on the main/manager thread; no-op while recalling or when not recording).
The record carries the endpoint AND its per-path metadata together – the data and its facts are one thing (history holds only what was asked, when).
|
inlineinherited |
The attached output directory (null when not recording).
|
inlineinherited |
The ask identity of this solve: op + tracker/endgame kind (stable record names, never typeid) + target digest + settings digest + seed.
The settings digest is SHA-256 over CanonicalSettingsText() – ALL the configs the solve reads, algorithm + tracker + endgame, in that method's fixed documented order (ADR-0043; extend by appending, never reordering).
|
inlineinherited |
This solve's run id in the records (empty when not recording).
|
inlineoverridevirtualinherited |
This solve's run id (the AnyZeroDim polymorphic hook).
Reimplemented from bertini::algorithm::AnyZeroDim.
|
inlineoverridevirtual |
The records name the PRISTINE user-supplied system as this solve's target (see HomotopySolver::RecordsTargetSystem).
Reimplemented from bertini::algorithm::HomotopySolver< TrackerType, EndgameType, SystemType >.
|
inlineinherited |
Attach a structured output directory: this solve records to (and memoizes/resumes from) it.
Null detaches. See ADR-0046.
|
inlineoverridevirtualinherited |
Attach an output directory by path (the AnyZeroDim polymorphic hook).
Uses the process-shared instance for the path: one session history file per directory per process, however many solvers attach.
Reimplemented from bertini::algorithm::AnyZeroDim.
|
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.
|
inlineinherited |
A concise summary of the solve: how every path ended, by category, and whether any path was lost.
Computed on demand from the final solution metadata and the midpath report.
|
inlineprotectedinherited |
Re-seat the system references (used after an MPI broadcast re-materializes the owned systems).
|
inlineoverridevirtualinherited |
Main Run() function provided for calling from the blackbox mode.
Implements bertini::algorithm::AnyAlgorithm.
|
inlineinherited |
The same-point (clustering) tolerance: final_tolerance * same_point_tolerance_multiplier.
The tolerance ComputeMultiplicities uses to decide two endpoints are the SAME solution and cluster them into one multiplicity. Looser than DefaultPointMatchTolerance on purpose: distinct paths to a single (especially singular) solution land farther apart than one endpoint's own accuracy. CoincidentMetadataForPoint uses it to gather all copies of a matched cluster.
|
inlineinherited |
Set the held configuration object of type T.
|
inlineinherited |
endgame specific stuff
Sets the endgame to one you supply to this function.
Assumes you have done all necessary setup to it, including associating it with the homotopy for the ZeroDim algorithm.
Also assumes that you have made the tracker inside the ZeroDim algorithm be the self-same tracker object as is used for the endgame you are setting here.
|
inlineinherited |
Apply a configuration to the midpath (path-crossing) checker.
Stored on the SOLVER, which is the one home for the setting, and pushed into the checker at the start of each solve. The checker was previously the only holder, which put the setting out of reach of the solver's settings surface – the one computational setting a caller could not name (b2#364).
| mp | The midpath configuration to apply. |
|
inlineinherited |
Set the tolerance used when re-tracking paths flagged by the midpath check.
|
inlineinherited |
Declare where this solve's start points came from, for the records (chains and givens).
By default a solve's start points derive from the target + seed (canonical start labels – provenance bottoms out at the start system). When the caller supplies start points – a prior run's solutions (a CHAIN) or external data (a GIVEN) – pass one reference object per path, e.g. {"kind":"point_ref","run":<id>,"index":i} or {"kind":"given_ref","given":<definition id>,"index":i}, plus an identity string for the start data as a whole, which JOINS THE ASK: the same homotopy from different start data is a different computation.
Call before Solve() (and before RecordsAsk()/EnsureRunRecorded()).
| refs | One provenance object per start point, in path-index order. |
| start_identity | Digest/id of the start data (joins the ask identity). |
|
inlineinherited |
Set the precision at which start points are computed.
Defaults to the initial ambient precision. Set this to carry a higher precision forward (e.g. when one solve's output seeds the next). Once set, PreSolveSetup will not override it.
|
inlineinherited |
Set a configuration struct of type T on the endgame.
|
inlineinherited |
Sets the tracker to one you supply to this function.
Setting the tracker associates the endgame with the tracker you pass in, too. If this is a problem, and you need this generalized so you can use a different tracker for the pre/endgame zones, please file an issue requesting this feature.
Assumes you have done all necessary setup to it, including associating it with the homotopy for the ZeroDim algorithm.
Again, YOU must ensure the tracker is associated with the correct homotopy
|
inlineinherited |
The singular finite solutions (multiple or ill-conditioned roots).
|
inlineinherited |
Get the metadat associated with the final computed solutions.
|
inlineinherited |
Get the computed solutions in the solver's internal coordinates: homogenized, and lying on the target system's patch.
These are the coordinates for continuing work – start points for further tracking re-using the target system's patch, refinement, etc. Take a user-coordinates point back to this representation with System::HomogenizePoint on the target system.
|
inlineinherited |
Get the computed solutions, in the coordinates of the user's original variables.
The stored internal solutions are dehomogenized through the target system, once, lazily, into a cache; repeated calls return the cached container by const reference. Assumes post-solve serial access, like the other accessors here.
|
inlineinherited |
Select the solution points whose parallel metadata satisfies a predicate.
The backing for the FiniteSolutions / RealSolutions / Singular / Nonsingular convenience accessors. Returns points in user coordinates by default (pass user_coords=false for the solver's internal coordinates), mirroring SolutionsUserCoords / SolutionsInternalCoords.
|
inlineinherited |
the main functions
Perform the basic Zero Dim solve algorithm.
This function iterates over all start points to the start system, tracking from each to the endgame boundary. At the endgame boundary, path crossings are checked for. Multiple paths which jump onto each other will not be detected, unless you are using a certified tracker, in which case this is prevented in the first place.
Paths which have crossed are re-run, up to a certain number of times.
Then, the points at the endgame boundary are tracked using the prescribed endgame toward the final time.
Finally, results are post-processed.
It is up to you to put the output somewhere.
|
inlineprotectedinherited |
Whether the whole-solve wall-clock budget has run out.
|
inlinestaticprotectedinherited |
The spectral condition number from a spectrum: largest over smallest singular value.
A singular-to-working-precision Jacobian (smallest singular value 0, or an empty list) yields +infinity, which compares correctly against any threshold.
| singular_values | The singular values, largest first (see EndpointSingularValues). |
|
inlineinherited |
|
inlineinherited |
|
inlineprotectedinherited |
Install a whole-path result (from PackFullPathResult) into the shared result arrays.
| r | The packed whole-path result to store. |
|
inlineinherited |
After dispatching paths, work out whether this solve was cut short, and say so.
A solve is stopped early if a stop was requested while it ran, which shows up two ways among the paths it was asked to run: one that was in flight came back ExternallyTerminated, and one not yet reached is still NeverStarted. Either is enough; both are counted, because "we abandoned four and never reached nine hundred" is a more useful thing to be told than "we stopped".
|
inlineinherited |
|
inline |
Whether the supplied system was over-determined and squared-up by randomization.
|
inlineinherited |
Was the last Solve() stopped before it finished?
True when somebody asked the process to stop (see bertini2/common/stop_request.hpp) while this solve was running. The results are then a PARTIAL set: paths in flight were abandoned and carry SuccessCode::ExternallyTerminated, paths not yet begun are still NeverStarted, and every count derived from them – how many solutions, how many at infinity – describes only what was tracked. Anything reporting on a solve must say so rather than present a partial count as a total.
|
inlineoverridevirtualinherited |
Write the finite solutions (Bertini 1.7 format) to out.
Implements bertini::algorithm::AnyZeroDim.
|
inlineoverridevirtualinherited |
Write the human-readable main-data report to out.
Implements bertini::algorithm::AnyZeroDim.
|
inlineoverridevirtualinherited |
Write the nonsingular solutions (Bertini 1.7 format) to out.
Implements bertini::algorithm::AnyZeroDim.
|
inlineoverridevirtualinherited |
Write the raw-data report to out.
Implements bertini::algorithm::AnyZeroDim.
|
inlineoverridevirtualinherited |
Write the raw solutions (Bertini 1.7 format) to out.
Implements bertini::algorithm::AnyZeroDim.
|
inlineoverridevirtualinherited |
Write the real finite solutions (Bertini 1.7 format) to out.
Implements bertini::algorithm::AnyZeroDim.
|
inlineoverridevirtualinherited |
Write the singular solutions (Bertini 1.7 format) to out.
Implements bertini::algorithm::AnyZeroDim.
|
inherited |
The held configuration objects, one per config type.
|
protectedinherited |
The endgame.
|
protectedinherited |
Reference to the caller-owned homotopy.
|
protectedinherited |
The midpath (path-crossing) checker.
|
protectedinherited |
populated by EGBoundaryAction; exposed via EndgameBoundaryMetadata()
|
protectedinherited |
Tolerance used when re-tracking paths flagged by the midpath check.
|
protectedinherited |
Paths the last Solve() never began, because it stopped.
|
protectedinherited |
Paths recalled from records in the last Solve().
|
protectedinherited |
Number of start points the start system produces.
|
protectedinherited |
observers used during tracking
Records the precision each path used, across all its tracks.
|
protectedinherited |
True while replaying recorded paths (suppresses re-emission).
|
protectedinherited |
The attached output directory (null = not recording).
|
protectedinherited |
This solve's run id in the records (ask hash prefix).
|
protectedinherited |
True when this ask's run header pre-existed (a re-ask: emit a recall event).
|
protectedinherited |
Identity of externally supplied start data (joins the ask); empty = starts derive from target+seed.
|
protectedinherited |
Per-path start provenance (point_ref/given_ref); empty = canonical start labels.
|
protectedinherited |
Final per-solution metadata.
|
protectedinherited |
computed data
Per-path state captured at the endgame boundary.
|
protectedinherited |
Solution points after the endgame (internal coordinates).
|
mutableprotectedinherited |
lazy cache for SolutionsUserCoords; serial post-solve access assumed
|
mutableprotectedinherited |
Whether the user-coordinate cache is up to date.
|
protectedinherited |
The whole-solve wall-clock deadline of the current Solve(), when one was asked for.
|
protectedinherited |
precision at which start points are computed; defaults to initial ambient precision (see PreSolveSetup)
|
protectedinherited |
Whether the start-point precision was set explicitly by the user.
|
protectedinherited |
Reference to the caller-owned start system.
|
protectedinherited |
True when the last Solve() was asked to stop partway.
|
protectedinherited |
Reference to the caller-owned target system.
|
protectedinherited |
function objects used during the algorithm
The path tracker.