56 template<
typename dtype>
61 const auto& aShape = inA.
shape();
62 const auto& bShape = inB.
shape();
64 const auto bIsFlat = inB.
isflat();
65 if (bIsFlat && bShape.size() != aShape.rows)
69 else if (!bIsFlat && inA.
shape().
rows != bShape.rows)
82 const auto bRowSlice = bCast.rSlice();
85 const auto resultRowSlice = result.rSlice();
87 for (
uint32 col = 0; col < bShape.cols; ++col)
89 result.put(resultRowSlice, col,
svd.lstsq(bCast(bRowSlice, col)));
#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
bool isflat() const noexcept
Definition NdArrayCore.hpp:3025
const Shape & shape() const noexcept
Definition NdArrayCore.hpp:4591
uint32 rows
Definition Core/shape.hpp:44
Performs the singular value decomposition of a general matrix.
Definition svd/svd.hpp:50
Definition cholesky.hpp:41
void svd(const NdArray< dtype > &inArray, NdArray< double > &outU, NdArray< double > &outS, NdArray< double > &outVT)
Definition svd.hpp:51
NdArray< double > lstsq(const NdArray< dtype > &inA, const NdArray< dtype > &inB)
Definition lstsq.hpp:57
NdArray< dtypeOut > astype(const NdArray< dtype > inArray)
Definition astype.hpp:45
std::uint32_t uint32
Definition Types.hpp:40