linalg
1.5.0
A linear algebra library that provides a user-friendly interface to several BLAS and LAPACK routines.
|
Functions/Subroutines | |
subroutine | mtx_mult_c (transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c) |
Performs the matrix operation: C = alpha * op(A) * op(B) + beta * C. More... | |
subroutine | cmtx_mult_c (transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c) |
Performs the matrix operation: C = alpha * op(A) * op(B) + beta * C. More... | |
subroutine | diag_mtx_mult_left_c (m, n, k, alpha, a, b, beta, c) |
Computes the matirx operation: C = alpha * A * B + beta * C, where A is a diagonal amtrix. More... | |
subroutine | disg_mtx_mult_right_c (m, n, k, alpha, a, b, beta, c) |
Comptues the matrix operation: C = alpha * A * B + beta * C, where B is a diagonal matrix. More... | |
subroutine | diag_mtx_mult_cmplx_left_c (m, n, k, alpha, a, b, beta, c) |
Computes the matirx operation: C = alpha * A * B + beta * C, where A is a diagonal amtrix. More... | |
subroutine | diag_mtx_mult_cmplx_right_c (m, n, k, alpha, a, b, beta, c) |
Comptues the matrix operation: C = alpha * A * B + beta * C, where B is a diagonal matrix. More... | |
subroutine | diag_cmtx_mult_left_c (m, n, k, alpha, a, b, beta, c) |
Computes the matirx operation: C = alpha * A * B + beta * C, where A is a diagonal amtrix. More... | |
subroutine | diag_cmtx_mult_right_c (m, n, k, alpha, a, b, beta, c) |
Comptues the matrix operation: C = alpha * A * B + beta * C, where B is a diagonal matrix. More... | |
subroutine | rank1_update_c (m, n, alpha, x, y, a) |
Performs the rank-1 update to matrix A such that: A = alpha * X * Y**T + A, where A is an M-by-N matrix, alpha is a scalar, X is an M-element array, and N is an N-element array. More... | |
pure real(real64) function | trace_c (m, n, x) |
Computes the trace of a matrix (the sum of the main diagonal elements). More... | |
integer(int32) function | mtx_rank_c (m, n, a, err) |
Computes the rank of a matrix. More... | |
real(real64) function | det_c (n, a, err) |
Computes the determinant of a square matrix. More... | |
subroutine | swap_c (n, x, y) |
Swaps the contents of two arrays. More... | |
subroutine | tri_mtx_mult_c (upper, n, alpha, a, beta, b, err) |
subroutine | lu_factor_c (m, n, a, ipvt, err) |
Computes the LU factorization of an M-by-N matrix. More... | |
subroutine | form_lu_c (n, lu, ipvt, u, p) |
Extracts the L, U, and P matrices from the output of the lu_factor routine. More... | |
subroutine | qr_factor_c (m, n, a, tau, err) |
Computes the QR factorization of an M-by-N matrix without pivoting. More... | |
subroutine | qr_factor_pivot_c (m, n, a, tau, jpvt, err) |
Computes the QR factorization of an M-by-N matrix with column pivoting such that A * P = Q * R. More... | |
subroutine | form_qr_c (m, n, r, tau, q, err) |
Forms the full M-by-M orthogonal matrix Q from the elementary reflectors returned by the base QR factorization algorithm. More... | |
subroutine | form_qr_pivot_c (m, n, r, tau, pvt, q, p, err) |
Forms the full M-by-M orthogonal matrix Q from the elementary reflectors returned by the base QR factorization algorithm. More... | |
subroutine | mult_qr_c (trans, m, n, q, tau, c, err) |
Multiplies a general matrix by the orthogonal matrix Q from a QR factorization such that: C = op(Q) * C. More... | |
subroutine | qr_rank1_update_c (m, n, q, r, u, v, err) |
Computes the rank 1 update to an M-by-N QR factored matrix A (M >= N) where A = Q * R, and A1 = A + U * V**T such that A1 = Q1 * R1. More... | |
subroutine | cholesky_factor_c (n, a, upper, err) |
Computes the Cholesky factorization of a symmetric, positive definite matrix. More... | |
subroutine | cholesky_rank1_update_c (n, r, u, err) |
Computes the rank 1 update to a Cholesky factored matrix (upper triangular). More... | |
subroutine | cholesky_rank1_downdate_c (n, r, u, err) |
Computes the rank 1 downdate to a Cholesky factored matrix (upper triangular). More... | |
subroutine | rz_factor_c (m, n, a, tau, err) |
Factors an upper trapezoidal matrix by means of orthogonal transformations such that A = R * Z = (R 0) * Z. Z is an orthogonal matrix of dimension N-by-N, and R is an M-by-M upper triangular matrix. More... | |
subroutine | mult_rz_c (trans, m, n, l, a, tau, c, err) |
Multiplies a general matrix by the orthogonal matrix Z from an RZ factorization such that: C = op(Z) * C. More... | |
subroutine | svd_c (m, n, a, s, u, vt, err) |
Computes the singular value decomposition of a matrix A. The SVD is defined as: A = U * S * V**T, where U is an M-by-M orthogonal matrix, S is an M-by-N diagonal matrix, and V is an N-by-N orthogonal matrix. More... | |
subroutine | solve_tri_mtx_c (upper, trans, nounit, n, nrhs, alpha, a, b) |
Solves one of the matrix equations: op(A) * X = alpha * B, where A is a triangular matrix. More... | |
subroutine | solve_lu_c (n, nrhs, a, ipvt, b) |
Solves a system of LU-factored equations. More... | |
subroutine | solve_qr_c (m, n, nrhs, a, tau, b, err) |
Solves a system of M QR-factored equations of N unknowns where M >= N. More... | |
subroutine | solve_qr_pivot_c (m, n, nrhs, a, tau, jpvt, b, err) |
Solves a system of M QR-factored equations of N unknowns where the QR factorization made use of column pivoting. More... | |
subroutine | solve_cholesky_c (upper, n, nrhs, a, b) |
Solves a system of Cholesky factored equations. More... | |
subroutine | mtx_inverse_c (n, a, err) |
Computes the inverse of a square matrix. More... | |
subroutine | mtx_pinverse_c (m, n, a, ainv, err) |
Computes the Moore-Penrose pseudo-inverse of a M-by-N matrix using the singular value decomposition of the matrix. More... | |
subroutine | solve_least_squares_c (m, n, nrhs, a, b, err) |
Solves the overdetermined or underdetermined system (A*X = B) of M equations of N unknowns using a QR or LQ factorization of the matrix A. Notice, it is assumed that matrix A has full rank. More... | |
subroutine | eigen_symm_c (n, vecs, a, vals, err) |
Computes the eigenvalues, and optionally the eigenvectors of a real, symmetric matrix. More... | |
subroutine | eigen_asymm_c (n, a, vals, vecs, err) |
Computes the eigenvalues, and the right eigenvectors of a square matrix. More... | |
subroutine | eigen_gen_c (n, a, b, alpha, beta, vecs, err) |
Computes the eigenvalues, and optionally the right eigenvectors of a square matrix assuming the structure of the eigenvalue problem is A*X = lambda*B*X. More... | |
subroutine | sort_dbl_ind_c (ascend, n, x, ind) |
Sorts an array of double-precision values. More... | |
subroutine | sort_cmplx_ind_c (ascend, n, x, ind) |
Sorts an array of complex values according to their real components. More... | |
subroutine | sort_eigen_cmplx_c (ascend, n, vals, vecs) |
A sorting routine specifically tailored for sorting of eigenvalues and their associated eigenvectors using a quick-sort approach. More... | |
subroutine | sort_eigen_dbl_c (ascend, n, vals, vecs) |
A sorting routine specifically tailored for sorting of eigenvalues and their associated eigenvectors using a quick-sort approach. More... | |
subroutine linalg_c_binding::cholesky_factor_c | ( | integer(int32), intent(in), value | n, |
real(real64), dimension(n,n), intent(inout) | a, | ||
logical(c_bool), intent(in), value | upper, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the Cholesky factorization of a symmetric, positive definite matrix.
[in] | n | The dimension of the matrix. |
[in,out] | a | On input, the N-by-N matrix to factor. On output, the factored matrix is returned in either the upper or lower triangular portion of the matrix, dependent upon the value of upper . |
[in] | upper | An optional input that, if specified, provides control over whether the factorization is computed as A = U**T * U (set to true), or as A = L * L**T (set to false). The default value is true such that A = U**T * U. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 810 of file linalg_c_binding.f90.
subroutine linalg_c_binding::cholesky_rank1_downdate_c | ( | integer(int32), intent(in), value | n, |
real(real64), dimension(n,n), intent(inout) | r, | ||
real(real64), dimension(n), intent(inout) | u, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the rank 1 downdate to a Cholesky factored matrix (upper triangular).
[in] | n | The dimension of the matrix. |
[in,out] | r | On input, the N-by-N upper triangular matrix R. On output, the updated matrix R1. |
[in,out] | u | On input, the N-element update vector U. On output, the rotation sines used to transform R to R1. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 884 of file linalg_c_binding.f90.
subroutine linalg_c_binding::cholesky_rank1_update_c | ( | integer(int32), intent(in), value | n, |
real(real64), dimension(n,n), intent(inout) | r, | ||
real(real64), dimension(n), intent(inout) | u, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the rank 1 update to a Cholesky factored matrix (upper triangular).
[in] | n | The dimension of the matrix. |
[in,out] | r | On input, the N-by-N upper triangular matrix R. On output, the updated matrix R1. |
[in,out] | u | On input, the N-element update vector U. On output, the rotation sines used to transform R to R1. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 845 of file linalg_c_binding.f90.
subroutine linalg_c_binding::cmtx_mult_c | ( | logical(c_bool), intent(in), value | transa, |
logical(c_bool), intent(in), value | transb, | ||
integer(int32), intent(in), value | m, | ||
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | k, | ||
real(real64), intent(in), value | alpha, | ||
complex(real64), dimension(lda,*), intent(in) | a, | ||
integer(int32), intent(in), value | lda, | ||
complex(real64), dimension(ldb,*), intent(in) | b, | ||
integer(int32), intent(in), value | ldb, | ||
real(real64), intent(in), value | beta, | ||
complex(real64), dimension(m,n), intent(inout) | c | ||
) |
Performs the matrix operation: C = alpha * op(A) * op(B) + beta * C.
[in] | transa | Set to true if op(A) == A**T; else, set to false if op(A) == A. |
[in] | transb | Set to true if op(B) == B**T; else, set to false if op(B) == B. |
[in] | m | The number of rows in matrix C, and the number of rows in matrix op(A). |
[in] | n | The number of columns in matrix C, and the number of columns in matrix op(B). |
[in] | k | The number of columns in matrix op(A), and the number of rows in the matrix op(B). |
[in] | alpha | The scalar multiplier to matrix A. |
[in] | a | The M-by-K matrix A. |
[in] | lda | The leading dimension of matrix A. If transa is true, this value must be at least MAX(1, K); else, if transa is false, this value must be at least MAX(1, M). |
[in] | b | The K-by-N matrix B. |
[in] | ldb | The leading dimension of matrix B. If transb is true, this value must be at least MAX(1, N); else, if transb is false, this value must be at least MAX(1, K). |
[in] | beta | The scalar multiplier to matrix C. |
[in,out] | c | The M-by-N matrix C. |
Definition at line 92 of file linalg_c_binding.f90.
real(real64) function linalg_c_binding::det_c | ( | integer(int32), intent(in), value | n, |
real(real64), dimension(n,n), intent(inout) | a, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the determinant of a square matrix.
[in] | n | The dimension of the matrix. |
[in,out] | a | On input, the N-by-N matrix on which to operate. On output the contents are overwritten by the LU factorization of the original matrix. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 370 of file linalg_c_binding.f90.
subroutine linalg_c_binding::diag_cmtx_mult_left_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | k, | ||
real(real64), intent(in), value | alpha, | ||
complex(real64), dimension(min(m, k)), intent(in) | a, | ||
complex(real64), dimension(k, n), intent(in) | b, | ||
real(real64), intent(in), value | beta, | ||
complex(real64), dimension(m, n), intent(inout) | c | ||
) |
Computes the matirx operation: C = alpha * A * B + beta * C, where A is a diagonal amtrix.
[in] | m | The number of rows in matrix C. |
[in] | n | The number of columns in matrix C. |
[in] | k | The number of rows in matrix B. |
[in] | alpha | The scalar multiplier to matrix A. |
[in] | a | A MIN(M,K)-element array containing the diagonal elements of matrix A. |
[in] | b | The K-by-N matrix B. |
[in] | beta | The scalar multiplier to matrix C. |
[in,out] | c | The M-by-N matrix C. |
Definition at line 236 of file linalg_c_binding.f90.
subroutine linalg_c_binding::diag_cmtx_mult_right_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | k, | ||
real(real64), intent(in), value | alpha, | ||
complex(real64), dimension(m, k), intent(in) | a, | ||
complex(real64), dimension(min(k, n)), intent(in) | b, | ||
real(real64), intent(in), value | beta, | ||
complex(real64), dimension(m, n), intent(inout) | c | ||
) |
Comptues the matrix operation: C = alpha * A * B + beta * C, where B is a diagonal matrix.
[in] | m | The number of rows in matrix C. |
[in] | n | The number of columns in matrix C. |
[in] | k | The number of columns in matrix A. |
[in] | alpha | The scalar multiplier to matrix A. |
[in] | a | The M-by-K matrix A. |
[in] | b | A MIN(K,N)-element array containing the diagonal elements of matrix B. |
[in] | beta | The scalar multiplier to matrix C. |
[in,out] | c | The M-by-N matrix C. |
Definition at line 261 of file linalg_c_binding.f90.
subroutine linalg_c_binding::diag_mtx_mult_cmplx_left_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | k, | ||
real(real64), intent(in), value | alpha, | ||
complex(real64), dimension(min(m, k)), intent(in) | a, | ||
real(real64), dimension(k, n), intent(in) | b, | ||
real(real64), intent(in), value | beta, | ||
complex(real64), dimension(m, n), intent(inout) | c | ||
) |
Computes the matirx operation: C = alpha * A * B + beta * C, where A is a diagonal amtrix.
[in] | m | The number of rows in matrix C. |
[in] | n | The number of columns in matrix C. |
[in] | k | The number of rows in matrix B. |
[in] | alpha | The scalar multiplier to matrix A. |
[in] | a | A MIN(M,K)-element array containing the diagonal elements of matrix A. |
[in] | b | The K-by-N matrix B. |
[in] | beta | The scalar multiplier to matrix C. |
[in,out] | c | The M-by-N matrix C. |
Definition at line 184 of file linalg_c_binding.f90.
subroutine linalg_c_binding::diag_mtx_mult_cmplx_right_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | k, | ||
real(real64), intent(in), value | alpha, | ||
real(real64), dimension(m, k), intent(in) | a, | ||
complex(real64), dimension(min(k, n)), intent(in) | b, | ||
real(real64), intent(in), value | beta, | ||
complex(real64), dimension(m, n), intent(inout) | c | ||
) |
Comptues the matrix operation: C = alpha * A * B + beta * C, where B is a diagonal matrix.
[in] | m | The number of rows in matrix C. |
[in] | n | The number of columns in matrix C. |
[in] | k | The number of columns in matrix A. |
[in] | alpha | The scalar multiplier to matrix A. |
[in] | a | The M-by-K matrix A. |
[in] | b | A MIN(K,N)-element array containing the diagonal elements of matrix B. |
[in] | beta | The scalar multiplier to matrix C. |
[in,out] | c | The M-by-N matrix C. |
Definition at line 210 of file linalg_c_binding.f90.
subroutine linalg_c_binding::diag_mtx_mult_left_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | k, | ||
real(real64), intent(in), value | alpha, | ||
real(real64), dimension(min(m,k)), intent(in) | a, | ||
real(real64), dimension(k,n), intent(in) | b, | ||
real(real64), intent(in), value | beta, | ||
real(real64), dimension(m,n), intent(inout) | c | ||
) |
Computes the matirx operation: C = alpha * A * B + beta * C, where A is a diagonal amtrix.
[in] | m | The number of rows in matrix C. |
[in] | n | The number of columns in matrix C. |
[in] | k | The number of rows in matrix B. |
[in] | alpha | The scalar multiplier to matrix A. |
[in] | a | A MIN(M,K)-element array containing the diagonal elements of matrix A. |
[in] | b | The K-by-N matrix B. |
[in] | beta | The scalar multiplier to matrix C. |
[in,out] | c | The M-by-N matrix C. |
Definition at line 134 of file linalg_c_binding.f90.
subroutine linalg_c_binding::disg_mtx_mult_right_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | k, | ||
real(real64), intent(in), value | alpha, | ||
real(real64), dimension(m, k), intent(in) | a, | ||
real(real64), dimension(min(k, n)), intent(in) | b, | ||
real(real64), intent(in), value | beta, | ||
real(real64), dimension(m, n), intent(inout) | c | ||
) |
Comptues the matrix operation: C = alpha * A * B + beta * C, where B is a diagonal matrix.
[in] | m | The number of rows in matrix C. |
[in] | n | The number of columns in matrix C. |
[in] | k | The number of columns in matrix A. |
[in] | alpha | The scalar multiplier to matrix A. |
[in] | a | The M-by-K matrix A. |
[in] | b | A MIN(K,N)-element array containing the diagonal elements of matrix B. |
[in] | beta | The scalar multiplier to matrix C. |
[in,out] | c | The M-by-N matrix C. |
Definition at line 159 of file linalg_c_binding.f90.
subroutine linalg_c_binding::eigen_asymm_c | ( | integer(int32), intent(in), value | n, |
real(real64), dimension(n,n), intent(inout) | a, | ||
complex(real64), dimension(n), intent(out) | vals, | ||
complex(real64), dimension(n,n), intent(out) | vecs, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the eigenvalues, and the right eigenvectors of a square matrix.
[in] | n | The dimension of the matrix. |
[in,out] | a | On input, the N-by-N matrix on which to operate. On output, the contents of this matrix are overwritten. |
[out] | vals | An N-element array containing the eigenvalues of the matrix on output. The eigenvalues are not sorted. |
[out] | vecs | An N-by-N matrix containing the right eigenvectors (one per column) on output. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 1368 of file linalg_c_binding.f90.
subroutine linalg_c_binding::eigen_gen_c | ( | integer(int32), intent(in), value | n, |
real(real64), dimension(n, n), intent(inout) | a, | ||
real(real64), dimension(n, n), intent(inout) | b, | ||
complex(real64), dimension(n), intent(out) | alpha, | ||
real(real64), dimension(n), intent(out) | beta, | ||
complex(real64), dimension(n,n), intent(out) | vecs, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the eigenvalues, and optionally the right eigenvectors of a square matrix assuming the structure of the eigenvalue problem is A*X = lambda*B*X.
[in] | n | The dimension of the matrix. |
[in,out] | a | On input, the N-by-N matrix A. On output, the contents of this matrix are overwritten. |
[in,out] | b | On input, the N-by-N matrix B. On output, the contents of this matrix are overwritten. |
[out] | alpha | An N-element array that, on output, contains the numerator of the eigenvalue ration ALPHA / BETA. Computation of this ratio isn't necessarily as trivial as it seems as it is entirely possible, and likely, that ALPHA / BETA can overflow or underflow. With that said, the values in ALPHA will always be less than and usually comparable with the NORM(A). |
[out] | beta | An N-element array that, on output, contains the denominator used to determine the eigenvalues as ALPHA / BETA. The values in this array will always be less than and usually comparable with the NORM(B). |
[out] | vecs | An N-by-N matrix containing the right eigenvectors (one per column) on output. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 1417 of file linalg_c_binding.f90.
subroutine linalg_c_binding::eigen_symm_c | ( | integer(int32), intent(in), value | n, |
logical(c_bool), intent(in), value | vecs, | ||
real(real64), dimension(n,n), intent(inout) | a, | ||
real(real64), dimension(n), intent(out) | vals, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the eigenvalues, and optionally the eigenvectors of a real, symmetric matrix.
[in] | n | The dimension of the matrix. |
[in] | vecs | Set to true to compute the eigenvectors as well as the eigenvalues; else, set to false to just compute the eigenvalues. |
[in,out] | a | On input, the N-by-N symmetric matrix on which to operate. On output, and if vecs is set to true, the matrix will contain the eigenvectors (one per column) corresponding to each eigenvalue in vals . If vecs is set to false, the lower triangular portion of the matrix is overwritten. |
[out] | vals | An N-element array that will contain the eigenvalues sorted into ascending order. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 1329 of file linalg_c_binding.f90.
subroutine linalg_c_binding::form_lu_c | ( | integer(int32), intent(in), value | n, |
real(real64), dimension(n,n), intent(inout) | lu, | ||
integer(int32), dimension(n), intent(in) | ipvt, | ||
real(real64), dimension(n,n), intent(out) | u, | ||
real(real64), dimension(n,n), intent(out) | p | ||
) |
Extracts the L, U, and P matrices from the output of the lu_factor routine.
[in] | n | The dimension of the original matrix. |
[in,out] | lu | On input, the N-by-N matrix as output by lu_factor. On output, the N-by-N lower triangular matrix L. |
[in] | ipvt | The N-element pivot array as output by lu_factor. |
[out] | u | An N-by-N matrix where the U matrix will be written. |
[out] | p | An N-by-N matrix where the row permutation matrix will be written. |
Notice, as both L and U are triangular in structure, the above equations can be solved by forward and backward substitution.
Definition at line 517 of file linalg_c_binding.f90.
subroutine linalg_c_binding::form_qr_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(m,n), intent(inout) | r, | ||
real(real64), dimension(min(m,n)), intent(in) | tau, | ||
real(real64), dimension(m,m), intent(out) | q, | ||
type(errorhandler), intent(inout) | err | ||
) |
Forms the full M-by-M orthogonal matrix Q from the elementary reflectors returned by the base QR factorization algorithm.
[in] | m | The number of rows in the original matrix. |
[in] | n | The number of columns in the original matrix. |
[in,out] | r | On input, an M-by-N matrix where the elements below the diagonal contain the elementary reflectors generated from the QR factorization. On and above the diagonal, the matrix contains the matrix R. On output, the elements below the diagonal are zeroed such that the remaining matrix is simply the M-by-N matrix R. |
[in] | tau | A MIN(M, N)-element array containing the scalar factors of each elementary reflector defined in r . |
[out] | q | An M-by-M matrix where the full orthogonal matrix Q will be written. In the event that M > N, Q may be supplied as M-by-N, and therefore only return the useful submatrix Q1 (Q = [Q1, Q2]) as the factorization can be written as Q * R = [Q1, Q2] * [R1; 0]. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 639 of file linalg_c_binding.f90.
subroutine linalg_c_binding::form_qr_pivot_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(m,n), intent(inout) | r, | ||
real(real64), dimension(min(m,n)), intent(in) | tau, | ||
integer(int32), dimension(n), intent(in) | pvt, | ||
real(real64), dimension(m,m), intent(out) | q, | ||
real(real64), dimension(n,n), intent(out) | p, | ||
type(errorhandler), intent(inout) | err | ||
) |
Forms the full M-by-M orthogonal matrix Q from the elementary reflectors returned by the base QR factorization algorithm.
[in] | m | The number of rows in the original matrix. |
[in] | n | The number of columns in the original matrix. |
[in,out] | r | On input, an M-by-N matrix where the elements below the diagonal contain the elementary reflectors generated from the QR factorization. On and above the diagonal, the matrix contains the matrix R. On output, the elements below the diagonal are zeroed such that the remaining matrix is simply the M-by-N matrix R. |
[in] | tau | A MIN(M, N)-element array containing the scalar factors of each elementary reflector defined in r . |
[in] | pvt | An N-element column pivot array as returned by the QR factorization. |
[out] | q | An M-by-M matrix where the full orthogonal matrix Q will be written. In the event that M > N, Q may be supplied as M-by-N, and therefore only return the useful submatrix Q1 (Q = [Q1, Q2]) as the factorization can be written as Q * R = [Q1, Q2] * [R1; 0]. |
[out] | p | An N-by-N matrix where the pivot matrix will be written. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 688 of file linalg_c_binding.f90.
subroutine linalg_c_binding::lu_factor_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(m,n), intent(inout) | a, | ||
integer(int32), dimension(min(m,n)), intent(out) | ipvt, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the LU factorization of an M-by-N matrix.
[in] | m | The number of rows in the matrix. |
[in] | n | The number of columns in the matrix. |
[in,out] | a | On input, the M-by-N matrix on which to operate. On output, the LU factored matrix in the form [L\U] where the unit diagonal elements of L are not stored. |
[out] | ipvt | An MIN(M, N)-element array used to track row-pivot operations. The array stored pivot information such that row I is interchanged with row IPVT(I). |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 471 of file linalg_c_binding.f90.
subroutine linalg_c_binding::mtx_inverse_c | ( | integer(int32), intent(in), value | n, |
real(real64), dimension(n,n), intent(inout) | a, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the inverse of a square matrix.
[in] | n | The dimension of the matrix. |
[in,out] | a | On input, the N-by-N matrix to invert. On output, the inverted matrix. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 1210 of file linalg_c_binding.f90.
subroutine linalg_c_binding::mtx_mult_c | ( | logical(c_bool), intent(in), value | transa, |
logical(c_bool), intent(in), value | transb, | ||
integer(int32), intent(in), value | m, | ||
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | k, | ||
real(real64), intent(in), value | alpha, | ||
real(real64), dimension(lda,*), intent(in) | a, | ||
integer(int32), intent(in), value | lda, | ||
real(real64), dimension(ldb,*), intent(in) | b, | ||
integer(int32), intent(in), value | ldb, | ||
real(real64), intent(in), value | beta, | ||
real(real64), dimension(m,n), intent(inout) | c | ||
) |
Performs the matrix operation: C = alpha * op(A) * op(B) + beta * C.
[in] | transa | Set to true if op(A) == A**T; else, set to false if op(A) == A. |
[in] | transb | Set to true if op(B) == B**T; else, set to false if op(B) == B. |
[in] | m | The number of rows in matrix C, and the number of rows in matrix op(A). |
[in] | n | The number of columns in matrix C, and the number of columns in matrix op(B). |
[in] | k | The number of columns in matrix op(A), and the number of rows in the matrix op(B). |
[in] | alpha | The scalar multiplier to matrix A. |
[in] | a | The M-by-K matrix A. |
[in] | lda | The leading dimension of matrix A. If transa is true, this value must be at least MAX(1, K); else, if transa is false, this value must be at least MAX(1, M). |
[in] | b | The K-by-N matrix B. |
[in] | ldb | The leading dimension of matrix B. If transb is true, this value must be at least MAX(1, N); else, if transb is false, this value must be at least MAX(1, K). |
[in] | beta | The scalar multiplier to matrix C. |
[in,out] | c | The M-by-N matrix C. |
Definition at line 43 of file linalg_c_binding.f90.
subroutine linalg_c_binding::mtx_pinverse_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(m,n), intent(inout) | a, | ||
real(real64), dimension(n,m), intent(out) | ainv, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the Moore-Penrose pseudo-inverse of a M-by-N matrix using the singular value decomposition of the matrix.
[in] | m | The number of rows in the matrix to invert. |
[in] | n | The number of columns in the matrix to invert. |
[in,out] | a | On input, the M-by-N matrix to invert. The matrix is overwritten on output. |
[out] | ainv | The N-by-M matrix where the pseudo-inverse of a will be written. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 1247 of file linalg_c_binding.f90.
integer(int32) function linalg_c_binding::mtx_rank_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(m,n), intent(inout) | a, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the rank of a matrix.
[in] | m | The number of rows in the matrix. |
[in] | n | The number of columns in the matrix. |
[in,out] | a | On input, the M-by-N matrix of interest. On output, the contents of the matrix are overwritten. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 337 of file linalg_c_binding.f90.
subroutine linalg_c_binding::mult_qr_c | ( | logical(c_bool), intent(in), value | trans, |
integer(int32), intent(in), value | m, | ||
integer(int32), intent(in), value | n, | ||
real(real64), dimension(m,m), intent(inout) | q, | ||
real(real64), dimension(min(m,n)), intent(in) | tau, | ||
real(real64), dimension(m,n), intent(inout) | c, | ||
type(errorhandler), intent(inout) | err | ||
) |
Multiplies a general matrix by the orthogonal matrix Q from a QR factorization such that: C = op(Q) * C.
[in] | trans | Set to true to apply Q**T; else, set to false. |
[in] | m | The number of rows in the matrix c . |
[in] | n | The number of columns in the matrix c . |
[in] | q | On input, an M-by-M matrix containing the elementary reflectors output from the QR factorization. Notice, the contents of this matrix are restored on exit. that the remaining matrix is simply the M-by-N matrix R. |
[in] | tau | A MIN(M,N)-element array containing the scalar factors of each elementary reflector defined in a . |
[in,out] | c | On input, the M-by-N matrix C. On output, the product of the orthogonal matrix Q and the original matrix C. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 733 of file linalg_c_binding.f90.
subroutine linalg_c_binding::mult_rz_c | ( | logical(c_bool), intent(in), value | trans, |
integer(int32), intent(in), value | m, | ||
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | l, | ||
real(real64), dimension(m,m), intent(inout) | a, | ||
real(real64), dimension(m), intent(in) | tau, | ||
real(real64), dimension(m,n), intent(inout) | c, | ||
type(errorhandler), intent(inout) | err | ||
) |
Multiplies a general matrix by the orthogonal matrix Z from an RZ factorization such that: C = op(Z) * C.
[in] | trans | Set to true to apply Z**T; else, set to false. |
[in] | m | The number of rows in the matrix c . |
[in] | n | The number of columns in the matrix c . |
[in] | l | The number of columns in matrix a containing the meaningful part of the Householder vectors (M >= L >= 0). |
[in,out] | a | On input, the M-by-M matrix Z as output by rz_factor . The matrix is used as in-place storage during execution; however, the contents of the matrix are restored on exit. |
[in] | tau | An M-element array containing the scalar factors of the elementary reflectors found in a . |
[in,out] | c | On input, the M-by-N matrix C. On output, the product of the orthogonal matrix Z and the original matrix C. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 965 of file linalg_c_binding.f90.
subroutine linalg_c_binding::qr_factor_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(m,n), intent(inout) | a, | ||
real(real64), dimension(min(m,n)), intent(out) | tau, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the QR factorization of an M-by-N matrix without pivoting.
[in] | m | The number of rows in the matrix. |
[in] | n | The number of columns in the matrix. |
[in,out] | a | On input, the M-by-N matrix to factor. On output, the elements on and above the diagonal contain the MIN(M, N)-by-N upper trapezoidal matrix R (R is upper triangular if M >= N). The elements below the diagonal, along with the array tau , represent the orthogonal matrix Q as a product of elementary reflectors. |
[out] | tau | A MIN(M, N)-element array used to store the scalar factors of the elementary reflectors. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 549 of file linalg_c_binding.f90.
subroutine linalg_c_binding::qr_factor_pivot_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(m,n), intent(inout) | a, | ||
real(real64), dimension(min(m,n)), intent(out) | tau, | ||
integer(int32), dimension(n), intent(inout) | jpvt, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the QR factorization of an M-by-N matrix with column pivoting such that A * P = Q * R.
[in] | m | The number of rows in the matrix. |
[in] | n | The number of columns in the matrix. |
[in,out] | a | On input, the M-by-N matrix to factor. On output, the elements on and above the diagonal contain the MIN(M, N)-by-N upper trapezoidal matrix R (R is upper triangular if M >= N). The elements below the diagonal, along with the array tau , represent the orthogonal matrix Q as a product of elementary reflectors. |
[out] | tau | A MIN(M, N)-element array used to store the scalar factors of the elementary reflectors. |
[in,out] | jpvt | On input, an N-element array that if JPVT(I) .ne. 0, the I-th column of A is permuted to the front of A * P; if JPVT(I) = 0, the I-th column of A is a free column. On output, if JPVT(I) = K, then the I-th column of A * P was the K-th column of A. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 594 of file linalg_c_binding.f90.
subroutine linalg_c_binding::qr_rank1_update_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(m,m), intent(inout) | q, | ||
real(real64), dimension(m,n), intent(inout) | r, | ||
real(real64), dimension(m), intent(inout) | u, | ||
real(real64), dimension(n), intent(inout) | v, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the rank 1 update to an M-by-N QR factored matrix A (M >= N) where A = Q * R, and A1 = A + U * V**T such that A1 = Q1 * R1.
[in] | m | The number of rows in the original matrix. |
[in] | n | The number of columns in the original matrix. |
[in,out] | q | On input, the original M-by-M orthogonal matrix Q. On output, the updated matrix Q1. |
[in,out] | r | On input, the M-by-N matrix R. On output, the updated matrix R1. |
[in,out] | u | On input, the M-element U update vector. On output, the original content of the array is overwritten. |
[in,out] | v | On input, the N-element V update vector. On output, the original content of the array is overwritten. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 774 of file linalg_c_binding.f90.
subroutine linalg_c_binding::rank1_update_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
real(real64), intent(in), value | alpha, | ||
real(real64), dimension(m), intent(in) | x, | ||
real(real64), dimension(n), intent(in) | y, | ||
real(real64), dimension(m,n), intent(inout) | a | ||
) |
Performs the rank-1 update to matrix A such that: A = alpha * X * Y**T + A, where A is an M-by-N matrix, alpha is a scalar, X is an M-element array, and N is an N-element array.
[in] | m | The number of elements in x , and the number of rows in matrix a . |
[in] | n | The number of elements in y , and the number of columns in matrix a . |
[in] | alpha | The scalar multiplier. |
[in] | x | An M-element array. |
[in] | y | An N-element array. |
[in,out] | a | On input, the M-by-N matrix to update. On output, the updated M-by-N matrix. |
Definition at line 290 of file linalg_c_binding.f90.
subroutine linalg_c_binding::rz_factor_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(m,n), intent(inout) | a, | ||
real(real64), dimension(m), intent(out) | tau, | ||
type(errorhandler), intent(inout) | err | ||
) |
Factors an upper trapezoidal matrix by means of orthogonal transformations such that A = R * Z = (R 0) * Z. Z is an orthogonal matrix of dimension N-by-N, and R is an M-by-M upper triangular matrix.
[in] | m | The number of rows in the original matrix. |
[in] | n | The number of columns in the original matrix. |
[in,out] | a | On input, the M-by-N upper trapezoidal matrix to factor. On output, the leading M-by-M upper triangular part of the matrix contains the upper triangular matrix R, and elements N-L+1 to N of the first M rows of A, with the array tau , represent the orthogonal matrix Z as a product of M elementary reflectors. |
[out] | tau | An M-element array used to store the scalar factors of the elementary reflectors. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 923 of file linalg_c_binding.f90.
subroutine linalg_c_binding::solve_cholesky_c | ( | logical(c_bool), intent(in), value | upper, |
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | nrhs, | ||
real(real64), dimension(n,n), intent(in) | a, | ||
real(real64), dimension(n,nrhs), intent(inout) | b | ||
) |
Solves a system of Cholesky factored equations.
[in] | upper | Set to true if the original matrix A was factored such that A = U**T * U; else, set to false if the factorization of A was A = L**T * L. |
[in] | n | The dimension of the original matrix a . |
[in] | nrhs | The number of right-hand-side vectors (number of columns in matrix b ). |
[in] | a | The N-by-N Cholesky factored matrix. |
[in,out] | b | On input, the N-by-NRHS right-hand-side matrix B. On output, the solution matrix X. |
Definition at line 1186 of file linalg_c_binding.f90.
subroutine linalg_c_binding::solve_least_squares_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | nrhs, | ||
real(real64), dimension(m, n), intent(inout) | a, | ||
real(real64), dimension(max(m,n), nrhs), intent(inout) | b, | ||
type(errorhandler), intent(inout) | err | ||
) |
Solves the overdetermined or underdetermined system (A*X = B) of M equations of N unknowns using a QR or LQ factorization of the matrix A. Notice, it is assumed that matrix A has full rank.
[in] | m | The number of rows in the original coefficient matrix A. |
[in] | n | The number of columns in the original coefficient matrix A. |
[in] | nrhs | The number of right-hand-side vectors (number of columns in matrix b ). |
[in,out] | a | On input, the M-by-N matrix A. On output, the matrix is overwritten by the details of its complete orthogonal factorization. |
[in,out] | b | If M >= N, the M-by-NRHS matrix B. On output, the first N rows contain the N-by-NRHS solution matrix X. If M < N, an N-by-NRHS matrix with the first M rows containing the matrix B. On output, the N-by-NRHS solution matrix X. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 1288 of file linalg_c_binding.f90.
subroutine linalg_c_binding::solve_lu_c | ( | integer(int32), intent(in), value | n, |
integer(int32), intent(in), value | nrhs, | ||
real(real64), dimension(n,n), intent(in) | a, | ||
integer(int32), dimension(n), intent(in) | ipvt, | ||
real(real64), dimension(n,nrhs), intent(inout) | b | ||
) |
Solves a system of LU-factored equations.
[in] | n | The dimension of the original matrix a . |
[in] | nrhs | The number of right-hand-side vectors (number of columns in matrix b ). |
[in] | a | The N-by-N LU factored matrix as output by lu_factor. |
[in] | ipvt | The N-element pivot array as output by lu_factor. |
[in,out] | b | On input, the N-by-NRHS right-hand-side matrix. On output, the N-by-NRHS solution matrix. |
Definition at line 1075 of file linalg_c_binding.f90.
subroutine linalg_c_binding::solve_qr_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | nrhs, | ||
real(real64), dimension(m,n), intent(inout) | a, | ||
real(real64), dimension(min(m,n)), intent(in) | tau, | ||
real(real64), dimension(m,nrhs), intent(inout) | b, | ||
type(errorhandler), intent(inout) | err | ||
) |
Solves a system of M QR-factored equations of N unknowns where M >= N.
[in] | m | The number of rows in the original coefficient matrix A. |
[in] | n | The number of columns in the original coefficient matrix A. |
[in] | nrhs | The number of right-hand-side vectors (number of columns in matrix b ). |
[in] | a | On input, the M-by-N QR factored matrix as returned by qr_factor. On output, the contents of this matrix are restored. Notice, M must be greater than or equal to N. |
[in] | tau | A MIN(M, N)-element array containing the scalar factors of the elementary reflectors as returned by qr_factor. |
[in] | b | On input, the M-by-NRHS right-hand-side matrix. On output, the first N columns are overwritten by the solution matrix X. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 1108 of file linalg_c_binding.f90.
subroutine linalg_c_binding::solve_qr_pivot_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | nrhs, | ||
real(real64), dimension(m,n), intent(inout) | a, | ||
real(real64), dimension(min(m,n)), intent(in) | tau, | ||
integer(int32), dimension(n), intent(in) | jpvt, | ||
real(real64), dimension(max(m,n),nrhs), intent(inout) | b, | ||
type(errorhandler), intent(inout) | err | ||
) |
Solves a system of M QR-factored equations of N unknowns where the QR factorization made use of column pivoting.
[in] | m | The number of rows in the original coefficient matrix A. |
[in] | n | The number of columns in the original coefficient matrix A. |
[in] | nrhs | The number of right-hand-side vectors (number of columns in matrix b ). |
[in] | a | On input, the M-by-N QR factored matrix as returned by qr_factor. On output, the contents of this matrix are altered. |
[in] | tau | A MIN(M, N)-element array containing the scalar factors of the elementary reflectors as returned by qr_factor. |
[in] | jpvt | An N-element array, as output by qr_factor, used to track the column pivots. |
[in] | b | On input, the MAX(M, N)-by-NRHS matrix where the first M rows contain the right-hand-side matrix B. On output, the first N rows are overwritten by the solution matrix X. |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 1153 of file linalg_c_binding.f90.
subroutine linalg_c_binding::solve_tri_mtx_c | ( | logical(c_bool), intent(in), value | upper, |
logical(c_bool), intent(in), value | trans, | ||
logical(c_bool), intent(in), value | nounit, | ||
integer(int32), intent(in), value | n, | ||
integer(int32), intent(in), value | nrhs, | ||
real(real64), intent(in), value | alpha, | ||
real(real64), dimension(n,n), intent(in) | a, | ||
real(real64), dimension(n,nrhs), intent(inout) | b | ||
) |
Solves one of the matrix equations: op(A) * X = alpha * B, where A is a triangular matrix.
[in] | upper | Set to true if A is an upper triangular matrix; else, set to false if A is a lower triangular matrix. |
[in] | trans | Set to true if op(A) = A**T; else, set to false if op(A) = A. |
[in] | nounit | Set to true if A is not a unit-diagonal matrix (ones on every diagonal element); else, set to false if A is a unit-diagonal matrix. |
[in] | n | The dimension of the triangular matrix a . |
[in] | nrhs | The number of right-hand-side vectors (number of columns in matrix b ). |
[in] | alpha | The scalar multiplier to B. |
[in] | a | N-by-N triangular matrix on which to operate. |
[in,out] | b | On input, the N-by-NRHS right-hand-side. On output, the N-by-NRHS solution. |
Definition at line 1052 of file linalg_c_binding.f90.
subroutine linalg_c_binding::sort_cmplx_ind_c | ( | logical(c_bool), intent(in), value | ascend, |
integer(int32), intent(in), value | n, | ||
complex(real64), dimension(n), intent(inout) | x, | ||
type(c_ptr), intent(in), value | ind | ||
) |
Sorts an array of complex values according to their real components.
[in] | ascend | Set to true to sort in ascending order; else, false to sort in descending order. |
[in] | n | The number of elements in the array. |
[in,out] | x | On input, the N-element array to sort. On output, the sorted array. |
[in,out] | ind | On input, a pointer to an integer array. If NULL, this argument is ignored, and x is sorted as expected. However, if used, on output, the contents of this array are shifted in the same order as that of x as a means of tracking the sorting operation. It is often useful to set this array to an ascending group of values (1, 2, ... n) such that this array tracks the original positions of the sorted array. Such an array can then be used to align other arrays. This array must be the same size as x . |
Definition at line 1491 of file linalg_c_binding.f90.
subroutine linalg_c_binding::sort_dbl_ind_c | ( | logical(c_bool), intent(in), value | ascend, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(n), intent(inout) | x, | ||
type(c_ptr), intent(in), value | ind | ||
) |
Sorts an array of double-precision values.
[in] | ascend | Set to true to sort in ascending order; else, false to sort in descending order. |
[in] | n | The number of elements in the array. |
[in,out] | x | On input, the N-element array to sort. On output, the sorted array. |
[in,out] | ind | On input, a pointer to an integer array. If NULL, this argument is ignored, and x is sorted as expected. However, if used, on output, the contents of this array are shifted in the same order as that of x as a means of tracking the sorting operation. It is often useful to set this array to an ascending group of values (1, 2, ... n) such that this array tracks the original positions of the sorted array. Such an array can then be used to align other arrays. This array must be the same size as x . |
Definition at line 1455 of file linalg_c_binding.f90.
subroutine linalg_c_binding::sort_eigen_cmplx_c | ( | logical(c_bool), intent(in), value | ascend, |
integer(int32), intent(in), value | n, | ||
complex(real64), dimension(n), intent(inout) | vals, | ||
complex(real64), dimension(n,n), intent(inout) | vecs | ||
) |
A sorting routine specifically tailored for sorting of eigenvalues and their associated eigenvectors using a quick-sort approach.
[in] | ascend | Set to true to sort in ascending order; else, false to sort in descending order. |
[in] | n | The number of eigenvalues. |
[in,out] | vals | On input, an N-element array containing the eigenvalues. On output, the sorted eigenvalues. |
[in,out] | vecs | On input, an N-by-N matrix containing the eigenvectors associated with vals (one vector per column). On output, the sorted eigenvector matrix. |
Definition at line 1523 of file linalg_c_binding.f90.
subroutine linalg_c_binding::sort_eigen_dbl_c | ( | logical(c_bool), intent(in), value | ascend, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(n), intent(inout) | vals, | ||
real(real64), dimension(n,n), intent(inout) | vecs | ||
) |
A sorting routine specifically tailored for sorting of eigenvalues and their associated eigenvectors using a quick-sort approach.
[in] | ascend | Set to true to sort in ascending order; else, false to sort in descending order. |
[in] | n | The number of eigenvalues. |
[in,out] | vals | On input, an N-element array containing the eigenvalues. On output, the sorted eigenvalues. |
[in,out] | vecs | On input, an N-by-N matrix containing the eigenvectors associated with vals (one vector per column). On output, the sorted eigenvector matrix. |
Definition at line 1546 of file linalg_c_binding.f90.
subroutine linalg_c_binding::svd_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(m,n), intent(inout) | a, | ||
real(real64), dimension(min(m,n)), intent(out) | s, | ||
real(real64), dimension(m,m), intent(out) | u, | ||
real(real64), dimension(n,n), intent(out) | vt, | ||
type(errorhandler), intent(inout) | err | ||
) |
Computes the singular value decomposition of a matrix A. The SVD is defined as: A = U * S * V**T, where U is an M-by-M orthogonal matrix, S is an M-by-N diagonal matrix, and V is an N-by-N orthogonal matrix.
[in] | m | The number of rows in the original matrix. |
[in] | n | The number of columns in the original matrix. |
[in,out] | a | On input, the M-by-N matrix to factor. The matrix is overwritten on output. that the remaining matrix is simply the M-by-N matrix R. |
[out] | s | A MIN(M, N)-element array containing the singular values of a sorted in descending order. |
[out] | u | An M-by-M matrix that on output contains the left singular vectors (matrix U in the decomposition: A = U * S * V**T) |
[out] | vt | An N-by-N matrix that on output contains the right singular vectors (matrix V**T in the decomposition: A = U * S * V**T). |
[in,out] | err | The errorhandler object. If no error handling is desired, simply pass NULL, and errors will be dealt with by the default internal error handler. Possible errors that may be encountered are as follows.
|
Definition at line 1012 of file linalg_c_binding.f90.
subroutine linalg_c_binding::swap_c | ( | integer(int32), intent(in), value | n, |
real(real64), dimension(n), intent(inout) | x, | ||
real(real64), dimension(n), intent(inout) | y | ||
) |
Swaps the contents of two arrays.
[in] | n | The number of elements either array. |
[in,out] | x | One of the N-element arrays. |
[in,out] | y | The other N-element array. |
Definition at line 395 of file linalg_c_binding.f90.
pure real(real64) function linalg_c_binding::trace_c | ( | integer(int32), intent(in), value | m, |
integer(int32), intent(in), value | n, | ||
real(real64), dimension(m,n), intent(in) | x | ||
) |
Computes the trace of a matrix (the sum of the main diagonal elements).
[in] | m | The number of rows in the matrix. |
[in] | n | The number of columns in the matrix. |
[in] | x | The matrix on which to operate. |
x
. Definition at line 310 of file linalg_c_binding.f90.