25 namespace MultiDimensional {
27 using VTensor = VectorContainer;
28 using STensor = SparseContainer;
30 using Base = IContainer;
37 for(; ita != a.
end(); ++itb, ++ita) {
44 auto first1 = a.
begin();
45 auto first2 = b.
begin();
46 while (first1 != a.
end()) {
47 if (first2 == b.
end())
49 if (first1->first < first2->first) {
54 if (!(first2->first < first1->first)) {
55 first1->second *= first2->second;
67 auto first2 = b.
begin();
69 if (first2 == b.
end()) {
70 for(
size_t m = n; m<oldsize; ++m) {
75 if (n < b.
getIndexing().alignedPosToPos(first2->first)) {
79 if (!(b.
getIndexing().alignedPosToPos(first2->first) < n)) {
80 a[n] *= first2->second;
90 for (
auto& elem : a) {
91 elem.second *= b[a.getIndexing().alignedPosToPos(elem.first)];
98 auto result = this->operator()(*tmp, a);
104 auto result = this->operator()(*tmp, a);
114 for (
auto elem : bf) {
121 throw Error(
"Invalid data types for tensor Multiply");
DataType::const_iterator const_iterator
const LabeledIndexing< AlignedIndexing > & getIndexing() const
DataType::iterator iterator
Non-sparse tensor data container.
(Sum of) Outer product tensor data container
Hammer exception definitions.
size_t numValues() const override
Sparse tensor data container.
virtual IndexList dims() const =0
iterator erase(const_iterator first, const_iterator last)
Tensor element-wise multiplication algorithm.
Generic tensor indexing iterator.
virtual reference element(const IndexList &coords={})=0