flag to delete the source matrix.
factorization of matrix 'A', A = P * L * U.
the pivot indices from luDecomp.
the right hand side matrix B.
specifies the form of the system of equations: 'N': A * X = B (No transpose) 'T': A**T * X = B (Transpose) 'C': A**T * X = B (Conjugate transpose = Transpose)
Return solve of the system linear equations.
import mir.math; import mir.ndslice; auto A = [ 1, 4, -3, 5, 6, -2, 8, 5, 7, 8, 3, 4, 7, 9, 1, 2, 4, 6, 3, 2, 6, 8, 3, 5, 2 ] .sliced(5, 5) .as!double.slice .canonical; import mir.random.variable; import mir.random.algorithm; auto B = randomSlice(uniformVar(-100, 100), 5, 100); auto LU = A.luDecomp(); auto X = LU.solve('N', B); import mir.algorithm.iteration: equal; assert(equal!((a, b) => fabs(a - b) < 1e-12)(mtimes(A, X), B));
Solves a system of linear equations \A * X = B, or \A**T * X = B with a general 'N x N' matrix 'A' using the LU factorization computed by luDecomp.