TreeClasses

group Tree

Group for classes related to tree handling.

This group contains all functionality pertaining to Trees.

Classes in this group use a TTBasis to generate new classes that use and work with the tree structure provided by TTBasis. The classes in this group should either inherit from TreeStructureObject (for classes that have some object at EVERY node in a tree) or SparseTreeStructuredObject (for classes that have some object at a SUBSET of all nodes in the tree).

template<class A>
class NodeAttribute
#include <NodeAttribute.h>

Base class for creating objects at every node in a tree.

For every node in a TTBasis, there is one corresponding Object of class A. Inherit from this class for fast prototyping. Make sure that attributes_ gets cleared and filled in a constructor. Automatically provides iterators and bracket operators for Node objects.

template<class A>
class SparseTreeStructuredObject
#include <SparseNodeAttribute.h>

This is a central base class for objects that are sparsely tree-structured.

This is a sparse version of the TreeStructuredObject. It provides a sparse handling for objects that are only present at some nodes.

template<typename T>
class TensorTree
#include <TensorTree.h>

This class represents tensor trees.

Usage: TRBasis tree(12, 2, 2) // Create Tensor with Zero-entry tensors at every node TensorTreecd Psi(tree); Psi.Write(“filename.dat”); TensorTreecd Chi(“filename.dat”);

class Tree

This class manages the tensor tree tree.

TensorTreeBasis (TTBasis) holds and manages the tree structure and holds tensor dimensions at every node. It provides iterators for swiping over every node in a tree. For a bottom-up swipe though the tree use the iterator; for a top-down swipe use a regular for loop and get Nodes via GetNode(i).

Usage: Tree tree(n_leaves dim_leaves, dim_nodes); // Create close to balanced tree for (const Node& node : tree) { // Do something - bottom-up swipe }

for (int i = tree.nNodes() - 1; i > 0; i) { const Node& node = tree.GetNode(i); // Do something - Top-child swipe } or for (auto it = tree.rbegin(); it != tree.rend(); it++) {

}

for (size_t l = 0; l < nLeaves; ++l) { const Leaf& leaf = GetLeaf(l); // Do something - for every leaf }

namespace SparseMatrixTreeFunctions

This class provides functions to build SparseMatrixTrees.

SparseMatrixTrees typically appear when representing operators in a tensortree basis. Similar to MatrixTree, a SparseMatrixTree can be build bottom-up or top-down in a tree. A SparsematrixTree is build bottom-up if an operator is represented and top-down if the representation of the operator is represented.