TBTK
TBTK::IndexDescriptor Class Reference

Describes the index structure of data stored for several indices. More...

#include <IndexDescriptor.h>

Inheritance diagram for TBTK::IndexDescriptor:
TBTK::Serializable

Public Types

enum  Format { None, Ranges, Custom }
 
- Public Types inherited from TBTK::Serializable
enum  Mode { Debug, Binary, XML, JSON }
 

Public Member Functions

 IndexDescriptor (Format format)
 
 IndexDescriptor (const IndexDescriptor &indexDescriptor)
 
 IndexDescriptor (IndexDescriptor &&indexDescriptor)
 
 IndexDescriptor (const std::string &serialization, Mode mode)
 
 ~IndexDescriptor ()
 
IndexDescriptoroperator= (const IndexDescriptor &rhs)
 
IndexDescriptoroperator= (IndexDescriptor &&rhs)
 
Format getFormat () const
 
void setDimensions (unsigned int dimensions)
 
unsigned int getDimensions () const
 
void setRanges (const int *ranges, unsigned int dimensions)
 
std::vector< int > getRanges () const
 
void setIndexTree (const IndexTree &indexTree)
 
const IndexTreegetIndexTree () const
 
int getLinearIndex (const Index &index, bool returnNegativeForMissingIndex=false) const
 
unsigned int getSize () const
 
bool contains (const Index &index) const
 
virtual std::string serialize (Mode mode) const
 

Additional Inherited Members

- 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

Describes the index structure of data stored for several indices.

Member Enumeration Documentation

Enum class determining the storage format.

Constructor & Destructor Documentation

TBTK::IndexDescriptor::IndexDescriptor ( Format  format)

Constructor.

TBTK::IndexDescriptor::IndexDescriptor ( const IndexDescriptor indexDescriptor)

Copy constructor.

TBTK::IndexDescriptor::IndexDescriptor ( IndexDescriptor &&  indexDescriptor)

Move constructor.

TBTK::IndexDescriptor::IndexDescriptor ( const std::string &  serialization,
Mode  mode 
)

Constructor. Construct the IndexDescriptor from a serialization string.

TBTK::IndexDescriptor::~IndexDescriptor ( )

Destructor.

Member Function Documentation

bool TBTK::IndexDescriptor::contains ( const Index index) const
inline

Returns true if the index descriptor contains the given index.

unsigned int TBTK::IndexDescriptor::getDimensions ( ) const
inline

Get dimensions.

IndexDescriptor::Format TBTK::IndexDescriptor::getFormat ( ) const
inline

Get format.

const IndexTree & TBTK::IndexDescriptor::getIndexTree ( ) const
inline

Get IndexTree.

int TBTK::IndexDescriptor::getLinearIndex ( const Index index,
bool  returnNegativeForMissingIndex = false 
) const
inline

Get linear index.

std::vector< int > TBTK::IndexDescriptor::getRanges ( ) const
inline

Get ranges.

unsigned int TBTK::IndexDescriptor::getSize ( ) const

Get size.

IndexDescriptor& TBTK::IndexDescriptor::operator= ( const IndexDescriptor rhs)

Assignment operator.

IndexDescriptor& TBTK::IndexDescriptor::operator= ( IndexDescriptor &&  rhs)

Move assignment operator.

virtual std::string TBTK::IndexDescriptor::serialize ( Mode  mode) const
virtual

Implements Serializable::serializea().

Implements TBTK::Serializable.

void TBTK::IndexDescriptor::setDimensions ( unsigned int  dimensions)
inline

Set dimensions.

void TBTK::IndexDescriptor::setIndexTree ( const IndexTree indexTree)

Get ranges. Set IndexTree.

void TBTK::IndexDescriptor::setRanges ( const int *  ranges,
unsigned int  dimensions 
)
inline

Set ranges.


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