mirror of
https://github.com/josdejong/mathjs.git
synced 2025-12-08 19:46:04 +00:00
816 B
816 B
Function lsolve
Solves the linear equation system by forwards substitution. Matrix must be a lower triangular matrix.
L * x = b
Syntax
math.lsolve(L, b);
Parameters
| Parameter | Type | Description |
|---|---|---|
L |
Matrix, Array | A N x N matrix or array (L) |
b |
Matrix, Array | A column vector with the b values |
Returns
| Type | Description |
|---|---|
| DenseMatrix | Array | A column vector with the linear system solution (x) |
Examples
var a = [[-2, 3], [2, 1]];
var b = [11, 9];
var x = lsolve(a, b); // [[-5.5], [20]]