39 std::vector<Index> orderA;
40 std::vector<Index> orderB;
41 std::vector<Index> orderX;
44 for(
const Index& idx : _A.indices) {
45 if(misc::contains(
_b.indices, idx)) {
46 orderA.push_back(idx);
48 orderX.push_back(idx);
56 orderA.insert(orderA.end(), orderX.begin(), orderX.end());
59 for(
const Index& idx :
_b.indices) {
60 if(!misc::contains(_A.indices, idx)) {
61 orderB.push_back(idx);
62 orderX.push_back(idx);
63 for(
size_t i = 0; i < idx.
span; ++i) {
70 Tensor reorderedA, reorderedB;
71 reorderedA(orderA) = std::move(_A);
72 reorderedB(orderB) = std::move(
_b);
Internal representation of an read and write and moveable indexed Tensor or TensorNetwork.
Header file for the Index class.
Header file for the IndexedTensorMoveable class.
Header file for the standard contaienr support functions.
Internal representation of an readable indexed Tensor or TensorNetwork.
The main namespace of xerus.
Class that handles simple (non-decomposed) tensors in a dense or sparse representation.
void solve(internal::IndexedTensorWritable< Tensor > &&_x, internal::IndexedTensorReadOnly< Tensor > &&_A, internal::IndexedTensorReadOnly< Tensor > &&_b)
Header file for the Tensor class.
tensor_type * tensorObject
Non-const pointer to the tensor object.
Header file for comfort functions and macros that should not be exported in the library.
Class used to represent indices that can be used to write tensor calculations in index notation...
size_t span
The span states how many dimensions are covered by the index.
internal::IndexedTensorMoveable< Tensor > operator/(internal::IndexedTensorReadOnly< Tensor > &&_b, internal::IndexedTensorReadOnly< Tensor > &&_A)
Header file for the IndexedTensor class.