Dense row-major matrix with optional GPU storage.
LUResult lu(const Matrix &A)
LU factorization of a square matrix A with partial pivoting.
constexpr T ipow(T x) noexcept
Compute x^N at compile time via repeated squaring.
real lu_det(const LUResult &f)
Determinant of A from its LU factorization.
Matrix lu_inv(const LUResult &f)
Inverse of A from its LU factorization.
void lu_solve(const LUResult &f, const Vector &b, Vector &x)
Solve A*x = b using a precomputed LU factorization.
Backend enum for linear algebra operations.
Result of an LU factorization with partial pivoting (PA = LU)