pub struct IndexCore { /* private fields */ }Expand description
The owned, network-independent derivation behind IndexedNetwork: the
dense bus-id map plus the per-bus demand/shunt aggregates. Build it once with
IndexCore::build and reuse it across many IndexedNetwork::with_core
views of the same BalancedNetwork.
Implementations§
Source§impl IndexCore
impl IndexCore
Sourcepub fn build(net: &BalancedNetwork) -> IndexCore
pub fn build(net: &BalancedNetwork) -> IndexCore
Index net: map bus ids to dense indices and fold every load/shunt onto
its bus. Loads and shunts are summed regardless of their in_service
flag, matching the folded pd/qd/gs/bs the MATPOWER-shaped model carried
on the bus row (the matrices key off topology and these aggregates, not
per-element service status).
§Correctness
Bus ids must be unique; a duplicate collapses two buses onto one dense
index and silently corrupts every aggregate. Format readers run
BalancedNetwork::validate before
this, so a parsed network satisfies it; a hand-built
BalancedNetwork must call validate itself. Backstopped here by a
debug_assert.