Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2006-12-15 08:51:37


I finally finished the new triangular solvers. A new header file and an
example is attached. Some documentation is inside the header file. These
solves are defined as a replacement of the solvers in triangular.hpp (which
must be disabled in order to compile the example.)

I found it to be convenient to gain a triangular type tag from a triangular
layout type. So I added a few lines to functional.hpp (see patch file). Now
you can use
typedef lower TRI;
typedef TRI::triangular_type TAG;
where TAG is lower_tag (which can be used as an function argument of
This is similar to orientation_category in row_major and column_major.

The syntax of the solvers is the same:

bool singular;
singular = inplace_solve(L, x, lower_tag); // solves Lx=b
singular = inplace_solve(L, x, unit_lower_tag); // solves (I+L)x=b
singular = inplace_solve(U, x, upper_tag); // solves Ux=b
singular = inplace_solve(U, x, unit_upper_tag); // solves (I+U)x=b

(Most of) The solvers require the matrix to have the given structure and they
may return wrong results if this condition is violated. The also return
whether the matrix is singular. (Be careful: The solve was successful if the
result is _false_.) "x" can be a dense vector or a dense matrix.

Please have a look at the files and tell me if they work reliably.