Pure linear algebra functions including easy-to-use interfaces to BLAS and
LAPACK.
WARNING: may be unstable!
The routines in this module should only be used when it is absolutely crucial
for performance or code structure that the calling routine is declared as
pure. In general, LAPACK routines have side effects and are therefore not
declared pure.
Use the routines in mod_linalg instead.
Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
diagonalize a symmetric matrix A, only its upper triangle needs to
be defined. Here we compute eigenvalues and their corresponding eigen-
vectors, but only return the eigenvectors.
Arguments
d :
integer [in]– Dimension of matrix `mat`.
mat :
real(DP) (dim: (d,d)) [inout]– Matrix to be diagonalized
eval :
real(DP) (dim: (d)) [out]– Vector of eigenvalues
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
diagonalize a symmetric matrix A, only its upper triangle needs to
be defined. Here we only compute eigenvalues, not the eigenvectors, which
should be significantly faster.
Arguments
d :
integer [in]– Dimension of matrix `mat`.
mat :
real(DP) (dim: (d,d)) [inout]– Matrix to be diagonalized
eval :
real(DP) (dim: (d)) [out]– Vector of eigenvalues
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
subroutinematrix_plus_matrix_times_matrix( & m, & n, & k, & alpha, & beta, & mat_a, & mat_b, & mat_c & )
Compute the matrix-matrix product \(C = alpha * A * B + beta * C\)
using BLAS where A has dimensions (m, k), B has dimensions (k, n) and
C has dimensions (m, n).
Arguments
m :
integer [in]– Matrix dimensions.
n :
integer [in]– Matrix dimensions.
k :
integer [in]– Matrix dimensions.
alpha :
real(DP) [in]– Scalar factors.
beta :
real(DP) [in]– Scalar factors.
mat_a :
real(DP) (dim: (m,k)) [in]– The first matrix to be multiplied.
mat_b :
real(DP) (dim: (k,n)) [in]– The second matrix to be multiplied.
mat_c :
real(DP) (dim: (m,n)) [inout]– The result matrix to be added.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
subroutinematrix_transpose_times_matrix_plus_matrix( & m, & n, & k, & alpha, & beta, & mat_a, & mat_b, & mat_c & )
Compute the matrix-matrix product \(C = alpha * A * B + beta * C\)
using BLAS where A has dimensions (m, k), B has dimensions (k, n) and
C has dimensions (m, n). A has the dimensions (k, m) on entry and
is transposed during the routine.
Arguments
m :
integer [in]– Matrix dimensions.
n :
integer [in]– Matrix dimensions.
k :
integer [in]– Matrix dimensions.
alpha :
real(DP) [in]– Scalar factors.
beta :
real(DP) [in]– Scalar factors.
mat_a :
real(DP) (dim: (k,m)) [in]– The first matrix to be multiplied.
mat_b :
real(DP) (dim: (k,n)) [in]– The second matrix to be multiplied.
mat_c :
real(DP) (dim: (m,n)) [inout]– The result matrix to be added.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
subroutinesymmetric_matrix_times_matrix_plus_matrix_upper_triangle( & m, & n, & mat_a, & mat_b, & mat_c, & alpha, & beta & )
Compute a matrix matrix product for a symmetry matrix A
\(C = \alpha * A * B + \beta *C\) using BLAS.
ATTENTION: Since A is symmetric, only the upper part is filled.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.