61 template<
typename dtype>
66 const auto wkShape = wk.
shape();
67 if (wkShape.cols != 3)
72 const auto vkShape = vk.
shape();
73 if (vkShape.cols != 3)
78 if (wkShape.rows != vkShape.rows)
83 if (ak.
size() != wkShape.rows)
88 auto b = zeros<dtype>(3, 3);
89 const auto cSlice = wk.
cSlice();
90 for (
uint32 row = 0; row < wkShape.rows; ++row)
92 const auto wkVec = wk(row, cSlice);
93 const auto vkVec = vk(row, cSlice);
94 b += ak[row] *
dot(wkVec.transpose(), vkVec);
103 auto m = eye<double>(3, 3);
108 return dot(u,
dot(m, vt));
124 template<
typename dtype>
127 const auto ak = ones<dtype>({ 1, wk.
shape().rows });
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:39
size_type size() const noexcept
Definition: NdArrayCore.hpp:4524
self_type transpose() const
Definition: NdArrayCore.hpp:4882
const Shape & shape() const noexcept
Definition: NdArrayCore.hpp:4511
Slice cSlice(index_type inStartIdx=0, size_type inStepSize=1) const
Definition: NdArrayCore.hpp:1008
auto det(const NdArray< dtype > &inArray)
Definition: det.hpp:131
void svd(const NdArray< dtype > &inArray, NdArray< double > &outU, NdArray< double > &outS, NdArray< double > &outVt)
Definition: svd.hpp:51
NdArray< double > wahbasProblem(const NdArray< dtype > &wk, const NdArray< dtype > &vk, const NdArray< dtype > &ak)
Definition: wahbasProblem.hpp:62
NdArray< dtype > dot(const NdArray< dtype > &inArray1, const NdArray< dtype > &inArray2)
Definition: dot.hpp:47
std::uint32_t uint32
Definition: Types.hpp:40