46 template<
typename dtype>
49 return inArray1.
dot(inArray2);
65 template<
typename dtype>
70 const auto shape1 = inArray1.
shape();
71 const auto shape2 = inArray2.shape();
73 if (shape1 == shape2 && (shape1.rows == 1 || shape1.cols == 1))
75 const std::complex<dtype> dotProduct = std::inner_product(inArray1.
cbegin(), inArray1.
cend(),
76 inArray2.cbegin(), std::complex<dtype>{0});
80 if (shape1.cols == shape2.rows)
84 auto array2T = inArray2.transpose();
86 for (
uint32 i = 0; i < shape1.rows; ++i)
90 returnArray(i,
j) = std::inner_product(array2T.cbegin(
j), array2T.cend(
j),
91 inArray1.
cbegin(i), std::complex<dtype>{0});
100 errStr +=
" are not consistent.";
119 template<
typename dtype>
124 const auto shape1 = inArray1.shape();
125 const auto shape2 = inArray2.
shape();
127 if (shape1 == shape2 && (shape1.rows == 1 || shape1.cols == 1))
129 const std::complex<dtype> dotProduct = std::inner_product(inArray1.cbegin(), inArray1.cend(),
130 inArray2.
cbegin(), std::complex<dtype>{0});
134 if (shape1.cols == shape2.rows)
140 for (
uint32 i = 0; i < shape1.rows; ++i)
144 returnArray(i,
j) = std::inner_product(array2T.cbegin(
j), array2T.cend(
j),
145 inArray1.cbegin(i), std::complex<dtype>{0});
154 errStr +=
" are not consistent.";