Class PinSession¶
Defined in File schedule_pin.hpp
Class Documentation¶
-
class PinSession¶
Replays one RootRecord through sequant::optimize_result: hand it to the optimizer via OptimizeOptions::pinned. Every summand looks its record up by key; a miss is remembered (and the summand left unoptimized), and finish reports every miss, unused record and duplicate key at once. take and bind are thread-safe (summands are optimized in parallel).
Public Functions
-
explicit PinSession(eval::schedule::RootRecord const &root)¶
-
PinSession(PinSession const&) = delete¶
-
PinSession &operator=(PinSession const&) = delete¶
-
eval::schedule::TermRecord const *take(std::string const &key)¶
thread-safe; returns nullptr on a miss (recorded) and records a duplicate hit (a key taken more than once)
-
std::optional<std::size_t> document_position(std::string const &key) const¶
position of
keyin the document order, for callers assembling their own Sum
-
void finish() const¶
- Throws:
sequant::Exception – listing “missing: …”, “unused: …”, “duplicate: …” (all keys) if any key was missed, any record was not taken, or any key was taken twice (or occurs twice in the record)
- Post:
the session is finished: a session is single-use, and take and bind throw from now on (calling finish again is fine)
-
explicit PinSession(eval::schedule::RootRecord const &root)¶