ndarray-linear-solve
Solves a system of linear equations, similar to MATLAB's backslash operator, but not yet as sophisticated. (But maybe it will be someday soon! Pull requests welcome!)
example
var solve = ;var show = ;var ndarray = ;var A = ;var B =var X =var r =console;if rconsole;elseconsole
output:
input:
2.000 1.000 -1.000
-3.000 -1.000 2.000
-2.000 1.000 2.000
solution:
2.000 3.000 -1.000
methods
var solve =
var solution = solve(X, A, B)
Solves the linear system, AX = B
for X
X
is a vector into which the solution is writtenA
is a matrix encoded as an ndarrayB
is a vector, encoded as an ndarray
Returns true
if the matrix has a solution, otherwise false
.
install
With npm do:
npm install ndarray-linear-solve
license
MIT