Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Scilab 5.4.0
Change language to: English - Français - Português - 日本語 -

Please note that the recommended version of Scilab is 6.0.2. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Sparse Matrix > Sparse Decompositions > lusolve

# lusolve

sparse linear system solver

### Calling Sequence

```lusolve(hand,b)
lusolve(A,b)```

### Arguments

b

full real matrix

A

real square sparse invertible matrix

hand

handle to a previously computed sparse lu factors (output of lufact)

### Description

`x=lusolve(hand,b)` solves the sparse linear system `A*x = b`.

`[hand,rk]=lufact(A)` is the output of lufact.

`x=lusolve(A,b)` solves the sparse linear system `A*x = b`

### Examples

```non_zeros=[1,2,3,4];rows_cols=[1,1;2,2;3,3;4,4];
sp=sparse(rows_cols,non_zeros);
[h,rk]=lufact(sp);x=lusolve(h,[1;1;1;1]);ludel(h)
rk,sp*x

non_zeros=[1,2,3,4];rows_cols=[1,1;2,2;3,3;4,4];
sp=sparse(rows_cols,non_zeros);
x=lusolve(sp,-ones(4,1));
sp*x```

• sparse — sparse matrix definition
• lufact — sparse lu factorization
• slash — (/) правое деление и обратная связь
• backslash — (\) левое матричное деление.