![]() |
OpenSiv3D
v0.6.5
C++20 framework for creative coding
|
Disjoint Set Union (Union-Find) More...
#include <DisjointSet.hpp>
Public Types | |
| using | index_type = IndexType |
| インデックスの型 More... | |
| using | signed_index_type = std::make_signed_t< index_type > |
| 内部のインデックス型 More... | |
Public Member Functions | |
| SIV3D_NODISCARD_CXX20 | DisjointSet ()=default |
| デフォルトコンストラクタ More... | |
| SIV3D_NODISCARD_CXX20 | DisjointSet (size_t n) |
| 要素数を指定して Disjoint Set Union を作成します。 More... | |
| operator bool () const noexcept | |
| 要素を持つかを返します。 More... | |
| bool | isEmpty () const noexcept |
| 要素が空であるかを返します。 More... | |
| size_t | size () const noexcept |
| 要素数を返します。 More... | |
| index_type | find (index_type i) noexcept |
| ノード i を含むグループの root を返します。 More... | |
| bool | connected (index_type i, index_type k) noexcept |
| ノード i とノード k か同じグループに含まれているかを返します。 More... | |
| bool | isRoot (index_type i) const noexcept |
| ノード i がグループの root であるかを返します。 More... | |
| bool | merge (index_type i, index_type k) noexcept |
| ノード i を含むグループとノード k を含むグループを併合します。 More... | |
| size_t | size (index_type i) noexcept |
| ノード i を含むグループの要素数を返します。 More... | |
| size_t | countSets () const noexcept |
| グループの個数を返します。 More... | |
| void | reset () noexcept |
| グループ関係をすべて解消します。 More... | |
Static Public Attributes | |
| static constexpr size_t | MaxSize = (static_cast<size_t>(std::numeric_limits<signed_index_type>::max()) + 1) |
| 現在のインデックスの型で保持可能な最大の要素数 More... | |
Disjoint Set Union (Union-Find)
| IndexType | インデックスの型 |
| using s3d::DisjointSet< IndexType >::index_type = IndexType |
インデックスの型
| using s3d::DisjointSet< IndexType >::signed_index_type = std::make_signed_t<index_type> |
内部のインデックス型
|
default |
デフォルトコンストラクタ
|
explicit |
要素数を指定して Disjoint Set Union を作成します。
| n | 要素数 |
|
noexcept |
ノード i とノード k か同じグループに含まれているかを返します。
| i | ノードのインデックス |
| k | ノードのインデックス |
|
noexcept |
グループの個数を返します。
|
noexcept |
ノード i を含むグループの root を返します。
| i | ノードのインデックス |
|
noexcept |
要素が空であるかを返します。
|
noexcept |
ノード i がグループの root であるかを返します。
| i | ノードのインデックス |
|
noexcept |
ノード i を含むグループとノード k を含むグループを併合します。
| i | ノードのインデックス |
| k | ノードのインデックス |
|
explicitnoexcept |
要素を持つかを返します。
|
noexcept |
グループ関係をすべて解消します。
|
noexcept |
要素数を返します。
|
noexcept |
ノード i を含むグループの要素数を返します。
| i | ノードのインデックス |
|
staticconstexpr |
現在のインデックスの型で保持可能な最大の要素数