Function trx::format_groups_summary
Defined in File trx.h
Function Documentation
-
std::string trx::format_groups_summary(const std::map<std::string, size_t> &groups, int prefix_depth = 0, const std::string &line_prefix = "")
Format a group listing with optional prefix-based collapsing.
When
prefix_depthis 0 (the default), every group is listed individually:glasser_Left_V1: 123 streamlines glasser_Left_V2: 456 streamlines
When
prefix_depth> 0, group names are split on ‘_’ and the firstprefix_depthtokens form the aggregation key. Groups that share a key have their streamline counts summed and are shown as a single collapsed line:If only one group maps to a given prefix key the wildcard suffix is omitted and the original group name is used as-is.glasser_*: 579 streamlines (2 groups)
- Parameters:
groups – Map from group name to streamline count.
prefix_depth – Number of ‘_’-delimited tokens used as the grouping key (0 = flat list).
line_prefix – String prepended to every output line (e.g. for indentation).
- Returns:
Formatted multi-line string (no trailing newline).