Extreme Optimization >
User's Guide >
Vector and Matrix Library >
Sparse Vectors and Matrices >
Solving Sparse Systems
Extreme Optimization User's Guide
User's Guide
Up: Sparse Vectors and Matrices Next: Appendices Previous: Sparse Matrices Contents
Solving Sparse Systems
The LU decomposition or LU factorization of a matrix expresses the matrix as the product of a lower
triangular matrix and an upper triangular matrix. The matrix can be of any type, and of any shape.The LU
decomposition is usually written as
A = PLU,
where P is a permutation matrix, L is a lower-triangular matrix, and U is an
upper-triangular matrix. If A has more rows than columns, then L is rectangular, and R is
square. If A has more columns than rows, then U is rectangular, and R is square. The
algorithm uses row pivoting.
The LU decomposition of sparse matrices is implemented by the SparseLUDecomposition class.
The SparseLUDecomposition class
The SparseLUDecomposition
class represents the LU decomposition of a matrix. It has two constructors. The first variant takes a
SparseMatrix as its only parameter.
The second constructor takes a GeneralMatrix
as its first parameter. The second parameter is a Boolean value that specifies whether the contents of
the first parameter should be overwritten by the LU decomposition. The default is false.
The Decompose method performs the
actual decomposition. This method is called by other methods as needed. You will rarely need to call it explicitly.
The algorithm used is straightforward LU decomposition with row pivoting. Very little effort is made to reduce
fill-in.
Once the decomposition is computed, a number of operations can be performed in much less time. You can repeatedly
solve a system of simultaneous linear equations with different right-hand sides. You can also calculate the
determinant and the inverse of the base matrix:
The permutation matrix P is not available explicitly. Instead, the ApplyP method lets you multiply a vector or a
matrix by P directly. GeneralVector and
GeneralMatrix objects can be overwritten by the
result. Other types of vectors and matrices are always copied first.
Up: Sparse Vectors and Matrices Next: Appendices Previous: Sparse Matrices Contents
Copyright 2004-2008,
Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M
Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual
Studio.NET, and the Visual Studio Logo are registered trademarks of Microsoft Corporation