|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
Fold step of the single-source semiring closure: relax the potential at e.head through the edge e, d(v) ← d(v) ⊕ d(u) ⊗ c(u,v).
More...
Public Types | |
| using | Add = typename dedekind::algebra::semiring_ops<S>::add |
The carrier's canonical additive op ⊕ (semiring_ops). | |
| using | Mult = typename dedekind::algebra::semiring_ops<S>::mult |
The carrier's canonical multiplicative op ⊗ (semiring_ops). | |
Public Member Functions | |
| constexpr FiniteNet< S, Cap > | operator() (FiniteNet< S, Cap > acc, const Edge &e) const |
Relax e.head: d(head) ← d(head) ⊕ d(tail) ⊗ c(tail,head), returning the new net — the fold step op(acc, Edge). | |
Public Attributes | |
| CostFn | cost |
The edge-cost function c(tail,head); the only captured state. | |
Fold step of the single-source semiring closure: relax the potential at e.head through the edge e, d(v) ← d(v) ⊕ d(u) ⊗ c(u,v).
The named replacement for the capturing relax lambda (#920): the closure structure — which cost the fold threads — is an inspectable type rather than a nameless closure. The semiring ops ⊕ / ⊗ are fixed by the carrier S itself (semiring_ops) rather than exposed as parameters, so cost is the only captured state. Models the fold step op(acc, Edge), returning the new net.
IsSemiring gate). cost is a bare BINARY callable (edge → weight, a raw lambda at the call site) with no Domain / Codomain, so it is gated structurally (a requires on cost), NOT by IsArrow, which models a unary morphism and would reject every caller.