linalg 1.6.1
A linear algebra library that provides a user-friendly interface to several BLAS and LAPACK routines.
Loading...
Searching...
No Matches
linalg_immutable Module Reference

Provides an immutable interface to many of the core linear algebra routines in this library. The intent is to allow for ease of use in situations where memory allocation, or absolute speed are of lesser importance to code readability. More...

Data Types

type  eigen_results
 Defines a container for the output of an Eigen analysis of a square matrix. More...
 
type  lu_results
 Defines a container for the output of an LU factorization. More...
 
type  lu_results_cmplx
 Defines a container for the output of an LU factorization. More...
 
interface  mat_eigen
 Computes the eigenvalues and eigenvectors (right) of a general N-by-N matrix. More...
 
interface  mat_lu
 Computes the LU factorization of a square matrix. Notice, partial row pivoting is utilized. More...
 
interface  mat_mult_diag
 Computes the matrix operation: C = A * B, where A is a diagonal matrix. More...
 
interface  mat_mult_lower_tri
 Computes the matrix operation C = A * B, where A is a lower triangular matrix. More...
 
interface  mat_mult_upper_tri
 Computes the matrix operation C = A * B, where A is an upper triangular matrix. More...
 
interface  mat_solve_lower_tri
 Solves the lower triangular system A X = B, where A is a lower triangular matrix. More...
 
interface  mat_solve_upper_tri
 Solves the upper triangular system A X = B, where A is an upper triangular matrix. More...
 
type  qr_results
 Defines a container for the output of a QR factorization. More...
 
type  qr_results_cmplx
 Defines a container for the output of a QR factorization. More...
 
type  svd_results
 Defines a container for the output of a singular value decomposition of a matrix. More...
 
type  svd_results_cmplx
 Defines a container for the output of a singular value decomposition of a matrix. More...
 

Functions/Subroutines

real(real64) function, dimension(size(a, 1), size(a, 2)), public mat_rank1_update (a, x, y)
 Performs the rank-1 update to matrix A such that: \( B = X Y^T + A \), where \( A \) is an M-by-N matrix, \( X \) is an M-element array, and \( Y \) is an N-element array. More...
 
real(real64) function, public mat_det (a)
 Computes the determinant of a square matrix. More...
 
type(qr_results) function, public mat_qr (a, pvt)
 Computes the QR factorization of an M-by-N matrix. column pivoting can be used by this routine. More...
 
type(qr_results) function, public mat_qr_rank1_update (q, r, x, y)
 Computes the rank-1 update of a QR-factored system. More...
 
type(svd_results) function, public mat_svd (a)
 Computes the singular value decomposition of an M-by-N matrix. More...
 
real(real64) function, dimension(size(a, 1), size(a, 2)), public mat_cholesky (a, upper)
 Computes the Cholesky factorization of a positive-definite matrix. More...
 
real(real64) function, dimension(size(a, 1), size(a, 2)), public mat_cholesky_rank1_update (a, x)
 Computes the rank 1 update to a Cholesky factored matrix. More...
 
real(real64) function, dimension(size(a, 1), size(a, 2)), public mat_cholesky_rank1_downdate (a, x)
 Computes the rank 1 downdate to a Cholesky factored matrix. More...
 
real(real64) function, dimension(size(a, 2), size(a, 1)), public mat_inverse (a)
 Computes the inverse of a square matrix. More...
 
real(real64) function, dimension(size(a, 2), size(a, 1)), public mat_pinverse (a)
 Computes the Moore-Penrose pseudo-inverse of a M-by-N matrix. More...
 
pure real(real64) function, dimension(n, n), public identity (n)
 Creates an N-by-N identity matrix. More...
 

Detailed Description

Provides an immutable interface to many of the core linear algebra routines in this library. The intent is to allow for ease of use in situations where memory allocation, or absolute speed are of lesser importance to code readability.

Routines in this module do not provide an error handling interface. Any errors encountered will result in an error message printed to the prompt, the generation (or appending to) an error file, and termination of the program. Notice, warning situations will be handled similarily, but without termination of the program.

Function/Subroutine Documentation

◆ identity()

pure real(real64) function, dimension(n, n), public linalg_immutable::identity ( integer(int32), intent(in)  n)

Creates an N-by-N identity matrix.

Parameters
[in]nThe dimension of the matrix.
Returns
The N-by-N identity matrix.

Definition at line 1021 of file linalg_immutable.f90.

◆ mat_cholesky()

real(real64) function, dimension(size(a, 1), size(a, 2)), public linalg_immutable::mat_cholesky ( real(real64), dimension(:,:), intent(in)  a,
logical, intent(in), optional  upper 
)

Computes the Cholesky factorization of a positive-definite matrix.

Parameters
[in]aThe M-by-M positive definite matrix to factor.
[in]upperAn optional input that can be used to determine if the upper triangular factorization should be computed such that A = R**T * R, or if the lower triangular facotrization should be computed such that A = L * L**T. The default is true such that the upper triangular form is computed.

Definition at line 714 of file linalg_immutable.f90.

◆ mat_cholesky_rank1_downdate()

real(real64) function, dimension(size(a, 1), size(a, 2)), public linalg_immutable::mat_cholesky_rank1_downdate ( real(real64), dimension(:,:), intent(in)  a,
real(real64), dimension(:), intent(in)  x 
)

Computes the rank 1 downdate to a Cholesky factored matrix.

Parameters
[in]aThe M-by-M upper triangular Cholesky factored matrix to downdate.
[in]xThe M-element downdate array.
Returns
The downdated M-by-M upper triangular matrix.

Definition at line 759 of file linalg_immutable.f90.

◆ mat_cholesky_rank1_update()

real(real64) function, dimension(size(a, 1), size(a, 2)), public linalg_immutable::mat_cholesky_rank1_update ( real(real64), dimension(:,:), intent(in)  a,
real(real64), dimension(:), intent(in)  x 
)

Computes the rank 1 update to a Cholesky factored matrix.

Parameters
[in]aThe M-by-M upper triangular Cholesky factored matrix to update.
[in]xThe M-element update array.
Returns
The updated M-by-M upper triangular matrix.

Definition at line 737 of file linalg_immutable.f90.

◆ mat_det()

real(real64) function, public linalg_immutable::mat_det ( real(real64), dimension(:,:), intent(in)  a)

Computes the determinant of a square matrix.

Parameters
[in]aThe N-by-N matrix on which to operate.
Returns
The determinant of the matrix.

Definition at line 508 of file linalg_immutable.f90.

◆ mat_inverse()

real(real64) function, dimension(size(a, 2), size(a, 1)), public linalg_immutable::mat_inverse ( real(real64), dimension(:,:), intent(in)  a)

Computes the inverse of a square matrix.

Parameters
[in]aThe M-by-M matrix to invert.
Returns
The M-by-M inverted matrix.

Definition at line 779 of file linalg_immutable.f90.

◆ mat_pinverse()

real(real64) function, dimension(size(a, 2), size(a, 1)), public linalg_immutable::mat_pinverse ( real(real64), dimension(:,:), intent(in)  a)

Computes the Moore-Penrose pseudo-inverse of a M-by-N matrix.

Parameters
[in]aThe M-by-N matrix to invert.
Returns
The N-by-M inverted matrix.

Definition at line 794 of file linalg_immutable.f90.

◆ mat_qr()

type(qr_results) function, public linalg_immutable::mat_qr ( real(real64), dimension(:,:), intent(in)  a,
logical, intent(in), optional  pvt 
)

Computes the QR factorization of an M-by-N matrix. column pivoting can be used by this routine.

Parameters
[in]aThe M-by-N matrix to factor.
[in]pvtAn optional value that, if supplied, can be used to turn on column pivoting. The default value is false, such that no column pivoting is utilized.
Returns
The Q, R, and optionally P matrices resulting from the factorization.

Definition at line 591 of file linalg_immutable.f90.

◆ mat_qr_rank1_update()

type(qr_results) function, public linalg_immutable::mat_qr_rank1_update ( real(real64), dimension(:,:), intent(in)  q,
real(real64), dimension(:,:), intent(in)  r,
real(real64), dimension(:), intent(in)  x,
real(real64), dimension(:), intent(in)  y 
)

Computes the rank-1 update of a QR-factored system.

Parameters
[in]qThe M-by-M orthogonal matrix Q from the factorization of the original system.
[in]rThe M-by-N upper trapezoidal matrix R from the factorization of the original system.
[in]xThe M-element update vector.
[in]yThe N-element update vector.
Returns
The updated Q and R matrices.

Definition at line 637 of file linalg_immutable.f90.

◆ mat_rank1_update()

real(real64) function, dimension(size(a, 1), size(a, 2)), public linalg_immutable::mat_rank1_update ( real(real64), dimension(:,:), intent(in)  a,
real(real64), dimension(:), intent(in)  x,
real(real64), dimension(:), intent(in)  y 
)

Performs the rank-1 update to matrix A such that: \( B = X Y^T + A \), where \( A \) is an M-by-N matrix, \( X \) is an M-element array, and \( Y \) is an N-element array.

Parameters
[in]aThe M-by-N matrix A.
[in]xThe M-element array X.
[in]yThe N-element array Y.
Returns
The resulting M-by-N matrix.

Definition at line 204 of file linalg_immutable.f90.

◆ mat_svd()

type(svd_results) function, public linalg_immutable::mat_svd ( real(real64), dimension(:,:), intent(in)  a)

Computes the singular value decomposition of an M-by-N matrix.

Parameters
[in]aThe M-by-N matrix to factor.
Returns
The U, S, and transpose of V matrices resulting from the factorization where A = U * S * V**T.

Definition at line 673 of file linalg_immutable.f90.