Expand description
IndexedNetwork: the dense-indexed analysis view over a Network.
Network is the canonical data record — format-neutral tables with no
analysis behavior. The matrix builders, connectivity diagnostics, and the
DC-OPF instance need things a plain table doesn’t carry: a dense [0, n) bus
index, demand and shunts aggregated per bus, the in-service subsets, and the
reference bus. IndexCore derives those once from a borrowed &Network;
IndexedNetwork pairs that core with the network and answers the queries.
Keeping this off Network is what stops Network from turning into a god
type: data on one side, derived analysis on the other.
The derived core is one HashMap and four Vec<f64>. One-shot callers use
IndexedNetwork::new, which builds and owns a throwaway core. A long-lived
handle (the Python and C ABI wrappers) builds an IndexCore once at parse
time and rebinds a borrowing view per query with
IndexedNetwork::with_core, so repeated queries never re-fold the loads
and shunts.
Structs§
- Connectivity
Report - Topological invariants the TUI Inspect screen and downstream solvers care about.
- Index
Core - The owned, network-independent derivation behind
IndexedNetwork: the dense bus-id map plus the per-bus demand/shunt aggregates. Build it once withIndexCore::buildand reuse it across manyIndexedNetwork::with_coreviews of the sameNetwork. - Indexed
Network - A
Networkpaired with its derivedIndexCore. Borrows the network; the core is either owned (the one-shotIndexedNetwork::new) or borrowed from a cachedIndexCore(IndexedNetwork::with_core).