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 else 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});
102 errStr +=
" are not consistent.";
122 template<
typename dtype>
127 const auto shape1 = inArray1.shape();
128 const auto shape2 = inArray2.
shape();
130 if (shape1 == shape2 && (shape1.rows == 1 || shape1.cols == 1))
132 const std::complex<dtype> dotProduct = std::inner_product(inArray1.cbegin(), inArray1.cend(),
133 inArray2.
cbegin(), std::complex<dtype>{0});
137 else if (shape1.cols == shape2.rows)
143 for (
uint32 i = 0; i < shape1.rows; ++i)
147 returnArray(i,
j) = std::inner_product(array2T.cbegin(
j), array2T.cend(
j),
148 inArray1.cbegin(i), std::complex<dtype>{0});
158 errStr +=
" are not consistent.";