SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::utils::dependencies::detail::Graph< Computations > Struct Template Reference

Immutable topology of computed nodes; context sources are resolved separately. More...

#include <graph.hpp>

Collaboration diagram for serif::utils::dependencies::detail::Graph< Computations >:
[legend]

Public Types

using Mask = std::array<bool, size>
 
using Matrix = std::array<Mask, size>
 
using Order = std::array<std::size_t, size>
 

Static Public Member Functions

template<typename ComputationT>
static consteval Mask prerequisites ()
 Record only computed prerequisites; other input keys are supplied by a context.
 
static consteval Order make_order ()
 Order prerequisites before their users, preferring the earliest ready declaration at each step.
 
static consteval bool acyclic ()
 A missing position identifies a cycle, including a computation requiring itself.
 
template<typename... Keys>
static consteval Mask required (KeyList< Keys... >)
 Expand requested results to include all computed prerequisites in one reverse traversal.
 

Static Public Attributes

static constexpr std::size_t size = sizeof...(Computations)
 
static constexpr Matrix edges {prerequisites<Computations>()...}
 edges[consumer][producer] is true when the consumer reads the producer's result.
 
static constexpr Order order = make_order()
 Each execution position maps to a declaration index; size marks an unresolved cycle.
 

Detailed Description

template<typename... Computations>
struct serif::utils::dependencies::detail::Graph< Computations >

Immutable topology of computed nodes; context sources are resolved separately.

Member Typedef Documentation

◆ Mask

template<typename... Computations>
using serif::utils::dependencies::detail::Graph< Computations >::Mask = std::array<bool, size>

◆ Matrix

template<typename... Computations>
using serif::utils::dependencies::detail::Graph< Computations >::Matrix = std::array<Mask, size>

◆ Order

template<typename... Computations>
using serif::utils::dependencies::detail::Graph< Computations >::Order = std::array<std::size_t, size>

Member Function Documentation

◆ acyclic()

template<typename... Computations>
static consteval bool serif::utils::dependencies::detail::Graph< Computations >::acyclic ( )
inlinestaticnodiscardconsteval

A missing position identifies a cycle, including a computation requiring itself.

◆ make_order()

template<typename... Computations>
static consteval Order serif::utils::dependencies::detail::Graph< Computations >::make_order ( )
inlinestaticnodiscardconsteval

Order prerequisites before their users, preferring the earliest ready declaration at each step.

Note
Remaining prerequisite counts avoid rescanning each candidate's entire input list. Both the initial count and subsequent updates are quadratic in graph size, keeping complete stellar graphs within constexpr limits.

◆ prerequisites()

template<typename... Computations>
template<typename ComputationT>
static consteval Mask serif::utils::dependencies::detail::Graph< Computations >::prerequisites ( )
inlinestaticnodiscardconsteval

Record only computed prerequisites; other input keys are supplied by a context.

◆ required()

template<typename... Computations>
template<typename... Keys>
static consteval Mask serif::utils::dependencies::detail::Graph< Computations >::required ( KeyList< Keys... > )
inlinestaticnodiscardconsteval

Expand requested results to include all computed prerequisites in one reverse traversal.

Note
Every user appears after its prerequisites in the topological order. Visiting users first therefore marks their inputs before those inputs are visited, independently of declaration order.

Member Data Documentation

◆ edges

template<typename... Computations>
Matrix serif::utils::dependencies::detail::Graph< Computations >::edges {prerequisites<Computations>()...}
staticconstexpr

edges[consumer][producer] is true when the consumer reads the producer's result.

◆ order

template<typename... Computations>
Order serif::utils::dependencies::detail::Graph< Computations >::order = make_order()
staticconstexpr

Each execution position maps to a declaration index; size marks an unresolved cycle.

◆ size

template<typename... Computations>
std::size_t serif::utils::dependencies::detail::Graph< Computations >::size = sizeof...(Computations)
staticconstexpr

The documentation for this struct was generated from the following file: