CDT++ 1.0.0-rc3
Causal Dynamical Triangulations in C++
Loading...
Searching...
No Matches
Move_outcome.hpp File Reference

Structured Pachner-move failures and transition outcomes. More...

#include <cstdint>
#include <expected>
#include <string_view>
#include "Move_tracker.hpp"
Include dependency graph for Move_outcome.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cdt::ergodic_moves::MetropolisTransition
 Result of one fully sampled Metropolis-Hastings transition. More...
struct  cdt::ergodic_moves::MoveError
 Typed error returned by move preparation or private execution. More...

Namespaces

namespace  cdt
 clang-15 does not support std::format

Typedefs

template<typename ManifoldType>
using cdt::ergodic_moves::MoveResult = std::expected<ManifoldType, MoveError>
 Value returned by a fallible Pachner-move transformation.

Enumerations

enum class  cdt::ergodic_moves::MoveFailure : std::uint8_t {
  NO_CANDIDATE , INVALID_TOPOLOGY , CAUSAL_INVALIDITY , STALE_CANDIDATE ,
  EXECUTION_FAILURE , INVARIANT_VIOLATION , UNKNOWN_MOVE
}
 Actionable reasons a raw move request cannot produce a new state. More...
enum class  cdt::ergodic_moves::MoveOutcome : std::uint8_t {
  INAPPLICABLE = 0 , METROPOLIS_ACCEPTED = 1 , METROPOLIS_REJECTED = 2 , EXECUTION_FAILED = 3 ,
  SUCCEEDED = 4
}
 Typed state used to route proposal and execution accounting. More...

Functions

constexpr auto cdt::ergodic_moves::format_as (MoveError const error) noexcept -> std::string_view
 Enable direct formatting through fmt/spdlog.
constexpr auto cdt::ergodic_moves::outcome_from (MoveError const error) noexcept -> MoveOutcome
 Classify a structured move error for counter accounting.

Detailed Description

Structured Pachner-move failures and transition outcomes.

Definition in file Move_outcome.hpp.

Typedef Documentation

◆ MoveResult

template<typename ManifoldType>
using cdt::ergodic_moves::MoveResult = std::expected<ManifoldType, MoveError>

Value returned by a fallible Pachner-move transformation.

Definition at line 80 of file Move_outcome.hpp.

Enumeration Type Documentation

◆ MoveFailure

enum class cdt::ergodic_moves::MoveFailure : std::uint8_t
strong

Actionable reasons a raw move request cannot produce a new state.

Enumerator
NO_CANDIDATE 

No raw proposal site is available.

INVALID_TOPOLOGY 

The proposal site is not in the triangulation.

CAUSAL_INVALIDITY 

The proposal violates a causal move invariant.

STALE_CANDIDATE 

A prepared proposal no longer resolves.

EXECUTION_FAILURE 

CGAL rejected the prepared mutation.

INVARIANT_VIOLATION 

A post-mutation manifold check failed.

UNKNOWN_MOVE 

The requested move kind is unsupported.

Definition at line 22 of file Move_outcome.hpp.

◆ MoveOutcome

enum class cdt::ergodic_moves::MoveOutcome : std::uint8_t
strong

Typed state used to route proposal and execution accounting.

Enumerator
INAPPLICABLE 

The sampled raw site cannot support the move.

METROPOLIS_ACCEPTED 

Metropolis-Hastings accepted the proposal.

METROPOLIS_REJECTED 

Metropolis-Hastings rejected the proposal.

EXECUTION_FAILED 

Mutation failed after proposal preparation.

SUCCEEDED 

The requested transition completed.

Definition at line 83 of file Move_outcome.hpp.

Function Documentation

◆ format_as()

auto cdt::ergodic_moves::format_as ( MoveError const error) -> std::string_view
nodiscardconstexprnoexcept

Enable direct formatting through fmt/spdlog.

Parameters
errorStructured move failure.
Returns
Stable human-readable diagnostic text.

Definition at line 157 of file Move_outcome.hpp.

◆ outcome_from()

auto cdt::ergodic_moves::outcome_from ( MoveError const error) -> MoveOutcome
nodiscardconstexprnoexcept

Classify a structured move error for counter accounting.

Parameters
errorStructured move failure.
Returns
The counter outcome associated with error.

Definition at line 137 of file Move_outcome.hpp.

References CAUSAL_INVALIDITY, EXECUTION_FAILURE, INVALID_TOPOLOGY, INVARIANT_VIOLATION, NO_CANDIDATE, STALE_CANDIDATE, and UNKNOWN_MOVE.