|
Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
|
Restores the ambient session state a solve may perturb: "a solve leaves the session as it found it". More...
#include <zero_dim_solve.hpp>
Public Member Functions | |
| ScopedSessionState () | |
| Capture the ambient session state. | |
| ~ScopedSessionState () | |
| Restore it, whatever the solve did in between. | |
| ScopedSessionState (ScopedSessionState const &)=delete | |
| Non-copyable. | |
| ScopedSessionState & | operator= (ScopedSessionState const &)=delete |
| Non-assignable. | |
Public Attributes | |
| unsigned | precision_ |
| The ambient default precision at solve entry. | |
| std::mt19937 | engine_ |
| The calling thread's legacy engine state at entry. | |
| records::DrawStream | stream_ |
| The calling thread's pinned draw stream at entry. | |
Restores the ambient session state a solve may perturb: "a solve leaves the session as it found it".
Two globals otherwise leak: the mpfr default precision (an adaptive solve historically left it at the tracking precision – e.g. 16 after a double-fast-lane finish), and the calling thread's RNG streams (serial tracking rekeys them to per-path domains via ReseedThisThread). Either leak makes what a LATER solve computes – its config identity, its drawn coefficients – depend on whether THIS solve computed or recalled, which cascades into phantom new asks on rerun. Scoped restoration makes recall and compute indistinguishable to the rest of the session; the records the solve wrote are its only trace.
|
inline |
Capture the ambient session state.
|
inline |
Restore it, whatever the solve did in between.
|
delete |
Non-copyable.
|
delete |
Non-assignable.
| std::mt19937 bertini::algorithm::HomotopySolver< TrackerType, EndgameType, SystemType >::ScopedSessionState::engine_ |
The calling thread's legacy engine state at entry.
| unsigned bertini::algorithm::HomotopySolver< TrackerType, EndgameType, SystemType >::ScopedSessionState::precision_ |
The ambient default precision at solve entry.
| records::DrawStream bertini::algorithm::HomotopySolver< TrackerType, EndgameType, SystemType >::ScopedSessionState::stream_ |
The calling thread's pinned draw stream at entry.