mirror of
https://github.com/jlengrand/LAFF.git
synced 2026-03-10 08:31:21 +00:00
29 lines
431 B
Matlab
Executable File
29 lines
431 B
Matlab
Executable File
% Create a unit lower triangular matrixmatrix.
|
|
% (This matrix was carefully chosen so that only integers
|
|
% are encountered during the process.)
|
|
|
|
L = [
|
|
1 0 0 0
|
|
-1 1 0 0
|
|
2 1 1 0
|
|
-2 -1 1 1
|
|
]
|
|
|
|
% Create a right-hand side. We are going to solve L x = b
|
|
|
|
b = [
|
|
2
|
|
2
|
|
11
|
|
-3
|
|
]
|
|
|
|
% Solve L x = b
|
|
|
|
x = Ltrsv_unb_var1( L, b )
|
|
|
|
% Check that L x = b
|
|
|
|
b - L * x
|
|
|