xerus
a general purpose tensor library
xerus::internal::IndexedTensorMoveable< tensor_type > Class Template Referencefinal

Internal representation of an read and write and moveable indexed Tensor or TensorNetwork. More...

#include <indexedTensorMoveable.h>

Inheritance diagram for xerus::internal::IndexedTensorMoveable< tensor_type >:
Collaboration diagram for xerus::internal::IndexedTensorMoveable< tensor_type >:

Public Member Functions

 IndexedTensorMoveable ()
 Creates an empty indexed Tensor, should only be used internally. More...
 
 IndexedTensorMoveable (const IndexedTensorMoveable &_other)=delete
 There is no usefull copy constructor, because the handling of the tensorObject is unclear. More...
 
template<>
 IndexedTensorMoveable (IndexedTensorReadOnly< TensorNetwork > &&_other)
 
 IndexedTensorMoveable (IndexedTensorMoveable &&_other) noexcept
 Move constructor. More...
 
 IndexedTensorMoveable (tensor_type *const _tensorObject, const std::vector< Index > &_indices)
 Constructs an IndexedTensorMoveable with the given tensor and indices and if ordered to do so takes ownership of the tensorObject. More...
 
template<>
 IndexedTensorMoveable (IndexedTensorReadOnly< Tensor > &&_other)
 
 IndexedTensorMoveable (tensor_type *const _tensorObject, std::vector< Index > &&_indices)
 Constructs an IndexedTensorMoveable with the given tensor and indices and if ordered to do so takes ownership of the tensorObject. More...
 
template<>
 IndexedTensorMoveable (IndexedTensorReadOnly< Tensor > &&_other)
 
 IndexedTensorMoveable (IndexedTensorReadOnly< tensor_type > &&_other)
 Allow explicit cast from IndexedTensorReadOnly. More...
 
template<>
 IndexedTensorMoveable (IndexedTensorReadOnly< TensorNetwork > &&_other)
 
template<class X = tensor_type, typename std::enable_if< std::is_base_of< Tensor, typename std::decay< X >::type >::value, int >::type = 0>
 IndexedTensorMoveable (IndexedTensorReadOnly< TensorNetwork > &&_other)
 Allow explicit conversions from indexed TensorNetworks to indexed Tensors. More...
 
template<class X = tensor_type>
 IndexedTensorMoveable (IndexedTensorReadOnly< Tensor > &&_other)
 Allow implicit conversions from indexed Tensors to indexed TensorNetworks. More...
 
template<class X = tensor_type>
 IndexedTensorMoveable (IndexedTensorReadOnly< Tensor > &_other)
 
- Public Member Functions inherited from xerus::internal::IndexedTensorWritable< tensor_type >
virtual ~IndexedTensorWritable ()
 
template<>
void indexed_assignement (IndexedTensorReadOnly< Tensor > &&_rhs)
 
void indexed_assignement (IndexedTensorReadOnly< Tensor > &&_rhs)
 Tensor assignment with indices. More...
 
void indexed_assignement (IndexedTensorReadOnly< TensorNetwork > &&_rhs)
 Tensor assignment with indices. More...
 
template<>
void indexed_assignement (IndexedTensorReadOnly< TensorNetwork > &&_rhs)
 
template<>
void indexed_assignement (IndexedTensorReadOnly< Tensor > &&_rhs)
 
template<>
void indexed_assignement (IndexedTensorReadOnly< TensorNetwork > &&_rhs)
 
void indexed_minus_equal (IndexedTensorReadOnly< tensor_type > &&_rhs)
 Tensor subtract_assignment with indices. More...
 
template<>
void indexed_minus_equal (IndexedTensorReadOnly< Tensor > &&_rhs)
 
template<>
void indexed_minus_equal (IndexedTensorReadOnly< TensorNetwork > &&_rhs)
 
void indexed_plus_equal (IndexedTensorReadOnly< tensor_type > &&_rhs)
 Tensor add_assignment with indices. More...
 
template<>
void indexed_plus_equal (IndexedTensorReadOnly< Tensor > &&_rhs)
 
template<>
void indexed_plus_equal (IndexedTensorReadOnly< TensorNetwork > &&_rhs)
 
bool is_owner () const
 Check whether the IndexedTensorWritable has ownership of the tensor object. More...
 
void perform_traces ()
 : Performes all traces induces by the current indices and therby also evaluates all fixed indices. More...
 
template<>
void perform_traces ()
 
- Public Member Functions inherited from xerus::internal::IndexedTensorReadOnly< tensor_type >
 IndexedTensorReadOnly ()=delete
 There is no usefull default constructor. More...
 
 IndexedTensorReadOnly (const IndexedTensorReadOnly &_other)=delete
 There is no usefull copy constructor for IndexedTensors. More...
 
 IndexedTensorReadOnly (IndexedTensorReadOnly< tensor_type > &&_other) noexcept
 Move-constructor. More...
 
 IndexedTensorReadOnly (const tensor_type *const _tensorObjectReadOnly, std::vector< Index > _indices)
 Constructs an IndexedTensorReadOnly using the given pointer and indices. More...
 
virtual ~IndexedTensorReadOnly ()
 Destructor must be virtual. More...
 
void assign_index_dimensions ()
 Assignes the indices using the current tensorObejct. More...
 
void assign_indices ()
 Assignes the indices using the degree of the tensorObejct. More...
 
void assign_indices (const size_t _degree)
 Assignes the indices assuming the given degree. More...
 
size_t degree () const
 Returns the degree of the associated tensorObejct. More...
 
std::vector< size_t > get_evaluated_dimensions (const std::vector< Index > &_indexOrder)
 Returns the dimensionTuple the evaluation of this IndexedTensor to the given indices would have. More...
 
 operator value_t () const
 Allows cast to value_t if the degree of the current object is equal to 0. More...
 
void operator= (const IndexedTensorReadOnly &_rhs)=delete
 : IndexedTensorReadOnly cannot be assigned as they are read only. More...
 
void operator= (IndexedTensorReadOnly &&_rhs)=delete
 : IndexedTensorReadOnly cannot be assigned as they are read only. More...
 
bool uses_tensor (const tensor_type *_otherTensor) const
 Checks whether _otherTensor is the tensorObejct of this IndexTensor. More...
 

Additional Inherited Members

- Public Attributes inherited from xerus::internal::IndexedTensorWritable< tensor_type >
bool deleteTensorObject
 Flag indicating, whether the IndexedTensorWritable is the owner of the tensorObject. More...
 
tensor_type * tensorObject
 Non-const pointer to the tensor object. More...
 
- Public Attributes inherited from xerus::internal::IndexedTensorReadOnly< tensor_type >
std::vector< Indexindices
 Vector of the associates indices. More...
 
bool indicesAssigned = false
 Flag indicating whether the indices are assinged. More...
 
const tensor_type * tensorObjectReadOnly
 Pointer to the associated Tensor/TensorNetwork object. More...
 
- Protected Member Functions inherited from xerus::internal::IndexedTensorWritable< tensor_type >
 IndexedTensorWritable ()=delete
 There is no usefull default constructor;. More...
 
 IndexedTensorWritable (const IndexedTensorWritable &_other)=delete
 There is no usefull copy constructor, because the handling of the tensorObject is unclear. More...
 
 IndexedTensorWritable (IndexedTensorWritable &&_other) noexcept
 Move constructor. More...
 
 IndexedTensorWritable (tensor_type *const _tensorObject, const std::vector< Index > &_indices, const bool _takeOwnership)
 Constructs an IndexedTensorWritable with the given tensor and takes owership of the tensorObject if requested. More...
 
 IndexedTensorWritable (tensor_type *const _tensorObject, std::vector< Index > &&_indices, const bool _takeOwnership)
 Constructs an IndexedTensorWritable with the given tensor and takes owership of the tensorObject if requested. More...
 

Detailed Description

template<class tensor_type>
class xerus::internal::IndexedTensorMoveable< tensor_type >

Internal representation of an read and write and moveable indexed Tensor or TensorNetwork.

This class appears inplicitly by indexing any Tensor or TensorNetwork. It is not recommended to use it explicitly or to store variables of this type (unless you really know what you are doing).

Definition at line 38 of file indexedTensorMoveable.h.

Constructor & Destructor Documentation

◆ IndexedTensorMoveable() [1/13]

template<class tensor_type >
xerus::internal::IndexedTensorMoveable< tensor_type >::IndexedTensorMoveable ( )

Creates an empty indexed Tensor, should only be used internally.

Definition at line 34 of file indexedTensorMoveable.cpp.

◆ IndexedTensorMoveable() [2/13]

template<class tensor_type>
xerus::internal::IndexedTensorMoveable< tensor_type >::IndexedTensorMoveable ( const IndexedTensorMoveable< tensor_type > &  _other)
delete

There is no usefull copy constructor, because the handling of the tensorObject is unclear.

◆ IndexedTensorMoveable() [3/13]

template<class tensor_type >
xerus::internal::IndexedTensorMoveable< tensor_type >::IndexedTensorMoveable ( IndexedTensorMoveable< tensor_type > &&  _other)
noexcept

Move constructor.

Definition at line 37 of file indexedTensorMoveable.cpp.

◆ IndexedTensorMoveable() [4/13]

template<class tensor_type >
xerus::internal::IndexedTensorMoveable< tensor_type >::IndexedTensorMoveable ( tensor_type *const  _tensorObject,
const std::vector< Index > &  _indices 
)

Constructs an IndexedTensorMoveable with the given tensor and indices and if ordered to do so takes ownership of the tensorObject.

Definition at line 40 of file indexedTensorMoveable.cpp.

◆ IndexedTensorMoveable() [5/13]

template<class tensor_type >
xerus::internal::IndexedTensorMoveable< tensor_type >::IndexedTensorMoveable ( tensor_type *const  _tensorObject,
std::vector< Index > &&  _indices 
)

Constructs an IndexedTensorMoveable with the given tensor and indices and if ordered to do so takes ownership of the tensorObject.

Definition at line 43 of file indexedTensorMoveable.cpp.

◆ IndexedTensorMoveable() [6/13]

template<class tensor_type>
xerus::internal::IndexedTensorMoveable< tensor_type >::IndexedTensorMoveable ( IndexedTensorReadOnly< tensor_type > &&  _other)
explicit

Allow explicit cast from IndexedTensorReadOnly.

◆ IndexedTensorMoveable() [7/13]

template<class tensor_type>
template<class X = tensor_type, typename std::enable_if< std::is_base_of< Tensor, typename std::decay< X >::type >::value, int >::type = 0>
xerus::internal::IndexedTensorMoveable< tensor_type >::IndexedTensorMoveable ( IndexedTensorReadOnly< TensorNetwork > &&  _other)
explicit

Allow explicit conversions from indexed TensorNetworks to indexed Tensors.

◆ IndexedTensorMoveable() [8/13]

template<class tensor_type>
template<class X = tensor_type>
xerus::internal::IndexedTensorMoveable< tensor_type >::IndexedTensorMoveable ( IndexedTensorReadOnly< Tensor > &&  _other)

Allow implicit conversions from indexed Tensors to indexed TensorNetworks.

◆ IndexedTensorMoveable() [9/13]

template<class tensor_type>
template<class X = tensor_type>
xerus::internal::IndexedTensorMoveable< tensor_type >::IndexedTensorMoveable ( IndexedTensorReadOnly< Tensor > &  _other)
inline

Definition at line 75 of file indexedTensorMoveable.h.

◆ IndexedTensorMoveable() [10/13]

◆ IndexedTensorMoveable() [11/13]

◆ IndexedTensorMoveable() [12/13]

◆ IndexedTensorMoveable() [13/13]


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