GraceQ/MPS2
A high-performance matrix product state algorithms library based on GraceQ/tensor
|
A fix size tensor vector. More...
#include <ten_vec.h>
Public Member Functions | |
TenVec (const size_t size) | |
Create a TenVec using its size. More... | |
void | LoadTen (const size_t idx, const std::string &file) |
Load element tensor from a file. More... | |
void | DumpTen (const size_t idx, const std::string &file) const |
Dump element tensor to a file. More... | |
void | DumpTen (const size_t idx, const std::string &file, const bool release_mem=false) |
Dump element tensor to a file. More... | |
Public Member Functions inherited from gqmps2::DuoVector< TenT > | |
DuoVector (void)=default | |
Default constructor. | |
DuoVector (const size_t size) | |
Create a DuoVector using its size. More... | |
DuoVector (const DuoVector &duovec) | |
Create a DuoVector by copying another DuoVector. More... | |
DuoVector (DuoVector &&duovec) noexcept | |
Create a DuoVector by moving raw data from another DuoVector instance. More... | |
DuoVector< TenT > & | operator= (const DuoVector &rhs) |
Copy a DuoVector. More... | |
DuoVector< TenT > & | operator= (DuoVector &&rhs) noexcept |
Move a DuoVector. More... | |
virtual | ~DuoVector (void) |
Destruct a DuoVector. More... | |
const TenT & | operator[] (const size_t idx) const |
Element getter. More... | |
TenT & | operator[] (const size_t idx) |
Element setter. More... | |
const TenT * | operator() (const size_t idx) const |
Pointer-of-element getter. More... | |
TenT *& | operator() (const size_t idx) |
Pointer-of-element setter. More... | |
TenT & | front (void) |
Access the first element. | |
const TenT & | front (void) const |
TenT & | back (void) |
Access the last element. | |
const TenT & | back (void) const |
const std::vector< const TenT *> | cdata (void) const |
Read-only raw data access. | |
void | alloc (const size_t idx) |
Allocate memory of the element at given index. More... | |
void | dealloc (const size_t idx) |
Deallocate memory of the element at given index. More... | |
void | clear (void) |
Deallocate all elements. | |
size_t | size (void) const |
Get the size of the DuoVector. | |
bool | empty (void) const |
Check whether the vector is empty. | |
A fix size tensor vector.
TenT | Type of the element tensor. |
|
inline |
Create a TenVec using its size.
size | The size of the vector. |
|
inline |
Dump element tensor to a file.
idx | The index of the element. |
file | The element tensor will be dumped to this file. |
|
inline |
Dump element tensor to a file.
idx | The index of the element. |
file | The element tensor will be dumped to this file. |
release_mem | Whether release memory after dump. |
|
inline |
Load element tensor from a file.
idx | The index of the element. |
file | The file which contains the tensor to be loaded. |