Factorizations are useful for many calculations besides solutions to systems of equations. The LAPACK.h++ factorization classes include member functions for calculating the determinant, condition number, and inverse of a matrix.
>Calculating the determinant of a matrix is an inexpensive simple process, given its factorization. If F is a float precision factorization, then its determinant can be calculated using:
float det = determinant(F);>
Matrix inverses are often used in describing matrix algorithms. However, in practice, it is almost never necessary to calculate the inverse of a matrix explicitly. In almost every case, the problem can be solved much more efficiently by using a factorization. Nevertheless, for those rare occasions when you actually need the explicit inverse, a function is provided for its calculation. For example, to find the inverse of a double precision symmetric matrix whose factorization is the variable fact of type DoubleSymFact, you use:
DoubleSymMat inv = inverse(fact);>
The condition number of a matrix describes how sensitive it is to errors in the right-side vector when solving systems of equations. The factorization classes can calculate an estimate of the reciprocal condition number. When this number is near 1, the matrix is said to be well-conditioned. When the reciprocal condition number is near 0, the matrix is ill-conditioned. The solutions obtained for ill-conditioned matrices may not be very accurate. Consult a linear algebra text for more information on conditioning. You compute the condition number like this:
double rcond = condition(fact);
To compute the condition, the factorization class must do a little extra work while constructing the factorization; it must compute the norm of the system matrix. If you know that you will not need the condition number, you can save some computation by using the optional RWBoolean parameter on the factorization constructor. See the LAPACK.h++ Class Reference for details.
>©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.