TBTK
Classes | Public Member Functions | Public Attributes | List of all members
TBTK::TreeNode Class Reference

#include <TreeNode.h>

Classes

class  Iterator
 

Public Member Functions

 TreeNode ()
 
void add (HoppingAmplitude ha)
 
const TreeNodegetSubTree (const Index &subspace) const
 
bool isProperSubspace (const Index &subspace)
 
const std::vector< HoppingAmplitude > * getHAs (Index index) const
 
int getBasisIndex (const Index &index) const
 
Index getPhysicalIndex (int basisIndex) const
 
void generateBasisIndices ()
 
void sort (TreeNode *rootNode)
 
void print ()
 
Iterator begin ()
 

Public Attributes

int basisIndex
 
int basisSize
 
std::vector< HoppingAmplitudehoppingAmplitudes
 
std::vector< TreeNodechildren
 

Detailed Description

TreeNode structure used to build a tree for stroing HoppingAmplitudes . Used by AmplitudeSet.

Constructor & Destructor Documentation

TBTK::TreeNode::TreeNode ( )

Constructor.

Member Function Documentation

void TBTK::TreeNode::add ( HoppingAmplitude  ha)
TreeNode::Iterator TBTK::TreeNode::begin ( )

Returns Iterator initialized to point at first HoppingAmplitude.

void TBTK::TreeNode::generateBasisIndices ( )

Generate Hilbert space indices. No more HoppingAmplitudes should be added after this call.

int TBTK::TreeNode::getBasisIndex ( const Index index) const

Get Hilbert space basis index for given physical index.

const std::vector< HoppingAmplitude > * TBTK::TreeNode::getHAs ( Index  index) const

Get all HoppingAmplitudes with given 'from'-index.

Index TBTK::TreeNode::getPhysicalIndex ( int  basisIndex) const

Get physical index for given Hilbert space absis index.

const TreeNode * TBTK::TreeNode::getSubTree ( const Index subspace) const

Get sub tree.

bool TBTK::TreeNode::isProperSubspace ( const Index subspace)

Returns true if the subspace is a proper subsapce. That is, if the corresponding subtree only contains HoppingAmplitudes that connects sistes within the subtree.

void TBTK::TreeNode::print ( )

Print HoppingAmplitudes . Mainly for debuging purposes.

void TBTK::TreeNode::sort ( TreeNode rootNode)

Sort HoppingAmplitudes in row order.

Member Data Documentation

int TBTK::TreeNode::basisIndex

Basis index for the Hamiltonian.

int TBTK::TreeNode::basisSize

Basis size of Hamiltonian.

std::vector<TreeNode> TBTK::TreeNode::children

Child nodes. Never non-empty at the same time as hoppingAmplitudes

std::vector<HoppingAmplitude> TBTK::TreeNode::hoppingAmplitudes

HoppingAmplitudes stored on this node, should only be non-empty if the node is a leaf node. That is, if the node corresponds to a last subindex index.


The documentation for this class was generated from the following files: