43 typedef std::set<KEY>
Set;
76 return this->
add(key, key);
82 *
this = this->
add(key, key);
119 for(
const KeyLabel& pair: (Tree)t)
120 t.findSet_(pair.first);
127 for(
const KeyLabel& pair: (Tree)*
this)
135 for(
const KeyLabel& pair: (Tree)*
this)
136 if (pair.first == pair.second)
147 std::map<KEY, Set>
sets()
const {
148 std::map<KEY, Set>
sets;
149 for(
const KeyLabel& pair: (Tree)*
this)
150 sets[
findSet(pair.second)].insert(pair.first);
156 std::map<KEY, Set> partitions;
163 Set
set(
const KEY& label)
const {
165 for(
const KeyLabel& pair: (Tree)*
this) {
166 if (pair.second == label ||
findSet(pair.second) == label)
174 return (Tree) *
this == (
Tree) t;
179 return (Tree) *
this != (
Tree) t;
184 std::cout <<
name << std::endl;
185 for(
const KeyLabel& pair: (Tree)*
this)
186 std::cout << (std::string) pair.first <<
" " << (std::string) pair.second
202 *
this = this->
add(key, label);
std::map< KEY, Set > partition(const std::list< KEY > &keys) const
bool mem(const KEY &x) const
DSF(const std::set< KEY > &keys)
void makeSetInPlace(const KEY &key)
void print(const std::string &name="DSF") const
purely functional binary tree
std::pair< KEY, KEY > KeyLabel
Self makeList(const std::list< KEY > &keys) const
KEY findSet_(const KEY &key)
DSF(const std::list< KEY > &keys)
bool operator==(const Self &t) const
Self makePair(const KEY &key1, const KEY &key2) const
std::map< KEY, Set > sets() const
void makeUnionInPlace(const KEY &key1, const KEY &key2)
const Symbol key1('v', 1)
Self makeUnion(const KEY &key1, const KEY &key2) const
Self makeSet(const KEY &key) const
KEY findSet(const KEY &key) const
DSF map(std::function< KEY(const KEY &)> func) const
bool operator!=(const Self &t) const
BTree add(const value_type &xd) const
const KEY & find(const KEY &k) const
Annotation for function names.
int EIGEN_BLAS_FUNC() copy(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
const Symbol key2('v', 2)