#include <Tree.h>
|
| bool | IsRoot () const |
| |
| bool | IsLeaf () const |
| |
| T & | operator* () |
| |
| const T & | operator* () const |
| |
| T & | Get () |
| |
| const T & | Get () const |
| |
| node_t | GetParent () const |
| |
| node_t | Self () const |
| |
| const snodelist_t & | Daughters () const |
| |
| void | Unlink () |
| | Unlink remove this node from parent. More...
|
| |
| template<typename ... args_t> |
| node_t & | CreateDaughter (args_t &&... args) |
| |
| node_t & | AddDaughter (const node_t &n) |
| |
| void | SetParent (const node_t &p) |
| |
| template<typename F > |
| void | Map (F function) const |
| |
| template<typename F > |
| void | Map_level (F function, size_t level=0) const |
| |
| template<typename F > |
| void | Map_nodes (F function) const |
| | Map_nodes runs through the tree recursively depth-first. More...
|
| |
| size_t | Size () const |
| |
| size_t | Depth () const |
| |
| void | Sort () |
| |
| template<typename Compare > |
| void | Sort (Compare comp) |
| |
| template<typename U , typename Compare > |
| bool | IsEqual (const snode_t< U > &other, Compare comp) const |
| |
| template<typename U > |
| bool | IsEqual (const snode_t< U > &other) const |
| |
| template<typename U = T, typename Transform = std::function<U(const node_t&)>> |
| snode_t< U > | DeepCopy (Transform transform) const |
| | DeepCopy uses the given transfrom from node_t to U to deeply copy the tree. More...
|
| |
| template<typename U = T> |
| snode_t< U > | DeepCopy () const |
| |
| void | GetUniquePermutations (std::vector< node_t > &leaves, std::vector< std::vector< int >> &perms, int &i_leave_offset) const |
| | GetUniquePermutations calculates the unique permutations of the leaves. More...
|
| |
|
| template<typename ... args_t> |
| static node_t | MakeNode (args_t &&... args) |
| |
| template<typename Head , typename... Daughters> |
| static node_t | Make (Head &&head, const std::tuple< Daughters... > &daughters) |
| |
|
| template<typename Daughter , typename... Daughters> |
| static std::enable_if< std_ext::first_element_is_tuple< Daughters... >::value, void >::type | make_impl (node_t &head, const std::tuple< Daughter, Daughters... > &daughters) |
| |
| template<typename Daughter , typename... Daughters> |
| static std::enable_if<!std_ext::first_element_is_tuple< Daughters... >::value, void >::type | make_impl (node_t &head, const std::tuple< Daughter, Daughters... > &daughters) |
| |
| template<typename Daughter = void> |
| static void | make_impl (node_t &, const std::tuple<> &) |
| |
| template<typename Item > |
| static std::enable_if< std::is_convertible< Item, T >::value, node_t & >::type | make_impl (node_t &head, Item &&item) |
| |
| template<typename Item > |
| static std::enable_if< std::is_convertible< Item, node_t >::value, node_t & >::type | make_impl (node_t &head, Item &&item) |
| |
◆ node_t
◆ snodelist_t
◆ type
◆ wnode_t
◆ Tree() [1/2]
◆ Tree() [2/2]
◆ AddDaughter()
◆ CreateDaughter()
template<typename T>
template<typename ... args_t>
◆ Daughters()
◆ DeepCopy() [1/2]
template<typename T>
template<typename U = T, typename Transform = std::function<U(const node_t&)>>
| snode_t<U> ant::Tree< T >::DeepCopy |
( |
Transform |
transform | ) |
const |
|
inline |
DeepCopy uses the given transfrom from node_t to U to deeply copy the tree.
- Parameters
-
| transform | function to convert node to new type U |
◆ DeepCopy() [2/2]
template<typename T>
template<typename U = T>
| snode_t<U> ant::Tree< T >::DeepCopy |
( |
| ) |
const |
|
inline |
◆ Depth()
◆ Get() [1/2]
◆ Get() [2/2]
◆ GetParent()
◆ GetUniquePermutations()
template<typename T>
| void ant::Tree< T >::GetUniquePermutations |
( |
std::vector< node_t > & |
leaves, |
|
|
std::vector< std::vector< int >> & |
perms, |
|
|
int & |
i_leave_offset |
|
) |
| const |
|
inline |
GetUniquePermutations calculates the unique permutations of the leaves.
- Parameters
-
| leaves | the leaves of the tree for convenience, defines also the order of indices in perms |
| perms | permutations as indices corresponding to vector leaves (offseted by possible i_leave_offset). Use indices to assign particles to leaves (not leaves to particles) i_leave_offset separates the trivial equivalence classes from the actually permuted leaves |
- Note
- We assume that the tree is already sorted with std::less comparison, anything else will lead to wrong results.
◆ IsEqual() [1/2]
template<typename T>
template<typename U , typename Compare >
| bool ant::Tree< T >::IsEqual |
( |
const snode_t< U > & |
other, |
|
|
Compare |
comp |
|
) |
| const |
|
inline |
◆ IsEqual() [2/2]
template<typename T>
template<typename U >
| bool ant::Tree< T >::IsEqual |
( |
const snode_t< U > & |
other | ) |
const |
|
inline |
◆ IsLeaf()
◆ IsRoot()
◆ Make()
template<typename T>
template<typename Head , typename... Daughters>
| static node_t ant::Tree< T >::Make |
( |
Head && |
head, |
|
|
const std::tuple< Daughters... > & |
daughters |
|
) |
| |
|
inlinestatic |
◆ make_impl() [1/5]
template<typename T>
template<typename Daughter , typename... Daughters>
◆ make_impl() [2/5]
template<typename T>
template<typename Daughter , typename... Daughters>
◆ make_impl() [3/5]
template<typename T>
template<typename Daughter = void>
◆ make_impl() [4/5]
template<typename T>
template<typename Item >
| static std::enable_if<std::is_convertible<Item, T>::value, node_t&>::type ant::Tree< T >::make_impl |
( |
node_t & |
head, |
|
|
Item && |
item |
|
) |
| |
|
inlinestaticprotected |
◆ make_impl() [5/5]
template<typename T>
template<typename Item >
◆ MakeNode()
template<typename T>
template<typename ... args_t>
◆ Map()
template<typename T>
template<typename F >
◆ Map_level()
template<typename T>
template<typename F >
| void ant::Tree< T >::Map_level |
( |
F |
function, |
|
|
size_t |
level = 0 |
|
) |
| const |
|
inline |
◆ Map_nodes()
template<typename T>
template<typename F >
| void ant::Tree< T >::Map_nodes |
( |
F |
function | ) |
const |
|
inline |
Map_nodes runs through the tree recursively depth-first.
- Parameters
-
| function | applied to each node |
- Note
- depth first is important for
GetUniquePermutations
◆ operator*() [1/2]
◆ operator*() [2/2]
◆ RemoveDaughter()
◆ Self()
◆ serialize()
template<typename T>
template<class Archive >
| void ant::Tree< T >::serialize |
( |
Archive & |
archive | ) |
|
|
inlineprotected |
◆ SetParent()
◆ Size()
◆ Sort() [1/2]
◆ Sort() [2/2]
template<typename T>
template<typename Compare >
◆ Unlink()
Unlink remove this node from parent.
- Note
- ensure that the instance of the node is local, and NOT some referenced node in the original tree
◆ cereal::access
template<typename T>
| friend class cereal::access |
|
friend |
◆ Tree
template<typename T>
template<typename >
◆ data
◆ daughters
◆ is_sorted
◆ parent
◆ self
The documentation for this class was generated from the following file: