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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eThe \u003ccode\u003edynamic_partition\u003c/code\u003e classes manage a partition of integers into disjoint equivalence classes, offering functionality for splitting and merging these classes.\u003c/p\u003e\n"],["\u003cp\u003eTwo primary dynamic partition classes are available: \u003ccode\u003eDynamicPartition\u003c/code\u003e for incremental splitting and \u003ccode\u003eMergingPartition\u003c/code\u003e for incremental merging.\u003c/p\u003e\n"],["\u003cp\u003eThese classes are not inherently "safe" and may crash if used improperly, requiring client code to ensure proper usage.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation for specific dynamic partition classes, including \u003ccode\u003eDynamicPartition\u003c/code\u003e, \u003ccode\u003eMergingPartition\u003c/code\u003e, and \u003ccode\u003eSimpleDynamicPartition\u003c/code\u003e, is linked for further exploration.\u003c/p\u003e\n"]]],["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,["# dynamic_partition\n\nC++ Reference: dynamic_partition\n================================\n\n\nNote: This documentation is automatically generated.\nTODO(user): refine this toplevel comment when this file settles. \n\nTwo 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. \n\nGLOSSARY: The partition classes maintain a partition of N integers 0..N-1 (aka \"elements\") into disjoint equivalence classes (aka \"parts\"). \n\nSAFETY: Like vector\\\u003cint\\\u003e 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. \n\n| Classes ------- ||\n|-------------------------------------------------------------------------------------------------------|---|\n| [DynamicPartition](/optimization/reference/algorithms/dynamic_partition/DynamicPartition) |\n| [MergingPartition](/optimization/reference/algorithms/dynamic_partition/MergingPartition) |\n| [SimpleDynamicPartition](/optimization/reference/algorithms/dynamic_partition/SimpleDynamicPartition) |"]]