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))
79 std::complex<dtype>{ 0 });
83 if (shape1.cols == shape2.rows)
87 auto array2T = inArray2.transpose();
89 for (
uint32 i = 0; i < shape1.rows; ++i)
96 std::complex<dtype>{ 0 });
105 errStr +=
" are not consistent.";
124 template<
typename dtype>
129 const auto shape1 = inArray1.shape();
130 const auto shape2 = inArray2.
shape();
132 if (shape1 == shape2 && (shape1.rows == 1 || shape1.cols == 1))
137 std::complex<dtype>{ 0 });
141 if (shape1.cols == shape2.rows)
147 for (
uint32 i = 0; i < shape1.rows; ++i)
154 std::complex<dtype>{ 0 });
163 errStr +=
" are not consistent.";
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:39
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:139
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1365
self_type transpose() const
Definition: NdArrayCore.hpp:4963
self_type dot(const self_type &inOtherArray) const
Definition: NdArrayCore.hpp:2795
const Shape & shape() const noexcept
Definition: NdArrayCore.hpp:4591
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1673
constexpr auto j
Definition: Core/Constants.hpp:42
T transform_reduce(ForwardIt1 first1, ForwardIt1 last1, ForwardIt2 first2, T init)
Definition: StlAlgorithms.hpp:825
std::string num2str(dtype inNumber)
Definition: num2str.hpp:44
Definition: Cartesian.hpp:40
NdArray< dtype > dot(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition: dot.hpp:48
std::uint32_t uint32
Definition: Types.hpp:40