Matrices.solve(A,b);
This function call returns the solution x of the linear system of equations
A*x = b
If a unique solution x does not exist (since A is singular), an exception is raised.
The solution is computed with the LAPACK function "dgesv", i.e., by Gaussian elemination with partial pivoting.
Real A[3,3] = [1,2,3; 3,4,5; 2,1,4]; Real b[3] = {10,22,12}; Real x[3]; algorithm x := Matrices.solve(A,b); // x = {3,2,1}
Matrices.LU, Matrices.LU_solve
function solve extends Modelica.Icons.Function; input Real A[:, size(A, 1)] "Matrix A of A*x = b"; input Real b[size(A, 1)] "Vector b of A*x = b"; output Real x[size(b, 1)] "Vector x such that A*x = b"; end solve;