xerus
a general purpose tensor library
xerus::internal::IndexedTensorWritable< tensor_type > Class Template Reference

Abstract internal representation of an read and writeable indexed Tensor or TensorNetwork. More...

#include <indexedTensorReadOnly.h>

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

Public Member Functions

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...
 

Public Attributes

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

 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::IndexedTensorWritable< tensor_type >

Abstract internal representation of an read and writeable indexed Tensor or TensorNetwork.

This class (without specialization) should not appear or be used anywhere.

Definition at line 38 of file indexedTensorReadOnly.h.

Constructor & Destructor Documentation

◆ IndexedTensorWritable() [1/5]

template<class tensor_type >
xerus::internal::IndexedTensorWritable< tensor_type >::IndexedTensorWritable ( )
protecteddelete

There is no usefull default constructor;.

◆ IndexedTensorWritable() [2/5]

template<class tensor_type >
xerus::internal::IndexedTensorWritable< tensor_type >::IndexedTensorWritable ( const IndexedTensorWritable< tensor_type > &  _other)
protecteddelete

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

◆ IndexedTensorWritable() [3/5]

template<class tensor_type >
xerus::internal::IndexedTensorWritable< tensor_type >::IndexedTensorWritable ( IndexedTensorWritable< tensor_type > &&  _other)
protectednoexcept

Move constructor.

Definition at line 39 of file indexedTensorWritable.cpp.

◆ IndexedTensorWritable() [4/5]

template<class tensor_type >
xerus::internal::IndexedTensorWritable< tensor_type >::IndexedTensorWritable ( tensor_type *const  _tensorObject,
const std::vector< Index > &  _indices,
const bool  _takeOwnership 
)
protected

Constructs an IndexedTensorWritable with the given tensor and takes owership of the tensorObject if requested.

Definition at line 45 of file indexedTensorWritable.cpp.

◆ IndexedTensorWritable() [5/5]

template<class tensor_type >
xerus::internal::IndexedTensorWritable< tensor_type >::IndexedTensorWritable ( tensor_type *const  _tensorObject,
std::vector< Index > &&  _indices,
const bool  _takeOwnership 
)
protected

Constructs an IndexedTensorWritable with the given tensor and takes owership of the tensorObject if requested.

Definition at line 50 of file indexedTensorWritable.cpp.

◆ ~IndexedTensorWritable()

template<class tensor_type >
xerus::internal::IndexedTensorWritable< tensor_type >::~IndexedTensorWritable ( )
virtual

Definition at line 55 of file indexedTensorWritable.cpp.

Member Function Documentation

◆ indexed_assignement() [1/6]

template<>
void xerus::internal::IndexedTensorWritable< Tensor >::indexed_assignement ( IndexedTensorReadOnly< Tensor > &&  _rhs)

Definition at line 68 of file indexedTensorWritable.cpp.

◆ indexed_assignement() [2/6]

template<class tensor_type >
void xerus::internal::IndexedTensorWritable< tensor_type >::indexed_assignement ( IndexedTensorReadOnly< Tensor > &&  _rhs)

Tensor assignment with indices.

◆ indexed_assignement() [3/6]

template<class tensor_type >
void xerus::internal::IndexedTensorWritable< tensor_type >::indexed_assignement ( IndexedTensorReadOnly< TensorNetwork > &&  _rhs)

Tensor assignment with indices.

◆ indexed_assignement() [4/6]

template<>
void xerus::internal::IndexedTensorWritable< Tensor >::indexed_assignement ( IndexedTensorReadOnly< TensorNetwork > &&  _rhs)

Definition at line 82 of file indexedTensorWritable.cpp.

◆ indexed_assignement() [5/6]

template<>
void xerus::internal::IndexedTensorWritable< TensorNetwork >::indexed_assignement ( IndexedTensorReadOnly< Tensor > &&  _rhs)

Definition at line 122 of file indexedTensorWritable.cpp.

◆ indexed_assignement() [6/6]

template<>
void xerus::internal::IndexedTensorWritable< TensorNetwork >::indexed_assignement ( IndexedTensorReadOnly< TensorNetwork > &&  _rhs)

Definition at line 127 of file indexedTensorWritable.cpp.

◆ indexed_minus_equal() [1/3]

template<class tensor_type >
void xerus::internal::IndexedTensorWritable< tensor_type >::indexed_minus_equal ( IndexedTensorReadOnly< tensor_type > &&  _rhs)

Tensor subtract_assignment with indices.

◆ indexed_minus_equal() [2/3]

template<>
void xerus::internal::IndexedTensorWritable< Tensor >::indexed_minus_equal ( IndexedTensorReadOnly< Tensor > &&  _rhs)

Definition at line 139 of file indexedTensorWritable.cpp.

◆ indexed_minus_equal() [3/3]

template<>
void xerus::internal::IndexedTensorWritable< TensorNetwork >::indexed_minus_equal ( IndexedTensorReadOnly< TensorNetwork > &&  _rhs)

Definition at line 152 of file indexedTensorWritable.cpp.

◆ indexed_plus_equal() [1/3]

template<class tensor_type >
void xerus::internal::IndexedTensorWritable< tensor_type >::indexed_plus_equal ( IndexedTensorReadOnly< tensor_type > &&  _rhs)

Tensor add_assignment with indices.

◆ indexed_plus_equal() [2/3]

template<>
void xerus::internal::IndexedTensorWritable< Tensor >::indexed_plus_equal ( IndexedTensorReadOnly< Tensor > &&  _rhs)

Definition at line 132 of file indexedTensorWritable.cpp.

◆ indexed_plus_equal() [3/3]

template<>
void xerus::internal::IndexedTensorWritable< TensorNetwork >::indexed_plus_equal ( IndexedTensorReadOnly< TensorNetwork > &&  _rhs)

Definition at line 147 of file indexedTensorWritable.cpp.

◆ is_owner()

template<class tensor_type >
bool xerus::internal::IndexedTensorWritable< tensor_type >::is_owner ( ) const

Check whether the IndexedTensorWritable has ownership of the tensor object.

Definition at line 63 of file indexedTensorWritable.cpp.

◆ perform_traces() [1/2]

template<class tensor_type >
void xerus::internal::IndexedTensorWritable< tensor_type >::perform_traces ( )

: Performes all traces induces by the current indices and therby also evaluates all fixed indices.

◆ perform_traces() [2/2]

template<>
void xerus::internal::IndexedTensorWritable< Tensor >::perform_traces ( )

Definition at line 157 of file indexedTensorWritable.cpp.

Member Data Documentation

◆ deleteTensorObject

template<class tensor_type >
bool xerus::internal::IndexedTensorWritable< tensor_type >::deleteTensorObject

Flag indicating, whether the IndexedTensorWritable is the owner of the tensorObject.

Definition at line 45 of file indexedTensorWritable.h.

◆ tensorObject

template<class tensor_type >
tensor_type* xerus::internal::IndexedTensorWritable< tensor_type >::tensorObject

Non-const pointer to the tensor object.

This must always coincide with tensorObjectReadOnly.

Definition at line 42 of file indexedTensorWritable.h.


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