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) -> Self
pub fn build(net: &BalancedNetwork) -> Self
Index net: map bus ids to dense indices and fold every in-service
load and shunt onto its bus. An out-of-service load or shunt draws
nothing, so it is left out of pd/qd/gs/bs and of every matrix built
from them, the same rule the power flow instances apply to loads and
generators.
§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.