56 template<
typename dtype>
63 if (!
shape.issquare())
81 s += std::fabs(uMatrix(i, j));
84 const double q = std::fabs(uMatrix(i, k)) / s;
101 std::swap(pMatrix(k, j), pMatrix(pk, j));
102 std::swap(lMatrix(k, j), lMatrix(pk, j));
103 std::swap(uMatrix(k, j), uMatrix(pk, j));
109 lMatrix(i, k) = uMatrix(i, k) / uMatrix(k, k);
113 uMatrix(i, j) = uMatrix(i, j) - lMatrix(i, k) * uMatrix(k, j);
123 return std::make_tuple(lMatrix, uMatrix, pMatrix);
#define THROW_RUNTIME_ERROR(msg)
Definition Error.hpp:40
#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 Shape & shape() const noexcept
Definition NdArrayCore.hpp:4591
Definition cholesky.hpp:41
std::tuple< NdArray< double >, NdArray< double >, NdArray< double > > pivotLU_decomposition(const NdArray< dtype > &inMatrix)
Definition pivotLU_decomposition.hpp:57
bool essentiallyEqual(dtype inValue1, dtype inValue2) noexcept
Definition essentiallyEqual.hpp:49
NdArray< dtypeOut > zeros_like(const NdArray< dtype > &inArray)
Definition zeros_like.hpp:45
NdArray< dtype > eye(uint32 inN, uint32 inM, int32 inK=0)
Definition eye.hpp:51
Shape shape(const NdArray< dtype > &inArray) noexcept
Definition Functions/shape.hpp:42
NdArray< dtypeOut > astype(const NdArray< dtype > inArray)
Definition astype.hpp:45
std::uint32_t uint32
Definition Types.hpp:40
NdArray< dtype > max(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition max.hpp:44