53 template<
typename dtype>
87 result(k, k) = -1. / inArrayDouble(k, k);
92 if ((i - k) && (
j - k))
94 result(i,
j) = inArrayDouble(i,
j) + inArrayDouble(k,
j) * inArrayDouble(i, k) * result(k, k);
96 else if ((i - k) && !(
j - k))
98 result(i, k) = inArrayDouble(i, k) * result(k, k);
100 else if (!(i - k) && (
j - k))
102 result(k,
j) = inArrayDouble(k,
j) * result(k, k);
107 inArrayDouble = result;
112 for (
int i =
static_cast<int>(inShape.
rows) - 1; i >= 0; --i)
114 if (incidence(i, i) != 1)
120 for (; k < static_cast<int>(inShape.
cols); ++k)
122 if ((k - i) && incidence(i, k) != 0)
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition: StaticAsserts.hpp:56
self_type & swapCols(index_type colIdx1, index_type colIdx2) noexcept
Definition: NdArrayCore.hpp:4672
self_type & swapRows(index_type rowIdx1, index_type rowIdx2) noexcept
Definition: NdArrayCore.hpp:4690
const Shape & shape() const noexcept
Definition: NdArrayCore.hpp:4511
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:41
uint32 rows
Definition: Core/Shape.hpp:44
uint32 cols
Definition: Core/Shape.hpp:45
constexpr auto j
Definition: Core/Constants.hpp:42
Definition: cholesky.hpp:41
NdArray< double > inv(const NdArray< dtype > &inArray)
Definition: inv.hpp:54
bool essentiallyEqual(dtype inValue1, dtype inValue2) noexcept
Definition: essentiallyEqual.hpp:49
std::uint32_t uint32
Definition: Types.hpp:40