ExaTN
|
Public Member Functions | |
Tensor (const std::string &name, const TensorShape &shape, const TensorSignature &signature) | |
Tensor (const std::string &name, const TensorShape &shape) | |
template<typename T > | |
Tensor (const std::string &name, std::initializer_list< T > extents, std::initializer_list< std::pair< SpaceId, SubspaceId >> subspaces) | |
template<typename T > | |
Tensor (const std::string &name, const std::vector< T > &extents, const std::vector< std::pair< SpaceId, SubspaceId >> &subspaces) | |
template<typename T > | |
Tensor (const std::string &name, std::initializer_list< T > extents) | |
template<typename T > | |
Tensor (const std::string &name, const std::vector< T > &extents) | |
Tensor (const std::string &name) | |
Tensor (const std::string &name, const Tensor &left_tensor, const Tensor &right_tensor, const std::vector< TensorLeg > &contraction) | |
Tensor (const Tensor &tensor)=default | |
Tensor & | operator= (const Tensor &tensor)=default |
Tensor (Tensor &&tensor) noexcept=default | |
Tensor & | operator= (Tensor &&tensor) noexcept=default |
void | printIt () const |
void | printItFile (std::ofstream &output_file) const |
const std::string & | getName () const |
unsigned int | getRank () const |
const TensorShape & | getShape () const |
const TensorSignature & | getSignature () const |
DimExtent | getDimExtent (unsigned int dim_id) const |
const std::vector< DimExtent > & | getDimExtents () const |
SpaceId | getDimSpaceId (unsigned int dim_id) const |
SubspaceId | getDimSubspaceId (unsigned int dim_id) const |
std::pair< SpaceId, SubspaceId > | getDimSpaceAttr (unsigned int dim_id) const |
bool | isCongruentTo (const Tensor &another) const |
void | deleteDimension (unsigned int dim_id) |
void | appendDimension (std::pair< SpaceId, SubspaceId > subspace, DimExtent dim_extent) |
void | appendDimension (DimExtent dim_extent) |
std::shared_ptr< Tensor > | createSubtensor (const std::string &name, const std::vector< int > &mode_mask, int mask_val) |
void | setElementType (TensorElementType element_type) |
TensorElementType | getElementType () const |
void | registerIsometry (const std::vector< unsigned int > &isometry) |
const std::list< std::vector< unsigned int > > & | retrieveIsometries () const |
TensorHashType | getTensorHash () const |
exatn::numerics::Tensor::Tensor | ( | const std::string & | name, |
const TensorShape & | shape, | ||
const TensorSignature & | signature | ||
) |
Create a tensor by providing its name, shape and signature.
exatn::numerics::Tensor::Tensor | ( | const std::string & | name, |
const TensorShape & | shape | ||
) |
Create a tensor by providing its name and shape. The signature defaults to SOME_SPACE spaces and lbound=0 subspaces.
exatn::numerics::Tensor::Tensor | ( | const std::string & | name, |
std::initializer_list< T > | extents, | ||
std::initializer_list< std::pair< SpaceId, SubspaceId >> | subspaces | ||
) |
Create a tensor by providing its name, shape and signature from scratch.
exatn::numerics::Tensor::Tensor | ( | const std::string & | name, |
std::initializer_list< T > | extents | ||
) |
Create a tensor by providing its name and shape from scratch. The signature defaults to SOME_SPACE spaces and lbound=0 subspaces.
exatn::numerics::Tensor::Tensor | ( | const std::string & | name | ) |
Create a rank-0 tensor (scalar).
exatn::numerics::Tensor::Tensor | ( | const std::string & | name, |
const Tensor & | left_tensor, | ||
const Tensor & | right_tensor, | ||
const std::vector< TensorLeg > & | contraction | ||
) |
Create a tensor by contracting two other tensors. The vector of tensor legs specifies the tensor contraction pattern: contraction[] describes dimensions of both input tensors, first left tensor dimensions, then right tensor dimensions: contraction.size() = left_rank + right_rank; Output tensor id = 0; Left input tensor id = 1; Right input tensor id = 2.
void exatn::numerics::Tensor::appendDimension | ( | std::pair< SpaceId, SubspaceId > | subspace, |
DimExtent | dim_extent | ||
) |
Appends a new dimension to the tensor at the end, increasing the tensor rank by one.
std::shared_ptr< Tensor > exatn::numerics::Tensor::createSubtensor | ( | const std::string & | name, |
const std::vector< int > & | mode_mask, | ||
int | mask_val | ||
) |
Creates a new tensor from the current tensor by selecting a subset of its modes. Vector mode_mask must have the size equal to the original tensor rank: mode_mask[i] == mask_val will select dimension i for appending to the subtensor.
void exatn::numerics::Tensor::deleteDimension | ( | unsigned int | dim_id | ) |
Deletes a specific tensor dimension, reducing the tensor rank by one.
DimExtent exatn::numerics::Tensor::getDimExtent | ( | unsigned int | dim_id | ) | const |
Get the extent of a specific tensor dimension.
const std::vector< DimExtent > & exatn::numerics::Tensor::getDimExtents | ( | ) | const |
Get the extents of all tensor dimensions.
SpaceId exatn::numerics::Tensor::getDimSpaceId | ( | unsigned int | dim_id | ) | const |
Get the space/subspace id for a specific tensor dimension.
TensorElementType exatn::numerics::Tensor::getElementType | ( | ) | const |
Returns the tensor element type.
const std::string & exatn::numerics::Tensor::getName | ( | ) | const |
Get tensor name.
unsigned int exatn::numerics::Tensor::getRank | ( | ) | const |
Get the tensor rank (order).
const TensorShape & exatn::numerics::Tensor::getShape | ( | ) | const |
Get the tensor shape.
const TensorSignature & exatn::numerics::Tensor::getSignature | ( | ) | const |
Get the tensor signature.
TensorHashType exatn::numerics::Tensor::getTensorHash | ( | ) | const |
Get the unique integer tensor id.
bool exatn::numerics::Tensor::isCongruentTo | ( | const Tensor & | another | ) | const |
Returns TRUE if the tensor is congruent to another tensor, that is, it has the same shape and signature.
void exatn::numerics::Tensor::printIt | ( | ) | const |
Print.
void exatn::numerics::Tensor::registerIsometry | ( | const std::vector< unsigned int > & | isometry | ) |
Registers an isometry in the tensor.
const std::list< std::vector< unsigned int > > & exatn::numerics::Tensor::retrieveIsometries | ( | ) | const |
Retrieves the list of all registered isometries in the tensor.
void exatn::numerics::Tensor::setElementType | ( | TensorElementType | element_type | ) |
Sets the tensor element type.