mptensor  v0.3.0
Parallel Library for Tensor Network Methods
mptensor::Index Class Reference

#include <index.hpp>

Public Types

typedef std::vector< size_t > index_t
 

Public Member Functions

 Index ()
 
 Index (const index_t &index)
 
const size_t & operator[] (size_t i) const
 
size_t & operator[] (size_t i)
 
size_t size () const
 
void push (size_t i)
 
void resize (size_t n)
 
void assign (size_t n, size_t j[])
 
void sort ()
 
Index inverse ()
 
bool operator== (const Index &) const
 
Indexoperator+= (const Index &)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, const Index &idx)
 
Index operator+ (const Index &lhs, const Index &rhs)
 Joint two indices. More...
 

Member Typedef Documentation

◆ index_t

typedef std::vector<size_t> mptensor::Index::index_t

Constructor & Destructor Documentation

◆ Index() [1/2]

mptensor::Index::Index ( )
inline

◆ Index() [2/2]

mptensor::Index::Index ( const index_t index)
inline

Member Function Documentation

◆ assign()

void mptensor::Index::assign ( size_t  n,
size_t  j[] 
)

◆ inverse()

Index mptensor::Index::inverse ( )

◆ operator+=()

Index & mptensor::Index::operator+= ( const Index rhs)

◆ operator==()

bool mptensor::Index::operator== ( const Index rhs) const

◆ operator[]() [1/2]

size_t & mptensor::Index::operator[] ( size_t  i)
inline

◆ operator[]() [2/2]

const size_t & mptensor::Index::operator[] ( size_t  i) const
inline

◆ push()

void mptensor::Index::push ( size_t  i)
inline

◆ resize()

void mptensor::Index::resize ( size_t  n)
inline

◆ size()

size_t mptensor::Index::size ( ) const
inline

◆ sort()

void mptensor::Index::sort ( )

Friends And Related Function Documentation

◆ operator+()

Index operator+ ( const Index lhs,
const Index rhs 
)
related

Joint two indices.

Index(0,1) + Index(2,3) = Index(0,1,2,3)

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const Index idx 
)
related

The format is the same as a list of python, for example "[0, 1, 2]".


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