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

Pachner moves on 2+1 dimensional foliated Delaunay triangulations. More...

#include <algorithm>
#include <array>
#include <bit>
#include <concepts>
#include <cstddef>
#include <expected>
#include <limits>
#include <optional>
#include <random>
#include <ranges>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
#include "Manifold.hpp"
#include "Move_outcome.hpp"
#include "Move_tracker.hpp"
Include dependency graph for Ergodic_moves_3.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

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

Typedefs

using cdt::ergodic_moves::Cell_container = std::vector<Cell_handle>
 Collection of three-dimensional cell handles.
using cdt::ergodic_moves::Cell_handle = Cell_handle_t<3>
 Three-dimensional CGAL cell handle.
using cdt::ergodic_moves::detail::Cell_points = std::array<Point_t<3>, 4>
using cdt::ergodic_moves::Delaunay = Delaunay_t<3>
 Three-dimensional Delaunay triangulation used by move implementations.
using cdt::ergodic_moves::Edge_container = std::vector<Edge_handle>
 Collection of three-dimensional edge descriptors.
using cdt::ergodic_moves::Edge_handle = Edge_handle_t<3>
 Three-dimensional CGAL edge descriptor.
using cdt::ergodic_moves::detail::Edge_points = std::array<Point_t<3>, 2>
using cdt::ergodic_moves::detail::Execution = std::expected<void, MoveError>
using cdt::ergodic_moves::Expected = MoveResult<Manifold>
 Fallible manifold transformation returned by public move functions.
using cdt::ergodic_moves::Manifold = manifolds::Manifold_3
 Three-dimensional spherical CDT manifold operated on by this move set.
using cdt::ergodic_moves::Vertex_container = std::vector<Vertex_handle>
 Collection of three-dimensional vertex handles.
using cdt::ergodic_moves::Vertex_handle = Vertex_handle_t<3>
 Three-dimensional CGAL vertex handle.

Functions

auto cdt::ergodic_moves::detail::accept_post_mutation (Delaunay const &triangulation) noexcept -> bool
 Default validator for internal post-mutation test seams.
auto cdt::ergodic_moves::detail::bistellar_flip (Delaunay const &source_triangulation, Edge_handle source_edge, Vertex_handle source_top, Vertex_handle source_bottom) -> std::optional< Delaunay >
 Perform a bistellar flip on triangulation via the given edge.
template<typename Post_mutation_validator>
auto cdt::ergodic_moves::detail::bistellar_flip_impl (Delaunay const &source_triangulation, Edge_handle const source_edge, Vertex_handle const source_top, Vertex_handle const source_bottom, Post_mutation_validator post_mutation_validator) -> std::optional< Delaunay >
auto cdt::ergodic_moves::detail::canonical_cell_points (Cell_handle const &cell) -> std::array< Point_t< 3 >, 4 >
auto cdt::ergodic_moves::detail::canonical_edge_descriptor (Delaunay const &triangulation, Edge_handle const &edge) -> std::optional< Edge_handle >
 Rebind an edge to its canonical finite incident cell.
auto cdt::ergodic_moves::detail::canonical_edge_points (Edge_handle const &edge) -> std::array< Point_t< 3 >, 2 >
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::detail::canonical_random_element (Cell_container &cells, Generator &generator) -> std::optional< Cell_handle >
template<typename Container, std::uniform_random_bit_generator Generator, typename Comparator>
auto cdt::ergodic_moves::detail::canonical_random_element (Container &candidates, Generator &generator, Comparator comparator) -> std::optional< typename Container::value_type >
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::detail::canonical_random_element (Edge_container &edges, Generator &generator) -> std::optional< Edge_handle >
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::detail::canonical_random_element (Vertex_container &vertices, Generator &generator) -> std::optional< Vertex_handle >
void cdt::ergodic_moves::detail::canonicalize (Cell_container &cells)
void cdt::ergodic_moves::detail::canonicalize (Edge_container &edges)
void cdt::ergodic_moves::detail::canonicalize (Vertex_container &vertices)
auto cdt::ergodic_moves::detail::cell_precedes (Cell_handle const &left, Cell_handle const &right) -> bool
auto cdt::ergodic_moves::detail::check_move (Manifold const &before, Manifold const &after, move_tracker::MoveType const &move) -> bool
 Check tracked move deltas and essential CDT manifold invariants.
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::do_23_move (Manifold const &t_manifold, Generator &generator) -> Expected
 Perform a (2,3) move.
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::do_26_move (Manifold const &t_manifold, Generator &generator) -> Expected
 Perform a (2,6) move.
template<std::uniform_random_bit_generator Generator, typename Post_mutation_validator>
auto cdt::ergodic_moves::detail::do_26_move_impl (Manifold const &t_manifold, Generator &generator, bool const only_first_site, Post_mutation_validator post_mutation_validator) -> Expected
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::do_32_move (Manifold const &t_manifold, Generator &generator) -> Expected
 Perform a (3,2) move.
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::do_44_move (Manifold const &t_manifold, Generator &generator) -> Expected
 Perform a (4,4) move.
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::do_62_move (Manifold const &t_manifold, Generator &generator) -> Expected
 Perform a (6,2) move.
auto cdt::ergodic_moves::detail::edge_precedes (Edge_handle const &left, Edge_handle const &right) -> bool
auto cdt::ergodic_moves::detail::execute (Delaunay &triangulation, ApplicableThreeTwoMove const &move) -> Execution
 Consume a prepared (3,2) value at the checked CGAL flip boundary.
template<typename Post_mutation_validator>
auto cdt::ergodic_moves::detail::execute (Delaunay &triangulation, ApplicableTwoSixMove const &move, Post_mutation_validator post_mutation_validator) -> Execution
 Consume a prepared (2,6) value on an unobservable candidate.
auto cdt::ergodic_moves::detail::execute (Delaunay &triangulation, ApplicableTwoThreeMove const &move) -> Execution
 Consume a prepared (2,3) value at the mutation boundary.
template<typename Post_mutation_validator>
auto cdt::ergodic_moves::detail::execute (Delaunay const &source_triangulation, ApplicableFourFourMove const &move, Post_mutation_validator post_mutation_validator) -> std::expected< Delaunay, MoveError >
 Consume a prepared (4,4) value on a private triangulation copy.
template<std::uniform_random_bit_generator Generator, typename Post_mutation_validator>
auto cdt::ergodic_moves::detail::execute (Delaunay const &source_triangulation, ApplicableSixTwoMove const &move, Generator &generator, Post_mutation_validator post_mutation_validator) -> std::expected< Delaunay, MoveError >
 Consume a prepared (6,2) value on a private triangulation copy.
auto cdt::ergodic_moves::detail::find_adjacent_31_cell (Cell_handle const &cell) -> std::optional< int >
 Find a (2,6) move location.
auto cdt::ergodic_moves::detail::find_bistellar_flip_location (Delaunay const &triangulation, Edge_handle const &candidate) -> std::optional< Cell_container >
 Find a bistellar flip location.
auto cdt::ergodic_moves::detail::find_pivot_edge (Delaunay const &triangulation, Edge_container const &edges) -> std::optional< Edge_handle >
auto cdt::ergodic_moves::detail::finite_incident_cells (Delaunay const &triangulation, Edge_handle const &edge) -> std::optional< Cell_container >
 Collect the finite cells incident to a checked edge.
auto cdt::ergodic_moves::detail::get_vertices (Cell_container const &cells) -> Vertex_container
 Return a container of all vertices in a container of cells.
auto cdt::ergodic_moves::detail::incident_cells_from_edge (Delaunay const &triangulation, Edge_handle const &edge) -> std::optional< Cell_container >
 Find all cells incident to the edge.
auto cdt::ergodic_moves::detail::is_32_movable (Delaunay const &triangulation, Edge_handle const &candidate) -> bool
 Check for the causal cavity inverse to a (2,3) move.
auto cdt::ergodic_moves::detail::is_62_movable (Delaunay const &triangulation, Vertex_handle const &candidate) -> bool
 Find a (6,2) move location.
auto cdt::ergodic_moves::detail::is_well_formed_edge (Edge_handle const &edge) noexcept -> bool
 Check an edge handle without dereferencing its cell handle.
auto cdt::ergodic_moves::detail::make_manifold (Delaunay triangulation, Manifold const &source) -> Manifold
 Rebuild all derived topology and geometry state around a value.
constexpr auto cdt::ergodic_moves::detail::move_error (MoveFailure const reason, move_tracker::MoveType const move) noexcept -> std::unexpected< MoveError >
auto cdt::ergodic_moves::null_move (Manifold const &t_manifold) -> Expected
 Perform a null move.
auto cdt::ergodic_moves::detail::point_less (Point_t< 3 > const &left, Point_t< 3 > const &right) -> bool
auto cdt::ergodic_moves::detail::prepare_bistellar_flip (Delaunay const &triangulation, Edge_handle const &candidate, Vertex_handle const &top, Vertex_handle const &bottom) -> std::expected< ApplicableFourFourMove, MoveError >
 Prepare the generic topological seam used by bistellar_flip().
auto cdt::ergodic_moves::detail::prepare_four_four (Delaunay const &triangulation, Edge_handle const &candidate) -> std::expected< ApplicableFourFourMove, MoveError >
 Parse a raw spacelike edge into an applicable (4,4) move.
auto cdt::ergodic_moves::detail::prepare_six_two (Delaunay const &triangulation, Vertex_handle const &candidate) -> std::expected< ApplicableSixTwoMove, MoveError >
 Parse a raw vertex into an applicable causal (6,2) move.
auto cdt::ergodic_moves::detail::prepare_three_two (Delaunay const &triangulation, Edge_handle const &candidate) -> std::expected< ApplicableThreeTwoMove, MoveError >
 Parse a raw edge into an applicable causal (3,2) move.
auto cdt::ergodic_moves::detail::prepare_two_six (Delaunay const &triangulation, Cell_handle const &candidate) -> std::expected< ApplicableTwoSixMove, MoveError >
 Parse a raw (1,3) cell into an applicable (2,6) move.
auto cdt::ergodic_moves::detail::prepare_two_three (Delaunay const &triangulation, Cell_handle const &candidate) -> std::expected< ApplicableTwoThreeMove, MoveError >
 Parse a raw (2,2) cell into an applicable causal (2,3) move.
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::propose_23_move (Manifold const &t_manifold, Generator &generator) -> Expected
 Propose one (2,3) site for Metropolis-Hastings.
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::propose_26_move (Manifold const &t_manifold, Generator &generator) -> Expected
 Propose a uniformly selected (2,6) site.
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::propose_32_move (Manifold const &t_manifold, Generator &generator) -> Expected
 Propose one (3,2) site for Metropolis-Hastings.
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::propose_44_move (Manifold const &t_manifold, Generator &generator) -> Expected
 Propose one spacelike edge as a (4,4) site.
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::propose_62_move (Manifold const &t_manifold, Generator &generator) -> Expected
 Propose one vertex as a (6,2) site for Metropolis-Hastings.
template<typename Container, std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::detail::random_element (Container const &candidates, Generator &generator) -> std::optional< typename Container::value_type >
 Select exactly one raw proposal site uniformly in container order.
auto cdt::ergodic_moves::detail::resolve_cell (Delaunay const &triangulation, Cell_points const &points) -> std::optional< Cell_handle >
auto cdt::ergodic_moves::detail::resolve_edge (Delaunay const &triangulation, Edge_points const &points) -> std::optional< Edge_handle >
auto cdt::ergodic_moves::detail::resolve_vertex (Delaunay const &triangulation, Point_t< 3 > const &point) -> std::optional< Vertex_handle >
auto cdt::ergodic_moves::detail::same_configuration_value (double const first, double const second) noexcept -> bool
 Compare preserved floating-point configuration state exactly.
auto cdt::ergodic_moves::detail::try_23_move (Delaunay &triangulation, Cell_handle const &to_be_moved) -> bool
 Compatibility seam that prepares and immediately executes (2,3).
auto cdt::ergodic_moves::detail::try_32_move (Delaunay &triangulation, Edge_handle const &to_be_moved) -> bool
 Compatibility seam that prepares and immediately executes (3,2).
template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::detail::try_62_move (Delaunay const &source_triangulation, Vertex_handle const source_candidate, Generator &generator) -> std::optional< Delaunay >
 Apply the combinatorial (6,2) retriangulation on a private copy.
template<std::uniform_random_bit_generator Generator, typename Post_mutation_validator>
auto cdt::ergodic_moves::detail::try_62_move_impl (Delaunay const &source_triangulation, Vertex_handle const source_candidate, Generator &generator, Post_mutation_validator post_mutation_validator) -> std::optional< Delaunay >
auto cdt::ergodic_moves::detail::vertex_precedes (Vertex_handle const &left, Vertex_handle const &right) -> bool

Detailed Description

Pachner moves on 2+1 dimensional foliated Delaunay triangulations.

Author
Adam Getchell

Pachner moves operate on the level of the Manifold_3. The helper functions for the moves operate on the level of the Delaunay_Triangulation_3. C++23 support is required for std::expected.

See also
Pachner moves
Three-dimensional CDT move set
2+1D CDT ergodic move audit

Definition in file Ergodic_moves_3.hpp.

Typedef Documentation

◆ Cell_container

using cdt::ergodic_moves::Cell_container = std::vector<Cell_handle>

Collection of three-dimensional cell handles.

Definition at line 50 of file Ergodic_moves_3.hpp.

◆ Cell_handle

using cdt::ergodic_moves::Cell_handle = Cell_handle_t<3>

Three-dimensional CGAL cell handle.

Definition at line 48 of file Ergodic_moves_3.hpp.

◆ Cell_points

using cdt::ergodic_moves::detail::Cell_points = std::array<Point_t<3>, 4>

Definition at line 64 of file Ergodic_moves_3.hpp.

◆ Delaunay

using cdt::ergodic_moves::Delaunay = Delaunay_t<3>

Three-dimensional Delaunay triangulation used by move implementations.

Definition at line 60 of file Ergodic_moves_3.hpp.

◆ Edge_container

using cdt::ergodic_moves::Edge_container = std::vector<Edge_handle>

Collection of three-dimensional edge descriptors.

Definition at line 54 of file Ergodic_moves_3.hpp.

◆ Edge_handle

using cdt::ergodic_moves::Edge_handle = Edge_handle_t<3>

Three-dimensional CGAL edge descriptor.

Definition at line 52 of file Ergodic_moves_3.hpp.

◆ Edge_points

using cdt::ergodic_moves::detail::Edge_points = std::array<Point_t<3>, 2>

Definition at line 65 of file Ergodic_moves_3.hpp.

◆ Execution

using cdt::ergodic_moves::detail::Execution = std::expected<void, MoveError>

Definition at line 66 of file Ergodic_moves_3.hpp.

◆ Expected

using cdt::ergodic_moves::Expected = MoveResult<Manifold>

Fallible manifold transformation returned by public move functions.

Definition at line 46 of file Ergodic_moves_3.hpp.

◆ Manifold

using cdt::ergodic_moves::Manifold = manifolds::Manifold_3

Three-dimensional spherical CDT manifold operated on by this move set.

Definition at line 44 of file Ergodic_moves_3.hpp.

◆ Vertex_container

using cdt::ergodic_moves::Vertex_container = std::vector<Vertex_handle>

Collection of three-dimensional vertex handles.

Definition at line 58 of file Ergodic_moves_3.hpp.

◆ Vertex_handle

using cdt::ergodic_moves::Vertex_handle = Vertex_handle_t<3>

Three-dimensional CGAL vertex handle.

Definition at line 56 of file Ergodic_moves_3.hpp.

Function Documentation

◆ accept_post_mutation()

auto cdt::ergodic_moves::detail::accept_post_mutation ( Delaunay const & triangulation) -> bool
inlinenodiscardnoexcept

Default validator for internal post-mutation test seams.

Definition at line 195 of file Ergodic_moves_3.hpp.

◆ bistellar_flip()

auto cdt::ergodic_moves::detail::bistellar_flip ( Delaunay const & source_triangulation,
Edge_handle source_edge,
Vertex_handle source_top,
Vertex_handle source_bottom ) -> std::optional< Delaunay >
inlinenodiscard

Perform a bistellar flip on triangulation via the given edge.

Pass by value to avoid modifying the original triangulation in the event that the flip is unsuccessful.

Parameters
source_triangulationThe triangulation to flip
source_edgeThe edge to pivot on
source_topTop vertex of the cells being flipped
source_bottomBottom vertex of the cells being flipped
Returns
A flipped triangulation or nullopt
See also
Pachner moves

Definition at line 1756 of file Ergodic_moves_3.hpp.

◆ bistellar_flip_impl()

template<typename Post_mutation_validator>
auto cdt::ergodic_moves::detail::bistellar_flip_impl ( Delaunay const & source_triangulation,
Edge_handle const source_edge,
Vertex_handle const source_top,
Vertex_handle const source_bottom,
Post_mutation_validator post_mutation_validator ) -> std::optional< Delaunay >
inlinenodiscard

Definition at line 1732 of file Ergodic_moves_3.hpp.

◆ canonical_cell_points()

auto cdt::ergodic_moves::detail::canonical_cell_points ( Cell_handle const & cell) -> std::array< Point_t< 3 >, 4 >
inlinenodiscard

Definition at line 252 of file Ergodic_moves_3.hpp.

◆ canonical_edge_descriptor()

auto cdt::ergodic_moves::detail::canonical_edge_descriptor ( Delaunay const & triangulation,
Edge_handle const & edge ) -> std::optional< Edge_handle >
inlinenodiscard

Rebind an edge to its canonical finite incident cell.

CGAL permits any incident cell to own an edge descriptor, but checked flips can observe that representative. Choosing by canonical cell points makes equivalent in-memory and reloaded triangulations use the same mutation boundary.

Definition at line 355 of file Ergodic_moves_3.hpp.

◆ canonical_edge_points()

auto cdt::ergodic_moves::detail::canonical_edge_points ( Edge_handle const & edge) -> std::array< Point_t< 3 >, 2 >
inlinenodiscard

Definition at line 261 of file Ergodic_moves_3.hpp.

◆ canonical_random_element() [1/4]

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::detail::canonical_random_element ( Cell_container & cells,
Generator & generator ) -> std::optional< Cell_handle >
inlinenodiscard

Definition at line 417 of file Ergodic_moves_3.hpp.

◆ canonical_random_element() [2/4]

template<typename Container, std::uniform_random_bit_generator Generator, typename Comparator>
auto cdt::ergodic_moves::detail::canonical_random_element ( Container & candidates,
Generator & generator,
Comparator comparator ) -> std::optional< typename Container::value_type >
inlinenodiscard

Select the same canonical rank as sorting followed by indexed selection, without sorting the complete proposal domain.

Definition at line 401 of file Ergodic_moves_3.hpp.

◆ canonical_random_element() [3/4]

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::detail::canonical_random_element ( Edge_container & edges,
Generator & generator ) -> std::optional< Edge_handle >
inlinenodiscard

Definition at line 423 of file Ergodic_moves_3.hpp.

◆ canonical_random_element() [4/4]

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::detail::canonical_random_element ( Vertex_container & vertices,
Generator & generator ) -> std::optional< Vertex_handle >
inlinenodiscard

Definition at line 429 of file Ergodic_moves_3.hpp.

◆ canonicalize() [1/3]

void cdt::ergodic_moves::detail::canonicalize ( Cell_container & cells)
inline

Definition at line 337 of file Ergodic_moves_3.hpp.

◆ canonicalize() [2/3]

void cdt::ergodic_moves::detail::canonicalize ( Edge_container & edges)
inline

Definition at line 340 of file Ergodic_moves_3.hpp.

◆ canonicalize() [3/3]

void cdt::ergodic_moves::detail::canonicalize ( Vertex_container & vertices)
inline

Definition at line 343 of file Ergodic_moves_3.hpp.

◆ cell_precedes()

auto cdt::ergodic_moves::detail::cell_precedes ( Cell_handle const & left,
Cell_handle const & right ) -> bool
inlinenodiscard

Definition at line 319 of file Ergodic_moves_3.hpp.

◆ check_move()

auto cdt::ergodic_moves::detail::check_move ( Manifold const & t_before,
Manifold const & t_after,
move_tracker::MoveType const & t_move ) -> bool
inlinenodiscard

Check tracked move deltas and essential CDT manifold invariants.

This verifies structural cache counts, causal foliation, cell metadata, TDS validity, geometry deltas, time bounds, and preserved foliation parameters without rebuilding derived caches. It does not require Euclidean Delaunayhood.

Parameters
t_beforeThe manifold before the move
t_afterThe manifold after the move
t_moveThe type of move
Returns
True if the move correctly changed the triangulation

Definition at line 1903 of file Ergodic_moves_3.hpp.

◆ do_23_move()

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::do_23_move ( Manifold const & t_manifold,
Generator & generator ) -> Expected
inlinenodiscard

Perform a (2,3) move.

A (2,3) move "flips" a timelike face into a timelike edge. This adds a (2,2) simplex and a timelike edge.

This function calls try_23_move on (2,2) simplices drawn from a randomly shuffled container until it succeeds or runs out of simplices.

The move guarantees a valid causal combinatorial triangulation. It does not preserve or require the empty-sphere property of the coordinates.

Template Parameters
GeneratorA uniform random bit generator type
Parameters
t_manifoldThe simplicial manifold
generatorCaller-owned generator whose state advances during the move
Returns
The Expected (2,3) moved manifold or an Unexpected
Note
The source manifold is unchanged on success and failure.

Definition at line 674 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::collect_cells(), cdt::foliated_triangulations::filter_cells(), and cdt::TWO_TWO.

◆ do_26_move()

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::do_26_move ( Manifold const & t_manifold,
Generator & generator ) -> Expected
inlinenodiscard

Perform a (2,6) move.

A (2,6) move inserts a vertex into the spacelike face between a (1,3) simplex on the bottom connected to a (3,1) simplex on top. This adds 2 (1,3) simplices and 2 (3,1) simplices. It adds 2 spacelike faces and 6 timelike faces. It also adds 2 timelike edges and 3 spacelike edges, as well as the vertex. This function calls find_adjacent_31_cell on (1,3) simplices drawn from a randomly shuffled container until it succeeds or runs out of simplices. The move guarantees a valid causal combinatorial triangulation. It does not preserve or require the empty-sphere property of the coordinates.

Template Parameters
GeneratorA uniform random bit generator type
Parameters
t_manifoldThe simplicial manifold
generatorCaller-owned generator whose state advances during the move
Returns
The Expected (2,6) moved manifold or an Unexpected
Note
The source manifold is unchanged on success and failure.

Definition at line 1152 of file Ergodic_moves_3.hpp.

◆ do_26_move_impl()

template<std::uniform_random_bit_generator Generator, typename Post_mutation_validator>
auto cdt::ergodic_moves::detail::do_26_move_impl ( Manifold const & t_manifold,
Generator & generator,
bool const only_first_site,
Post_mutation_validator post_mutation_validator ) -> Expected
inlinenodiscard

Definition at line 1079 of file Ergodic_moves_3.hpp.

◆ do_32_move()

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::do_32_move ( Manifold const & t_manifold,
Generator & generator ) -> Expected
inlinenodiscard

Perform a (3,2) move.

A (3,2) move "flips" a timelike edge into a timelike face. This removes a (2,2) simplex and the timelike edge. This function calls try_32_move on timelike edges drawn from a randomly shuffled container until it succeeds or runs out of edges. The move guarantees a valid causal combinatorial triangulation. It does not preserve or require the empty-sphere property of the coordinates.

Template Parameters
GeneratorA uniform random bit generator type
Parameters
t_manifoldThe simplicial manifold
generatorCaller-owned generator whose state advances during the move
Returns
The Expected (3,2) moved manifold or an Unexpected
Note
The source manifold is unchanged on success and failure.

Definition at line 843 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::collect_edges(), cdt::foliated_triangulations::filter_edges(), and cdt::TIMELIKE.

◆ do_44_move()

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::do_44_move ( Manifold const & t_manifold,
Generator & generator ) -> Expected
inlinenodiscard

Perform a (4,4) move.

This is a bistellar flip pivoting the internal spacelike edge between the two spacelike faces. A (4,4) move flips an edge which has exactly 4 incident cells. In CDT specifically, the edge is spacelike and the 4 incident cells are a pair of (1,3) simplices and a pair of (3,1) simplices. It thus re-labels each of the 4 cells in the complex, but doesn't actually change the number of cells, vertices, or edges. This move has the effect of mixing up the simplices, thus possibly creating different potential moves in different locations.

This function calls is_44_movable() on a randomly shuffled container of edges until it succeeds or runs out of edges.

If successful, the triangulation remains combinatorially valid. A CDT move is not required to preserve the Euclidean Delaunay property of the coordinates used to represent the abstract triangulation.

Template Parameters
GeneratorA uniform random bit generator type
Parameters
t_manifoldThe simplicial manifold
generatorCaller-owned generator whose state advances during the move
Returns
The Expected (4,4) moved manifold or Unexpected
Note
The source manifold is unchanged on success and failure.

Definition at line 1822 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::collect_edges(), cdt::foliated_triangulations::filter_edges(), and cdt::SPACELIKE.

◆ do_62_move()

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::do_62_move ( Manifold const & t_manifold,
Generator & generator ) -> Expected
inlinenodiscard

Perform a (6,2) move.

This function performs a (6,2) move on the given manifold. A (6,2) move removes a vertex which has 3 incident (3,1) simplices and 3 (1,3) simplices for a total of 6 incident simplices exactly. This converts the 3 (1,3) simplices into a single (1,3) simplex on the bottom and the 3 (3,1) simplices into a single (3,1) simplex on top. It thus removes 2 (1,3) simplices, 2 (3,1) simplices, 2 spacelike faces, 6 timelike faces, 3 spacelike edges, 2 timelike edges, and a single vertex.

This function calls is_62_movable() on a randomly shuffled container of vertices until it succeeds or runs out of vertices.

The move guarantees a valid causal combinatorial triangulation. It does not preserve or require the empty-sphere property of the coordinates.

Template Parameters
GeneratorA uniform random bit generator type
Parameters
t_manifoldThe simplicial manifold
generatorCaller-owned generator whose state advances during the move
Returns
The Expected (6,2) moved manifold or Unexpected
Note
The source manifold is unchanged on success and failure.

Definition at line 1404 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::collect_vertices().

◆ edge_precedes()

auto cdt::ergodic_moves::detail::edge_precedes ( Edge_handle const & left,
Edge_handle const & right ) -> bool
inlinenodiscard

Definition at line 328 of file Ergodic_moves_3.hpp.

◆ execute() [1/5]

auto cdt::ergodic_moves::detail::execute ( Delaunay & triangulation,
ApplicableThreeTwoMove const & move ) -> Execution
inlinenodiscard

Consume a prepared (3,2) value at the checked CGAL flip boundary.

Definition at line 803 of file Ergodic_moves_3.hpp.

◆ execute() [2/5]

template<typename Post_mutation_validator>
auto cdt::ergodic_moves::detail::execute ( Delaunay & triangulation,
ApplicableTwoSixMove const & move,
Post_mutation_validator post_mutation_validator ) -> Execution
inlinenodiscard

Consume a prepared (2,6) value on an unobservable candidate.

Local mutation is deliberate. Any postcondition failure discards the private triangulation at the high-level value boundary.

Definition at line 993 of file Ergodic_moves_3.hpp.

◆ execute() [3/5]

auto cdt::ergodic_moves::detail::execute ( Delaunay & triangulation,
ApplicableTwoThreeMove const & move ) -> Execution
inlinenodiscard

Consume a prepared (2,3) value at the mutation boundary.

Only point-to-handle resolution is repeated. CDT applicability is carried by the input type; CGAL remains responsible for its checked geometric flip. A successful flip invalidates affected cell handles, none of which are stored in the applicable value.

Definition at line 615 of file Ergodic_moves_3.hpp.

◆ execute() [4/5]

template<typename Post_mutation_validator>
auto cdt::ergodic_moves::detail::execute ( Delaunay const & source_triangulation,
ApplicableFourFourMove const & move,
Post_mutation_validator post_mutation_validator ) -> std::expected< Delaunay, MoveError >
inlinenodiscard

Consume a prepared (4,4) value on a private triangulation copy.

Definition at line 1640 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::expected_cell_type().

◆ execute() [5/5]

template<std::uniform_random_bit_generator Generator, typename Post_mutation_validator>
auto cdt::ergodic_moves::detail::execute ( Delaunay const & source_triangulation,
ApplicableSixTwoMove const & move,
Generator & generator,
Post_mutation_validator post_mutation_validator ) -> std::expected< Delaunay, MoveError >
inlinenodiscard

Consume a prepared (6,2) value on a private triangulation copy.

Definition at line 1274 of file Ergodic_moves_3.hpp.

References cdt::ACAUSAL, cdt::foliated_triangulations::expected_cell_type(), cdt::foliated_triangulations::find_vertex(), and cdt::UNCLASSIFIED.

◆ find_adjacent_31_cell()

auto cdt::ergodic_moves::detail::find_adjacent_31_cell ( Cell_handle const & t_cell) -> std::optional< int >
inlinenodiscard

Find a (2,6) move location.

This function checks to see if a (2,6) move is possible. Starting with a (1,3) simplex, it checks neighbors for a (3,1) simplex.

Parameters
t_cellThe (1,3) simplex that is checked
Returns
The integer of the neighboring (3,1) simplex or nullopt

Definition at line 914 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::expected_cell_type(), cdt::foliated_triangulations::is_cell_type_correct(), cdt::ONE_THREE, and cdt::THREE_ONE.

◆ find_bistellar_flip_location()

auto cdt::ergodic_moves::detail::find_bistellar_flip_location ( Delaunay const & triangulation,
Edge_handle const & t_edge_candidate ) -> std::optional< Cell_container >
inlinenodiscard

Find a bistellar flip location.

This function checks to see if a bistellar flip is possible. Starting with an edge, it checks all incident cells. There must be 4 incident cells; 2 should be (3,1) simplices, 2 should be (1,3) simplices, and there should be no (2,2) simplices.

Parameters
triangulationThe simplicial manifold
t_edge_candidateThe edge to check
Returns
A container of incident cells if there are exactly 4 or nullopt

Definition at line 1488 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::expected_cell_type(), cdt::foliated_triangulations::is_cell_type_correct(), cdt::ONE_THREE, and cdt::THREE_ONE.

◆ find_pivot_edge()

auto cdt::ergodic_moves::detail::find_pivot_edge ( Delaunay const & triangulation,
Edge_container const & edges ) -> std::optional< Edge_handle >
inlinenodiscard
Returns
The center edge of a 4-cell complex

Definition at line 1767 of file Ergodic_moves_3.hpp.

◆ finite_incident_cells()

auto cdt::ergodic_moves::detail::finite_incident_cells ( Delaunay const & triangulation,
Edge_handle const & edge ) -> std::optional< Cell_container >
inlinenodiscard

Collect the finite cells incident to a checked edge.

The returned handles borrow from triangulation and remain valid only until an affected-cell mutation is performed.

Definition at line 227 of file Ergodic_moves_3.hpp.

◆ get_vertices()

auto cdt::ergodic_moves::detail::get_vertices ( Cell_container const & cells) -> Vertex_container
inlinenodiscard

Return a container of all vertices in a container of cells.

Parameters
cellsThe cells to find the vertices of.
Returns
A container of vertices in the cells

Definition at line 1785 of file Ergodic_moves_3.hpp.

◆ incident_cells_from_edge()

auto cdt::ergodic_moves::detail::incident_cells_from_edge ( Delaunay const & triangulation,
Edge_handle const & edge ) -> std::optional< Cell_container >
inlinenodiscard

Find all cells incident to the edge.

Parameters
triangulationThe Delaunay triangulation
edgeThe edge
Returns
A container of cells incident to the edge or nullopt
See also
https://github.com/CGAL/cgal/blob/8430d04539179f25fb8e716f99e19d28589beeda/TDS_3/include/CGAL/Triangulation_data_structure_3.h#L2094

Definition at line 1473 of file Ergodic_moves_3.hpp.

◆ is_32_movable()

auto cdt::ergodic_moves::detail::is_32_movable ( Delaunay const & triangulation,
Edge_handle const & candidate ) -> bool
inlinenodiscard

◆ is_62_movable()

auto cdt::ergodic_moves::detail::is_62_movable ( Delaunay const & triangulation,
Vertex_handle const & candidate ) -> bool
inlinenodiscard

Find a (6,2) move location.

This function checks to see if a (6,2) move is possible. Starting with a vertex, it checks all incident cells. There must be 6 incident cells; 3 should be (3,1) simplices, 3 should be (1,3) simplices, and there should be no (2,2) simplices.

Parameters
triangulationThe triangulation containing the candidate
candidateThe vertex to check
Returns
True if (6,2) move is possible

Definition at line 1183 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::expected_cell_type(), cdt::foliated_triangulations::is_cell_type_correct(), cdt::ONE_THREE, cdt::THREE_ONE, and cdt::TWO_TWO.

◆ is_well_formed_edge()

auto cdt::ergodic_moves::detail::is_well_formed_edge ( Edge_handle const & edge) -> bool
inlinenodiscardnoexcept

Check an edge handle without dereferencing its cell handle.

A tetrahedral cell has four local vertex indices in [0, 4).

Definition at line 212 of file Ergodic_moves_3.hpp.

◆ make_manifold()

auto cdt::ergodic_moves::detail::make_manifold ( Delaunay triangulation,
Manifold const & source ) -> Manifold
inlinenodiscard

Rebuild all derived topology and geometry state around a value.

Definition at line 200 of file Ergodic_moves_3.hpp.

◆ move_error()

auto cdt::ergodic_moves::detail::move_error ( MoveFailure const reason,
move_tracker::MoveType const move ) -> std::unexpected< MoveError >
nodiscardconstexprnoexcept

Definition at line 174 of file Ergodic_moves_3.hpp.

◆ null_move()

auto cdt::ergodic_moves::null_move ( Manifold const & t_manifold) -> Expected
inlinenodiscard

Perform a null move.

Parameters
t_manifoldThe simplicial manifold
Returns
The null-moved manifold

Definition at line 545 of file Ergodic_moves_3.hpp.

◆ point_less()

auto cdt::ergodic_moves::detail::point_less ( Point_t< 3 > const & left,
Point_t< 3 > const & right ) -> bool
inlinenodiscard

Definition at line 248 of file Ergodic_moves_3.hpp.

◆ prepare_bistellar_flip()

auto cdt::ergodic_moves::detail::prepare_bistellar_flip ( Delaunay const & triangulation,
Edge_handle const & candidate,
Vertex_handle const & top,
Vertex_handle const & bottom ) -> std::expected< ApplicableFourFourMove, MoveError >
inlinenodiscard

Prepare the generic topological seam used by bistellar_flip().

Unlike prepare_four_four(), this internal compatibility boundary proves only the CGAL four-cell diamond and caller-supplied boundary vertices. High-level CDT moves must use the stronger causal preparation.

Definition at line 1581 of file Ergodic_moves_3.hpp.

◆ prepare_four_four()

auto cdt::ergodic_moves::detail::prepare_four_four ( Delaunay const & triangulation,
Edge_handle const & candidate ) -> std::expected< ApplicableFourFourMove, MoveError >
inlinenodiscard

Parse a raw spacelike edge into an applicable (4,4) move.

Success proves the finite four-cell causal diamond and identifies its distinct top and bottom vertices without retaining CGAL handles.

Definition at line 1520 of file Ergodic_moves_3.hpp.

◆ prepare_six_two()

auto cdt::ergodic_moves::detail::prepare_six_two ( Delaunay const & triangulation,
Vertex_handle const & candidate ) -> std::expected< ApplicableSixTwoMove, MoveError >
inlinenodiscard

Parse a raw vertex into an applicable causal (6,2) move.

Success proves degree five, six finite incident cells, and the exact three-(3,1)/three-(1,3) causal composition with correct metadata.

Definition at line 1239 of file Ergodic_moves_3.hpp.

◆ prepare_three_two()

auto cdt::ergodic_moves::detail::prepare_three_two ( Delaunay const & triangulation,
Edge_handle const & candidate ) -> std::expected< ApplicableThreeTwoMove, MoveError >
inlinenodiscard

Parse a raw edge into an applicable causal (3,2) move.

Success proves a finite timelike degree-three cavity containing exactly two (2,2) cells and one consistently oriented (3,1) or (1,3) cell.

Definition at line 784 of file Ergodic_moves_3.hpp.

◆ prepare_two_six()

auto cdt::ergodic_moves::detail::prepare_two_six ( Delaunay const & triangulation,
Cell_handle const & candidate ) -> std::expected< ApplicableTwoSixMove, MoveError >
inlinenodiscard

Parse a raw (1,3) cell into an applicable (2,6) move.

Success proves a correctly labelled adjacent (3,1) cell and a common spacelike facet whose three vertices share one time value.

Definition at line 951 of file Ergodic_moves_3.hpp.

◆ prepare_two_three()

auto cdt::ergodic_moves::detail::prepare_two_three ( Delaunay const & triangulation,
Cell_handle const & candidate ) -> std::expected< ApplicableTwoThreeMove, MoveError >
inlinenodiscard

Parse a raw (2,2) cell into an applicable causal (2,3) move.

Success proves that the selected finite cell has correct metadata, has a correctly classified (3,1) or (1,3) neighbor, and that the two vertices opposite their shared facet span adjacent slices. The returned value owns only stable point locators and must be executed against the same unmodified triangulation.

Definition at line 554 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::expected_cell_type(), cdt::foliated_triangulations::is_cell_type_correct(), cdt::ONE_THREE, cdt::THREE_ONE, and cdt::TWO_TWO.

◆ propose_23_move()

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::propose_23_move ( Manifold const & t_manifold,
Generator & generator ) -> Expected
inlinenodiscard

Propose one (2,3) site for Metropolis-Hastings.

Unlike do_23_move(), this samples exactly one of the N3(2,2) cells. An inapplicable selected cell is a rejected proposal rather than a reason to condition the proposal distribution on the movable subset.

Template Parameters
GeneratorUniform random bit generator type.
Parameters
t_manifoldSource manifold, which remains unchanged.
generatorCaller-owned generator advanced by site sampling.
Returns
Proposed manifold, or a structured reason the site was rejected.

Definition at line 720 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::collect_cells(), cdt::foliated_triangulations::filter_cells(), and cdt::TWO_TWO.

◆ propose_26_move()

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::propose_26_move ( Manifold const & t_manifold,
Generator & generator ) -> Expected
inlinenodiscard

Propose a uniformly selected (2,6) site.

Exactly one uniformly selected (1,3) cell is examined. An inapplicable raw site is returned as a failed proposal so Metropolis- Hastings can account for it as a self-transition.

Template Parameters
GeneratorUniform random bit generator type.
Parameters
t_manifoldSource manifold, which remains unchanged.
generatorCaller-owned generator advanced by site sampling.
Returns
Proposed manifold, or a structured reason the site was rejected.

Definition at line 1168 of file Ergodic_moves_3.hpp.

◆ propose_32_move()

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::propose_32_move ( Manifold const & t_manifold,
Generator & generator ) -> Expected
inlinenodiscard

Propose one (3,2) site for Metropolis-Hastings.

The raw proposal domain is the set of timelike edges. Selecting a nonflippable edge produces a self-transition.

Template Parameters
GeneratorUniform random bit generator type.
Parameters
t_manifoldSource manifold, which remains unchanged.
generatorCaller-owned generator advanced by site sampling.
Returns
Proposed manifold, or a structured reason the site was rejected.

Definition at line 888 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::collect_edges(), cdt::foliated_triangulations::filter_edges(), and cdt::TIMELIKE.

◆ propose_44_move()

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::propose_44_move ( Manifold const & t_manifold,
Generator & generator ) -> Expected
inlinenodiscard

Propose one spacelike edge as a (4,4) site.

Selecting an edge that is not the pivot of a causal four-cell complex is an explicit self-transition.

Template Parameters
GeneratorUniform random bit generator type.
Parameters
t_manifoldSource manifold, which remains unchanged.
generatorCaller-owned generator advanced by site sampling.
Returns
Proposed manifold, or a structured reason the site was rejected.

Definition at line 1868 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::collect_edges(), cdt::foliated_triangulations::filter_edges(), and cdt::SPACELIKE.

◆ propose_62_move()

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::propose_62_move ( Manifold const & t_manifold,
Generator & generator ) -> Expected
inlinenodiscard

Propose one vertex as a (6,2) site for Metropolis-Hastings.

Template Parameters
GeneratorUniform random bit generator type.
Parameters
t_manifoldSource manifold, which remains unchanged.
generatorCaller-owned generator advanced by site sampling and ordering incident-edge flip paths.
Returns
Proposed manifold, or a structured reason the site was rejected.

Definition at line 1447 of file Ergodic_moves_3.hpp.

References cdt::foliated_triangulations::collect_vertices().

◆ random_element()

template<typename Container, std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::detail::random_element ( Container const & candidates,
Generator & generator ) -> std::optional< typename Container::value_type >
inlinenodiscard

Select exactly one raw proposal site uniformly in container order.

Definition at line 387 of file Ergodic_moves_3.hpp.

◆ resolve_cell()

auto cdt::ergodic_moves::detail::resolve_cell ( Delaunay const & triangulation,
Cell_points const & points ) -> std::optional< Cell_handle >
inlinenodiscard

Definition at line 279 of file Ergodic_moves_3.hpp.

◆ resolve_edge()

auto cdt::ergodic_moves::detail::resolve_edge ( Delaunay const & triangulation,
Edge_points const & points ) -> std::optional< Edge_handle >
inlinenodiscard

Definition at line 300 of file Ergodic_moves_3.hpp.

◆ resolve_vertex()

auto cdt::ergodic_moves::detail::resolve_vertex ( Delaunay const & triangulation,
Point_t< 3 > const & point ) -> std::optional< Vertex_handle >
inlinenodiscard

Definition at line 270 of file Ergodic_moves_3.hpp.

◆ same_configuration_value()

auto cdt::ergodic_moves::detail::same_configuration_value ( double const first,
double const second ) -> bool
inlinenodiscardnoexcept

Compare preserved floating-point configuration state exactly.

Move construction copies these values; arithmetic tolerance is inappropriate because any representation change indicates state drift.

Definition at line 186 of file Ergodic_moves_3.hpp.

◆ try_23_move()

auto cdt::ergodic_moves::detail::try_23_move ( Delaunay & triangulation,
Cell_handle const & to_be_moved ) -> bool
inlinenodiscard

Compatibility seam that prepares and immediately executes (2,3).

Definition at line 648 of file Ergodic_moves_3.hpp.

◆ try_32_move()

auto cdt::ergodic_moves::detail::try_32_move ( Delaunay & triangulation,
Edge_handle const & to_be_moved ) -> bool
inlinenodiscard

Compatibility seam that prepares and immediately executes (3,2).

Definition at line 821 of file Ergodic_moves_3.hpp.

◆ try_62_move()

template<std::uniform_random_bit_generator Generator>
auto cdt::ergodic_moves::detail::try_62_move ( Delaunay const & source_triangulation,
Vertex_handle const source_candidate,
Generator & generator ) -> std::optional< Delaunay >
inlinenodiscard

Apply the combinatorial (6,2) retriangulation on a private copy.

A (3,2) flip of either timelike edge incident to the removable vertex leaves that vertex with degree four. Removing it from its maximal simplex then replaces the original six cells with the required two cells. Keeping both operations in a private copy makes rejection failure-atomic.

Parameters
source_triangulationThe triangulation containing the candidate
source_candidateThe degree-five vertex to remove
generatorThe caller-owned random engine used to order flip paths
Returns
The moved triangulation, or nullopt when the topology is not flippable or the result violates a triangulation or causal-cell invariant

Definition at line 1372 of file Ergodic_moves_3.hpp.

◆ try_62_move_impl()

template<std::uniform_random_bit_generator Generator, typename Post_mutation_validator>
auto cdt::ergodic_moves::detail::try_62_move_impl ( Delaunay const & source_triangulation,
Vertex_handle const source_candidate,
Generator & generator,
Post_mutation_validator post_mutation_validator ) -> std::optional< Delaunay >
inlinenodiscard

Definition at line 1346 of file Ergodic_moves_3.hpp.

◆ vertex_precedes()

auto cdt::ergodic_moves::detail::vertex_precedes ( Vertex_handle const & left,
Vertex_handle const & right ) -> bool
inlinenodiscard

Definition at line 374 of file Ergodic_moves_3.hpp.