SyTen

◆ operator[]() [3/3]

template<typename T >
Node* syten::BinaryTree::Tree< T >::operator[] ( std::string const &  coordinate) const
inline

Returns a pointer to the node specified by coordinate.

There are two valid coordinate formats:

1) Strings of characters lLaArRbB and integer numbers (without spaces). The empty string denotes the root node. Each of lLaA makes the left leaf of the current node the new current node. Each of rRbB makes the right leaf of the current node the new current node. An integer k moves down the tree k steps, provided that there are no branches (each node only has one leaf).

Example\n ll2 goes left twice from the root node and then two down.
Example\n lr0l goes left, right and left from the root node.
Example\n ll4r goes left twice, four down and then right from the root node.

2) Strings "cX:L" where X is parsed as an unsigned integer denoting the impurity/bath chain and L is parsed as the offset into that chain. This is only a sensible thing for DMFT-like binary trees.

Example\n c0:0 denotes the impurity site of the first impurity
Example\n c1:0 denotes the impurity site of the second impurity
Example\n c3:2 denotes the second bath site of the fourth impurity

References syten::BinaryTree::Node< T >::a, syten::BinaryTree::Node< T >::b, std::stringstream::clear(), std::stringstream::eof(), std::string::find(), syten::BinaryTree::Tree< T >::go_down(), std::isdigit(), syten::BinaryTree::Tree< T >::r, std::stringstream::read(), std::string::size(), std::stoul(), std::stringstream::str(), and std::string::substr().

Referenced by syten::BinaryTree::Tree< T >::operator[]().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: