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 Network.
Implementations§
Source§impl IndexCore
impl IndexCore
Sourcepub fn build(net: &Network) -> IndexCore
pub fn build(net: &Network) -> 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. The format readers and
Network::from_json run
Network::validate before this, so a parsed
or JSON-sourced network always satisfies it; a hand-built Network must
call validate itself. Backstopped here by a debug_assert.