 |
NumCpp
2.4.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
|
Go to the documentation of this file.
63 template<
typename dtype>
68 const auto wkShape = wk.
shape();
69 if (wkShape.cols != 3)
74 const auto vkShape = vk.
shape();
75 if (vkShape.cols != 3)
80 if (wkShape.rows != vkShape.rows)
85 if (ak.
size() != wkShape.rows)
90 auto b = zeros<dtype>(3, 3);
91 const auto cSlice = wk.
cSlice();
92 for (
uint32 row = 0; row < wkShape.rows; ++row)
94 const auto wkVec = wk(row, cSlice);
95 const auto vkVec = vk(row, cSlice);
96 b += ak[row] *
dot(wkVec.transpose(), vkVec);
105 auto m = eye<double>(3, 3);
110 return dot(u,
dot(m, vt));
126 template<
typename dtype>
129 const auto ak = ones<dtype>({1, wk.
shape().rows});
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4356
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:37
NdArray< dtype > transpose() const
Definition: NdArrayCore.hpp:4652
NdArray< dtype > dot(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition: dot.hpp:47
std::uint32_t uint32
Definition: Types.hpp:40
Slice cSlice(int32 inStartIdx=0, uint32 inStepSize=1) const noexcept
Definition: NdArrayCore.hpp:887
void svd(const NdArray< dtype > &inArray, NdArray< double > &outU, NdArray< double > &outS, NdArray< double > &outVt)
Definition: svd.hpp:53
size_type size() const noexcept
Definition: NdArrayCore.hpp:4370
Definition: Coordinate.hpp:44
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
dtype det(const NdArray< dtype > &inArray)
Definition: det.hpp:56
NdArray< double > wahbasProblem(const NdArray< dtype > &wk, const NdArray< dtype > &vk, const NdArray< dtype > &ak)
Definition: wahbasProblem.hpp:64