The enumerated_zip_sequence function iterates over all groups/buses, regardless of whether the input was a DenseGroupedIdxVector or a SparseGroupedIdxVector.
Especially for DenseGroupedIdxVector, for which it is expected to have few groups/buses, the iteration is over a lot of empty groups (potentially orders of magnitude larger than the amount of actually occupied non-empty groups). This results in a lot of useless calculations.
Proposed solution
Create a function enumerate_occupied that takes in only one grouped_idx_vector and enumerates over the occupied groupes only
Do not support zipped iterations to prevent difficult occupied group matching
Keep the current enumerated_zip_sequence to allow for zip-like features
Describe the feature request
The
enumerated_zip_sequence
function iterates over all groups/buses, regardless of whether the input was aDenseGroupedIdxVector
or aSparseGroupedIdxVector
.Especially for
DenseGroupedIdxVector
, for which it is expected to have few groups/buses, the iteration is over a lot of empty groups (potentially orders of magnitude larger than the amount of actually occupied non-empty groups). This results in a lot of useless calculations.Proposed solution
enumerate_occupied
that takes in only onegrouped_idx_vector
and enumerates over the occupied groupes onlyenumerated_zip_sequence
to allow for zip-like features