TBTK
TBTK::SourceAmplitudeSet Class Reference

SourceAmplitude container. More...

#include <SourceAmplitudeSet.h>

Inheritance diagram for TBTK::SourceAmplitudeSet:
TBTK::Serializable

Classes

class  Iterator
 

Public Member Functions

 SourceAmplitudeSet ()
 
 SourceAmplitudeSet (const std::string &serializeation, Mode mode)
 
virtual ~SourceAmplitudeSet ()
 
void addSourceAmplitude (SourceAmplitude ha)
 
const std::vector< SourceAmplitude > & getSourceAmplitudes (const Index &index) const
 
HoppingAmplitudeSet::Iterator getIterator () const
 
HoppingAmplitudeSet::Iterator getIterator (const Index &subspace) const
 
void print ()
 
void tabulate (std::complex< double > **amplitudes, int **indices, int *numHoppingAmplitudes, int *maxIndexSize) const
 
virtual std::string serialize (Mode mode) const
 
unsigned int getSizeInBytes () const
 

Additional Inherited Members

- Public Types inherited from TBTK::Serializable
enum  Mode { Debug, Binary, XML, JSON }
 
- Static Public Member Functions inherited from TBTK::Serializable
static bool hasID (const std::string &serialization, Mode mode)
 
static std::string getID (const std::string &serialization, Mode mode)
 
- Static Protected Member Functions inherited from TBTK::Serializable
static bool validate (const std::string &serialization, const std::string &id, Mode mode)
 
static std::string getContent (const std::string &serialization, Mode mode)
 
static std::vector< std::string > split (const std::string &content, Mode mode)
 
static std::string serialize (bool b, Mode mode)
 
static void deserialize (const std::string &serialization, bool *b, Mode mode)
 
static std::string serialize (int i, Mode mode)
 
static void deserialize (const std::string &serialization, int *i, Mode mode)
 
static std::string serialize (unsigned int u, Mode mode)
 
static void deserialize (const std::string &serialization, unsigned int *u, Mode mode)
 
static std::string serialize (double d, Mode mode)
 
static void deserialize (const std::string &serialization, double *d, Mode mode)
 
static std::string serialize (std::complex< double > c, Mode mode)
 
static void deserialize (const std::string &serialization, std::complex< double > *c, Mode mode)
 
static std::string serialize (Statistics s, Mode mode)
 
static void deserialize (const std::string &serialization, Statistics *s, Mode mode)
 
static std::string extract (const std::string &serialization, Mode mode, std::string component)
 

Detailed Description

SourceAmplitude container.

A SourceAmplitudeSet is a container for SourceAmplitudes .

Constructor & Destructor Documentation

TBTK::SourceAmplitudeSet::SourceAmplitudeSet ( )

Constructor.

TBTK::SourceAmplitudeSet::SourceAmplitudeSet ( const std::string &  serializeation,
Mode  mode 
)

Constructor. Constructs the HoppingAmplitudeSet from a serialization string.

virtual TBTK::SourceAmplitudeSet::~SourceAmplitudeSet ( )
virtual

Destructor.

Member Function Documentation

void TBTK::SourceAmplitudeSet::addSourceAmplitude ( SourceAmplitude  ha)

Add a single SourceAmplitude.

Parameters
sourceAmplitudeSourceAmplitude to add.
HoppingAmplitudeSet::Iterator TBTK::SourceAmplitudeSet::getIterator ( ) const

Returns an iterator for iterating through HoppingAmplitudes .

HoppingAmplitudeSet::Iterator TBTK::SourceAmplitudeSet::getIterator ( const Index subspace) const

Returns an iterator for iterating through HoppingAmplitudes . The iterator is restricted to the subspace for which the 'from'-index starts with the indices in the argument 'subspace'.

unsigned int TBTK::SourceAmplitudeSet::getSizeInBytes ( ) const

Get size in bytes.

const std::vector<SourceAmplitude>& TBTK::SourceAmplitudeSet::getSourceAmplitudes ( const Index index) const

Get all SourceAmplitudes with the given Index.

Parameters
indexIndex to get SourceAmplitudes for.
void TBTK::SourceAmplitudeSet::print ( )

Print tree structure. Mainly for debuging.

virtual std::string TBTK::SourceAmplitudeSet::serialize ( Mode  mode) const
virtual
void TBTK::SourceAmplitudeSet::tabulate ( std::complex< double > **  amplitudes,
int **  indices,
int *  numHoppingAmplitudes,
int *  maxIndexSize 
) const

Tabulates HoppingAmplitudes to make them possible to export.

Parameters
amplitudesPointer to amplitude table pointer. Memory will be allocated and has to be freed by the user. The array will contain all the HoppingAmplitude values when the function returns.
tablePointer to index table pointer. Memory will be allocated and has to be freed by the user. The array will contain the 'to'- and 'from'-indices for the corresponding HoppingAmplitude values in amplitudes. The values are stored sequentially using the format [to0] [padding] [from0] [padding] [to1] ..., where the padding is added to align 'to'- and 'from'-indices in memory in case multiple index sizes are encounterd. The number of padding elements will be zero for indices of size maxIndexSize and the padding value is -1. The total array size is 2*numHoppingAmplitudes*maxIndexSize.
numHoppingAmplitudesPointer to int that will contain the number of HoppingAMplitudes when the function returns.
maxIndexSizePointer to int that will contain the maximum number of subindices encountered.

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