<< linalg_rayleighiteration linalg blaslapack >>

linalg >> linalg > linalg_solvelu

linalg_solvelu

Computes the solution of a linear equation, given its LU decomposition.

Calling Sequence

x = linalg_solvelu ( L , U , b )
x = linalg_solvelu ( L , U , b , verbose )

Parameters

L :

a n-by-n matrix of doubles, lower triangular.

U :

a n-by-n matrix of doubles, upper triangular.

b :

a n-by-1 matrix of doubles

verbose :

a 1-by-1 matrix of boolean (default verbose = %f), set to %t to display intermediate messages

x :

a n-by-1 matrix of doubles

Description

Solve Ax=b with A=L*U and L lower triangular and U upper triangular. Effective algorithm with vectorization.

Examples

L=[
1 0 0 0 0
1 1 0 0 0
1 1 1 0 0
1 1 1 1 0
1 1 1 1 1
];
U=[
1 1 1 1 1
0 1 1 1 1
0 0 1 1 1
0 0 0 1 1
0 0 0 0 1
];
b=[5;9;12;14;15];
xe=[1;1;1;1;1]
x=linalg_solvelu(L,U,b)
// See what happens
x=linalg_solvelu(L,U,b,%t)

// See the algorithm
edit linalg_solvelu

Authors


Report an issue
<< linalg_rayleighiteration linalg blaslapack >>