Gosl. la. Linear Algebra: vector, matrix, efficient sparse solvers, eigenvalues, decompositions, etc.
The la
sub-package implements functions to perform linear algebra operations such as vector
addition or matrix-vector multiplications. It also wraps some efficient sparse linear systems
solvers such as Umfpack and
MUMPS (not the parotitis disease!).
Both Umfpack and MUMPS solvers are very efficient!
Sometimes, we call the lower level functions in la/oblas to improve performance.
In la
, there are two types of structures to hold data for solving a sparse linear system:
triplet and column-compressed matrix. Both have a complex version and are named as follows:
Triplet
andTripletC
(complex)CCMatrix
andCCMatrixC
(complex)
The Triplet
is more convenient for data input; e.g. during the assemblage step in a finite element
code. The CCMatrix
is better (faster) for computations and is the structure used by Umfpack.
Triplets are initialized by giving the size of the corresponding matrix and the number of non-zero
entries (components). Thus, only space for the non-zero entries is allocated. Afterwards, each
component can be set by calling the Put
method after calling the Start
method. The Start
method can be called several times. Therefore, this structure helps with the efficient
implementation of codes requiring multiple solutions of linear systems as in finite element
analyses.
To convert the Triplet into a Column-Compressed Matrix, call the ToMatrix
method of Triplet
. And
to convert the sparse matrix to a dense version (e.g. for reporting/printing), call the ToDense
method of CCMatrix
.
The Triplet
has also a very convenient method to copy the contents of another Triplet (i.e. sparse
matrix) into the positions starting with the maximum number of columns of this second matrix and the
positions starting with the maximum number of rows of this second matrix. This is done with the
method PutMatAndMatT
. This operation is particularly common when solving mechanical problems with
Lagrange multipliers and can be illustrated as follows:
[... ... ... a00 a10 ...] 0
[... ... ... a01 a11 ...] 1
[... ... ... a02 a12 ...] 2 [. at .]
[a00 a01 a02 ... ... ...] 3 => [a . .]
[a10 a11 a12 ... ... ...] 4 [. . .]
[... ... ... ... ... ...] 5
The version in which the second matrix is a column-compressed matrix is named PutCCMatAndMatT
.
SparseSolver
defines an interface for linear solvers in la
. Two implementations satisfying this
interface are:
Umfpack
wrapper to Umfpack; andMumps
wrapper to MUMPS
There are also high level functions to solve linear systems with Umfpack:
SpSolve
; andSpSolveC
with complex numbers
Note however that the high level functions shouldn't be used for repeated executions because memory would be constantly allocated and released.
- source file Test Vector
- source file Test Matrix
- source file Test Matrix operations
- source file Test BLAS1 routines
- source file Test BLAS2 routines
- source file Test BLAS3 routines
- source file Test Dense Solver
- source file Test Eigenvalues/Eigenvectors
- source file Test Jacobi iteration
- source file Test sparse BLAS
- source file Test conversions
- source file Test sparse Triplet and Matrix
- source file Test sparse solver MUMPS
- source file Test sparse solver UMFPACK
- source file Test solutions of sparse linear systems