Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: dynamic_partition
Note: This documentation is automatically generated.
TODO(user): refine this toplevel comment when this file settles.
Two dynamic partition classes: one that incrementally splits a partition into more and more parts; one that incrementally merges a partition into less and less parts.
GLOSSARY: The partition classes maintain a partition of N integers 0..N-1 (aka "elements") into disjoint equivalence classes (aka "parts").
SAFETY: Like vector<int> crashes when used improperly, these classes are not "safe": most of their methods may crash if called with invalid arguments. The client code is responsible for using this class properly. A few DCHECKs() will help catch bugs, though.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[null,null,["Last updated 2024-08-06 UTC."],[],["The documentation details two C++ dynamic partition classes: `DynamicPartition` and `MergingPartition`. These classes manage the division of N integers (0 to N-1) into disjoint equivalence classes, or \"parts.\" `SimpleDynamicPartition` is also listed. One class incrementally splits a partition into more parts, while the other incrementally merges a partition into fewer parts. The classes are not inherently \"safe\"; client code must ensure proper usage to avoid crashes, although some error-checking mechanisms exist.\n"],null,[]]