TBTK
|
Need a break? Support the development by playing Polarity Puzzles |
Physical index. More...
#include <Index.h>
Public Member Functions | |
Index () | |
Index (std::initializer_list< Subindex > i) | |
Index (std::vector< Subindex > i) | |
Index (const Index &index) | |
Index (const Index &head, const Index &tail) | |
Index (const std::vector< std::vector< Subindex >> &indexList) | |
Index (std::initializer_list< Index > indexList) | |
Index (std::vector< Index > indexList) | |
Index (const std::string &indexString) | |
Index (const std::string &serialization, Serializable::Mode mode) | |
bool | equals (const Index &index, bool allowWildcard=false) const |
Subindex & | at (unsigned int n) |
const Subindex & | at (unsigned int n) const |
unsigned int | getSize () const |
void | reserve (unsigned int size) |
void | pushBack (Subindex subindex) |
Subindex | popFront () |
Subindex | popBack () |
void | insert (unsigned int n, Subindex subindex) |
Subindex | erase (unsigned int n) |
Index | getUnitRange () |
Index | getSubIndex (int first, int last) const |
std::vector< Index > | split () const |
bool | isPatternIndex () const |
void | print () const |
std::string | toString () const |
Subindex & | operator[] (unsigned int subindex) |
const Subindex & | operator[] (unsigned int subindex) const |
std::string | serialize (Serializable::Mode mode) const |
unsigned int | getSizeInBytes () const |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Index &index) |
bool | operator< (const Index &i1, const Index &i2) |
bool | operator> (const Index &i1, const Index &i2) |
Physical index.
An Index is a list of Subindices. For example, {x, y, spin}, {x, y, z, orbital, spin}, and {subsystem, x, y, z, orbital, spin}.
|
inline |
Constructs an empty Index.
|
inline |
|
inline |
|
inline |
TBTK::Index::Index | ( | const std::vector< std::vector< Subindex >> & | indexList | ) |
TBTK::Index::Index | ( | std::initializer_list< Index > | indexList | ) |
Constructs a compound Index by Concatenating a list of indices, adding IDX_SEPARATOR between every index.
indexList | List of indices. |
TBTK::Index::Index | ( | std::vector< Index > | indexList | ) |
Constructs a compound Index by Concatenating a list of indices, adding IDX_SEPARATOR between every index.
indexList | List of indices. |
TBTK::Index::Index | ( | const std::string & | indexString | ) |
TBTK::Index::Index | ( | const std::string & | serialization, |
Serializable::Mode | mode | ||
) |
|
inline |
|
inline |
|
inline |
Compare this index with another index. Returns true if the indices have the same number of subindices and all subindices are equal.
index | Index to compare with. |
allowWildcard | IDX_ALL is interpreted as wildcard. |
|
inline |
|
inline |
Get size.
|
inline |
Get size in bytes.
Index TBTK::Index::getSubIndex | ( | int | first, |
int | last | ||
) | const |
Returns an Index containing the subindices from position 'first' to 'last'.
@parameter first First index to include in range (inclusive). @parameter last Last index to include in range (inclusive).
Index TBTK::Index::getUnitRange | ( | ) |
Returns an index with the same number or subindices, and each subindex set to 1.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Removes and returns the last subindex.
|
inline |
Removes and returns the first subindex.
|
inline |
Print index. Mainly for debuging.
|
inline |
|
inline |
Reserves memory for the Index.
Number | of subindices to reserve space for. |
std::string TBTK::Index::serialize | ( | Serializable::Mode | mode | ) | const |
Serialize Index. Note that Index is pseudo-Serializable in that it implements the Serializable interface, but does so non-virtually.
mode | Serialization mode to use. |
|
inline |
|
inline |
Comparison operator. Returns false if the TreeNode structure would generate a smaller Hilbert space index for i1 than for i2.
|
friend |
Writes the Index toString()-representation to a stream.
stream | The stream to write to. |
index | The Index to write. |
Comparison operator. Returns false if the TreeNode structure would generate a larger Hilbert space index for i1 than for i2.