 |
NumCpp
2.1.0
A C++ implementation of the Python Numpy library
|
Go to the documentation of this file.
64 template<
typename dtype>
69 const auto wkShape = wk.
shape();
70 if (wkShape.cols != 3)
75 const auto vkShape = vk.
shape();
76 if (vkShape.cols != 3)
81 if (wkShape.rows != vkShape.rows)
86 if (ak.
size() != wkShape.rows)
91 auto b = zeros<dtype>(3, 3);
92 const auto cSlice = wk.
cSlice();
93 for (
uint32 row = 0; row < wkShape.rows; ++row)
95 const auto wkVec = wk(row, cSlice);
96 const auto vkVec = vk(row, cSlice);
97 b += ak[row] *
dot(wkVec.transpose(), vkVec);
106 auto m = eye<double>(3, 3);
111 return dot(u,
dot(m, vt));
127 template<
typename dtype>
130 const auto ak = ones<dtype>({1, wk.
shape().rows});
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4312
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:38
NdArray< dtype > transpose() const
Definition: NdArrayCore.hpp:4608
NdArray< dtype > dot(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition: dot.hpp:48
std::uint32_t uint32
Definition: Types.hpp:41
Slice cSlice(int32 inStartIdx=0, uint32 inStepSize=1) const noexcept
Definition: NdArrayCore.hpp:891
void svd(const NdArray< dtype > &inArray, NdArray< double > &outU, NdArray< double > &outS, NdArray< double > &outVt)
Definition: svd.hpp:54
size_type size() const noexcept
Definition: NdArrayCore.hpp:4326
Definition: Coordinate.hpp:45
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
dtype det(const NdArray< dtype > &inArray)
Definition: det.hpp:57
NdArray< double > wahbasProblem(const NdArray< dtype > &wk, const NdArray< dtype > &vk, const NdArray< dtype > &ak)
Definition: wahbasProblem.hpp:65