Go to the documentation of this file.
23 #ifndef COM_DAFER45_TBTK_SUBINDEX
24 #define COM_DAFER45_TBTK_SUBINDEX
30 #ifndef TBTK_DISABLE_NLOHMANN_JSON
31 # include "TBTK/json.hpp"
36 #if TBTK_WRAP_PRIMITIVE_TYPES
113 constexpr
Subindex(
unsigned int value) : value(value) {}
175 constexpr
operator int()
const{
return value; };
312 os << subindex.value;
340 #ifndef TBTK_DISABLE_NLOHMANN_JSON
395 constexpr
Subindex IDX_ALL = (int)(0xBFFFFFFF & ~0x20000000);
397 constexpr
Subindex IDX_SUM_ALL = (int)(0xBFFFFFFF & ~0x20000001);
398 constexpr
Subindex IDX_SPIN = (int)(0xBFFFFFFF & ~0x20000002);
399 constexpr
Subindex IDX_SEPARATOR = (int)(0xBFFFFFFF & ~0x20000003);
400 constexpr
Subindex IDX_ALL_ = (int)(0xBFFFFFFF & ~0x10000000);
402 constexpr
Subindex IDX_RANGE = (int)(0xBFFFFFFF & ~0x08000000);
403 constexpr
Subindex IDX_X = (int)(IDX_RANGE & ~0x00000000);
404 constexpr
Subindex IDX_Y = (int)(IDX_RANGE & ~0x00000001);
405 constexpr
Subindex IDX_Z = (int)(IDX_RANGE & ~0x00000002);
408 const std::string &serialization,
411 value(serialization, mode)
416 return value == IDX_ALL;
426 "Subindex::getWildcardLabel()",
427 "The Subindex is not a labeled wildcard.",
438 return value == IDX_SUM_ALL;
446 return value == IDX_SPIN;
450 return value == IDX_SEPARATOR;
455 value == IDX_ALL_.value,
456 "Subindex::operator()",
457 "Unsupported subindex type. This function is only supported"
458 <<
" for the IDX_ALL_ Subindex.",
Integer number.
Definition: Integer.h:37
friend void from_json(const nlohmann::json &j, Subindex &subindex)
Definition: Subindex.h:353
Subindex & operator++()
Definition: Subindex.h:253
bool isSummationIndex() const
Definition: Subindex.h:437
constexpr Subindex(int value)
Definition: Subindex.h:107
Subindex getWildcardLabel() const
Definition: Subindex.h:423
bool isIndexSeparator() const
Definition: Subindex.h:449
bool isLabeledWildcard() const
Definition: Subindex.h:419
Subindex & operator=(Integer rhs)
Definition: Subindex.h:183
friend void to_json(nlohmann::json &j, const Subindex &subindex)
Definition: Subindex.h:345
Subindex & operator--()
Definition: Subindex.h:274
constexpr Subindex IDX_FLAG_MASK
Special subindex values.
Definition: Subindex.h:394
std::string serialize(Serializable::Mode mode) const
Definition: Subindex.h:465
std::string serialize(Serializable::Mode mode) const
Definition: Integer.h:199
bool isRangeIndex() const
Definition: Subindex.h:441
bool isWildcard() const
Definition: Subindex.h:415
Subindex()
Definition: Subindex.h:95
Subindex & operator*=(Subindex rhs)
Definition: Subindex.h:231
bool isSpinIndex() const
Definition: Subindex.h:445
constexpr Subindex(Integer value)
Definition: Subindex.h:101
Subindex & operator-=(Subindex rhs)
Definition: Subindex.h:219
friend std::ostream & operator<<(std::ostream &os, const Subindex subindex)
Definition: Subindex.h:311
Subindex operator--(int)
Definition: Subindex.h:284
Subindex & operator+=(Subindex rhs)
Definition: Subindex.h:207
friend std::istream & operator>>(std::istream &is, Subindex &subindex)
Definition: Subindex.h:323
An entry in an Index.
Definition: Subindex.h:91
Base class for psudo-serializable objects.
constexpr Subindex(unsigned int value)
Definition: Subindex.h:113
Subindex & operator/=(Subindex rhs)
Definition: Subindex.h:243
Mode
Definition: Serializable.h:47
Subindex & operator=(int rhs)
Definition: Subindex.h:195
Subindex operator++(int)
Definition: Subindex.h:263
Definition: PseudoSerializable.h:31
Subindex operator()(unsigned int label) const
Definition: Subindex.h:453