ltrisol¶
Purpose¶
Computes the solution of \(Lx = b\) where L is a lower triangular matrix.
Format¶
-
x =
ltrisol
(b, L)¶ - Parameters
b (PxK matrix) – data
L (PxP matrix) – lower triangular matrix
- Returns
x (PxK matrix) – solution of \(Lx = b\).
Examples¶
rndseed 123131;
// Create lower triangular matrix
l = lowmat(rndn(4, 4));
// Create random b matrix
b = rndn(4, 1);
print "b/l ="; b/l;
x = ltrisol(b, l);
print "x ="; x;
This code produces
b/l =
1.31626
3.24920
-4.95390
4.62379
x =
1.31626
3.24920
-4.95390
4.62379