xerus
a general purpose tensor library
indexedTensor.cpp
Go to the documentation of this file.
1 // Xerus - A General Purpose Tensor Library
2 // Copyright (C) 2014-2017 Benjamin Huber and Sebastian Wolf.
3 //
4 // Xerus is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as published
6 // by the Free Software Foundation, either version 3 of the License,
7 // or (at your option) any later version.
8 //
9 // Xerus is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
13 //
14 // You should have received a copy of the GNU Affero General Public License
15 // along with Xerus. If not, see <http://www.gnu.org/licenses/>.
16 //
17 // For further information on Xerus visit https://libXerus.org
18 // or contact us at contact@libXerus.org.
19 
25 #include <xerus/indexedTensor.h>
26 
27 #include <xerus/index.h>
28 #include <xerus/tensor.h>
29 #include <xerus/tensorNetwork.h>
30 #include <xerus/misc/internal.h>
31 
32 namespace xerus {
33  namespace internal {
34  template<class tensor_type>
36 
37  template<class tensor_type>
38  IndexedTensor<tensor_type>::IndexedTensor(tensor_type* const _tensorObject, const std::vector<Index>& _indices, const bool _takeOwnership) :
39  IndexedTensorWritable<tensor_type>(_tensorObject, _indices, _takeOwnership) {}
40 
41  template<class tensor_type>
42  IndexedTensor<tensor_type>::IndexedTensor(tensor_type* const _tensorObject, std::vector<Index>&& _indices, const bool _takeOwnership) :
43  IndexedTensorWritable<tensor_type>(_tensorObject, std::move(_indices), _takeOwnership) {}
44 
45 
46 
47  template<class tensor_type>
49  this->indexed_assignement(std::move(_rhs));
50  }
51 
52  template<class tensor_type>
54  this->indexed_assignement(std::move(_rhs));
55  }
56 
57  template<class tensor_type>
59  this->indexed_assignement(std::move(_rhs));
60  }
61 
62  template<class tensor_type>
64  this->indexed_plus_equal(std::move(_rhs));
65  }
66 
67  template<class tensor_type>
69  this->indexed_minus_equal(std::move(_rhs));
70  }
71 
72  // IndexedTensorReadOnly may be instanciated as
73  template class IndexedTensor<Tensor>;
74  template class IndexedTensor<TensorNetwork>;
75  } // namespace internal
76 } // namespace xerus
Header file for the Index class.
Internal representation of an readable indexed Tensor or TensorNetwork.
The main namespace of xerus.
Definition: basic.h:37
STL namespace.
Header file for the Tensor class.
Internal representation of an readable and writeable indexed Tensor or TensorNetwork.
Definition: indexedTensor.h:37
Header file for comfort functions and macros that should not be exported in the library.
Abstract internal representation of an read and writeable indexed Tensor or TensorNetwork.
IndexedTensor(const IndexedTensor &_other)=delete
There is no usefull copy constructor, because the handling of the tensorObject is unclear...
Header file for the TensorNetwork class.
Header file for the IndexedTensor class.