47 template<
typename dtype>
50 return inArray1.
dot(inArray2);
66 template<
typename dtype>
71 const auto shape1 = inArray1.
shape();
72 const auto shape2 = inArray2.shape();
74 if (shape1 == shape2 && (shape1.rows == 1 || shape1.cols == 1))
76 const std::complex<dtype> dotProduct = std::inner_product(inArray1.
cbegin(), inArray1.
cend(),
77 inArray2.cbegin(), std::complex<dtype>{0});
81 if (shape1.cols == shape2.rows)
85 auto array2T = inArray2.transpose();
87 for (
uint32 i = 0; i < shape1.rows; ++i)
91 returnArray(i,
j) = std::inner_product(array2T.cbegin(
j), array2T.cend(
j),
92 inArray1.
cbegin(i), std::complex<dtype>{0});
101 errStr +=
" are not consistent.";
120 template<
typename dtype>
125 const auto shape1 = inArray1.shape();
126 const auto shape2 = inArray2.
shape();
128 if (shape1 == shape2 && (shape1.rows == 1 || shape1.cols == 1))
130 const std::complex<dtype> dotProduct = std::inner_product(inArray1.cbegin(), inArray1.cend(),
131 inArray2.
cbegin(), std::complex<dtype>{0});
135 if (shape1.cols == shape2.rows)
141 for (
uint32 i = 0; i < shape1.rows; ++i)
145 returnArray(i,
j) = std::inner_product(array2T.cbegin(
j), array2T.cend(
j),
146 inArray1.cbegin(i), std::complex<dtype>{0});
155 errStr +=
" are not consistent.";