stdlib_linalg#

See also the specification page: stdlib_linalg.

stdlib_linalg (module)#

Provides a support for various linear algebra procedures (Specification: stdlib_linalg)

Interfaces

chol (interface)#

chol (interface)

Computes the Cholesky factorization ( A = L cdot L^T ), or ( A = U^T cdot U ). (Specification: stdlib_linalg)

Procedures:
pure module function stdlib_linalg_s_cholesky_fun(a, lower, other_zeroed) -> c#
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

lowerlogical(kind=lk), intent(in), optional

[optional] is the lower or upper triangular factor required? Default = lower

other_zeroedlogical(kind=lk), intent(in), optional

[optional] should the unused half of the return matrix be zeroed out? Default: yes

Returns:
creal(kind=sp), (size(a, 1), size(a, 2)), dimension(size(a,1),size(a,2)

Output matrix with Cholesky factors c[n,n]

pure module function stdlib_linalg_d_cholesky_fun(a, lower, other_zeroed) -> c#
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

lowerlogical(kind=lk), intent(in), optional

[optional] is the lower or upper triangular factor required? Default = lower

other_zeroedlogical(kind=lk), intent(in), optional

[optional] should the unused half of the return matrix be zeroed out? Default: yes

Returns:
creal(kind=dp), (size(a, 1), size(a, 2)), dimension(size(a,1),size(a,2)

Output matrix with Cholesky factors c[n,n]

pure module function stdlib_linalg_c_cholesky_fun(a, lower, other_zeroed) -> c#
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

lowerlogical(kind=lk), intent(in), optional

[optional] is the lower or upper triangular factor required? Default = lower

other_zeroedlogical(kind=lk), intent(in), optional

[optional] should the unused half of the return matrix be zeroed out? Default: yes

Returns:
ccomplex(kind=sp), (size(a, 1), size(a, 2)), dimension(size(a,1),size(a,2)

Output matrix with Cholesky factors c[n,n]

pure module function stdlib_linalg_z_cholesky_fun(a, lower, other_zeroed) -> c#
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

lowerlogical(kind=lk), intent(in), optional

[optional] is the lower or upper triangular factor required? Default = lower

other_zeroedlogical(kind=lk), intent(in), optional

[optional] should the unused half of the return matrix be zeroed out? Default: yes

Returns:
ccomplex(kind=dp), (size(a, 1), size(a, 2)), dimension(size(a,1),size(a,2)

Output matrix with Cholesky factors c[n,n]

Summary

Pure function interface for computing the Cholesky triangular factors.

Description

This interface provides methods for computing the lower- or upper- triangular matrix from the Cholesky factorization of a real symmetric or complex Hermitian matrix. Supported data types include real and complex.

Notes

The solution is based on LAPACK’s *POTRF methods.

cholesky (interface)#

cholesky (interface)

Computes the Cholesky factorization ( A = L cdot L^T ), or ( A = U^T cdot U ). (Specification: stdlib_linalg)

Procedures:
pure module subroutine stdlib_linalg_s_cholesky_inplace(a, lower, other_zeroed, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,n]

lowerlogical(kind=lk), intent(in), optional

[optional] is the lower or upper triangular factor required? Default = lower

other_zeroedlogical(kind=lk), intent(in), optional

[optional] should the unused half of the return matrix be zeroed out? Default: yes

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_s_cholesky(a, c, lower, other_zeroed, err)#
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

creal(kind=sp), (:, :), intent(out), dimension(:,:)

Output matrix with Cholesky factors c[n,n]

lowerlogical(kind=lk), intent(in), optional

[optional] is the lower or upper triangular factor required? Default = lower

other_zeroedlogical(kind=lk), intent(in), optional

[optional] should the unused half of the return matrix be zeroed out? Default: yes

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_d_cholesky_inplace(a, lower, other_zeroed, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,n]

lowerlogical(kind=lk), intent(in), optional

[optional] is the lower or upper triangular factor required? Default = lower

other_zeroedlogical(kind=lk), intent(in), optional

[optional] should the unused half of the return matrix be zeroed out? Default: yes

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_d_cholesky(a, c, lower, other_zeroed, err)#
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

creal(kind=dp), (:, :), intent(out), dimension(:,:)

Output matrix with Cholesky factors c[n,n]

lowerlogical(kind=lk), intent(in), optional

[optional] is the lower or upper triangular factor required? Default = lower

other_zeroedlogical(kind=lk), intent(in), optional

[optional] should the unused half of the return matrix be zeroed out? Default: yes

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_c_cholesky_inplace(a, lower, other_zeroed, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,n]

lowerlogical(kind=lk), intent(in), optional

[optional] is the lower or upper triangular factor required? Default = lower

other_zeroedlogical(kind=lk), intent(in), optional

[optional] should the unused half of the return matrix be zeroed out? Default: yes

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_c_cholesky(a, c, lower, other_zeroed, err)#
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

ccomplex(kind=sp), (:, :), intent(out), dimension(:,:)

Output matrix with Cholesky factors c[n,n]

lowerlogical(kind=lk), intent(in), optional

[optional] is the lower or upper triangular factor required? Default = lower

other_zeroedlogical(kind=lk), intent(in), optional

[optional] should the unused half of the return matrix be zeroed out? Default: yes

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_z_cholesky_inplace(a, lower, other_zeroed, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,n]

lowerlogical(kind=lk), intent(in), optional

[optional] is the lower or upper triangular factor required? Default = lower

other_zeroedlogical(kind=lk), intent(in), optional

[optional] should the unused half of the return matrix be zeroed out? Default: yes

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_z_cholesky(a, c, lower, other_zeroed, err)#
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

ccomplex(kind=dp), (:, :), intent(out), dimension(:,:)

Output matrix with Cholesky factors c[n,n]

lowerlogical(kind=lk), intent(in), optional

[optional] is the lower or upper triangular factor required? Default = lower

other_zeroedlogical(kind=lk), intent(in), optional

[optional] should the unused half of the return matrix be zeroed out? Default: yes

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Pure subroutine interface for computing the Cholesky triangular factors.

Description

This interface provides methods for computing the lower- or upper- triangular matrix from the Cholesky factorization of a real symmetric or complex Hermitian matrix. Supported data types include real and complex. The factorization is computed in-place if only one matrix argument is present; or returned into a second matrix argument, if present. The lower logical flag allows to select between upper or lower factorization; the other_zeroed optional logical flag allows to choose whether the unused part of the triangular matrix should be filled with zeroes.

Notes

The solution is based on LAPACK’s *POTRF methods.

diag (interface)#

diag (interface)

Creates a diagonal array or extract the diagonal elements of an array (Specification: stdlib_linalg)

Procedures:
pure module function diag_rsp(v) -> res#
Arguments:
vreal(kind=sp), intent(in), dimension(:)
Returns:
resreal(kind=sp), size(v)), dimension(size(v)
pure module function diag_rdp(v) -> res#
Arguments:
vreal(kind=dp), intent(in), dimension(:)
Returns:
resreal(kind=dp), size(v)), dimension(size(v)
pure module function diag_csp(v) -> res#
Arguments:
vcomplex(kind=sp), intent(in), dimension(:)
Returns:
rescomplex(kind=sp), size(v)), dimension(size(v)
pure module function diag_cdp(v) -> res#
Arguments:
vcomplex(kind=dp), intent(in), dimension(:)
Returns:
rescomplex(kind=dp), size(v)), dimension(size(v)
pure module function diag_iint8(v) -> res#
Arguments:
vinteger(kind=int8), intent(in), dimension(:)
Returns:
resinteger(kind=int8), size(v)), dimension(size(v)
pure module function diag_iint16(v) -> res#
Arguments:
vinteger(kind=int16), intent(in), dimension(:)
Returns:
resinteger(kind=int16), size(v)), dimension(size(v)
pure module function diag_iint32(v) -> res#
Arguments:
vinteger(kind=int32), intent(in), dimension(:)
Returns:
resinteger(kind=int32), size(v)), dimension(size(v)
pure module function diag_iint64(v) -> res#
Arguments:
vinteger(kind=int64), intent(in), dimension(:)
Returns:
resinteger(kind=int64), size(v)), dimension(size(v)
pure module function diag_rsp_k(v, k) -> res#
Arguments:
vreal(kind=sp), intent(in), dimension(:)
kinteger, intent(in)
Returns:
resreal(kind=sp), size(v)+abs(k)), dimension(size(v)+abs(k)
pure module function diag_rdp_k(v, k) -> res#
Arguments:
vreal(kind=dp), intent(in), dimension(:)
kinteger, intent(in)
Returns:
resreal(kind=dp), size(v)+abs(k)), dimension(size(v)+abs(k)
pure module function diag_csp_k(v, k) -> res#
Arguments:
vcomplex(kind=sp), intent(in), dimension(:)
kinteger, intent(in)
Returns:
rescomplex(kind=sp), size(v)+abs(k)), dimension(size(v)+abs(k)
pure module function diag_cdp_k(v, k) -> res#
Arguments:
vcomplex(kind=dp), intent(in), dimension(:)
kinteger, intent(in)
Returns:
rescomplex(kind=dp), size(v)+abs(k)), dimension(size(v)+abs(k)
pure module function diag_iint8_k(v, k) -> res#
Arguments:
vinteger(kind=int8), intent(in), dimension(:)
kinteger, intent(in)
Returns:
resinteger(kind=int8), size(v)+abs(k)), dimension(size(v)+abs(k)
pure module function diag_iint16_k(v, k) -> res#
Arguments:
vinteger(kind=int16), intent(in), dimension(:)
kinteger, intent(in)
Returns:
resinteger(kind=int16), size(v)+abs(k)), dimension(size(v)+abs(k)
pure module function diag_iint32_k(v, k) -> res#
Arguments:
vinteger(kind=int32), intent(in), dimension(:)
kinteger, intent(in)
Returns:
resinteger(kind=int32), size(v)+abs(k)), dimension(size(v)+abs(k)
pure module function diag_iint64_k(v, k) -> res#
Arguments:
vinteger(kind=int64), intent(in), dimension(:)
kinteger, intent(in)
Returns:
resinteger(kind=int64), size(v)+abs(k)), dimension(size(v)+abs(k)
pure module function diag_rsp_mat(A) -> res#
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
resreal(kind=sp), dimension(minval(shape(A)
pure module function diag_rdp_mat(A) -> res#
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
resreal(kind=dp), dimension(minval(shape(A)
pure module function diag_csp_mat(A) -> res#
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
rescomplex(kind=sp), dimension(minval(shape(A)
pure module function diag_cdp_mat(A) -> res#
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
rescomplex(kind=dp), dimension(minval(shape(A)
pure module function diag_iint8_mat(A) -> res#
Arguments:
Ainteger(kind=int8), (:, :), intent(in), dimension(:,:)
Returns:
resinteger(kind=int8), dimension(minval(shape(A)
pure module function diag_iint16_mat(A) -> res#
Arguments:
Ainteger(kind=int16), (:, :), intent(in), dimension(:,:)
Returns:
resinteger(kind=int16), dimension(minval(shape(A)
pure module function diag_iint32_mat(A) -> res#
Arguments:
Ainteger(kind=int32), (:, :), intent(in), dimension(:,:)
Returns:
resinteger(kind=int32), dimension(minval(shape(A)
pure module function diag_iint64_mat(A) -> res#
Arguments:
Ainteger(kind=int64), (:, :), intent(in), dimension(:,:)
Returns:
resinteger(kind=int64), dimension(minval(shape(A)
pure module function diag_rsp_mat_k(A, k) -> res#
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)
kinteger, intent(in)
Returns:
resreal(kind=sp), dimension(minval(shape(A))-abs(k)
pure module function diag_rdp_mat_k(A, k) -> res#
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)
kinteger, intent(in)
Returns:
resreal(kind=dp), dimension(minval(shape(A))-abs(k)
pure module function diag_csp_mat_k(A, k) -> res#
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)
kinteger, intent(in)
Returns:
rescomplex(kind=sp), dimension(minval(shape(A))-abs(k)
pure module function diag_cdp_mat_k(A, k) -> res#
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)
kinteger, intent(in)
Returns:
rescomplex(kind=dp), dimension(minval(shape(A))-abs(k)
pure module function diag_iint8_mat_k(A, k) -> res#
Arguments:
Ainteger(kind=int8), (:, :), intent(in), dimension(:,:)
kinteger, intent(in)
Returns:
resinteger(kind=int8), dimension(minval(shape(A))-abs(k)
pure module function diag_iint16_mat_k(A, k) -> res#
Arguments:
Ainteger(kind=int16), (:, :), intent(in), dimension(:,:)
kinteger, intent(in)
Returns:
resinteger(kind=int16), dimension(minval(shape(A))-abs(k)
pure module function diag_iint32_mat_k(A, k) -> res#
Arguments:
Ainteger(kind=int32), (:, :), intent(in), dimension(:,:)
kinteger, intent(in)
Returns:
resinteger(kind=int32), dimension(minval(shape(A))-abs(k)
pure module function diag_iint64_mat_k(A, k) -> res#
Arguments:
Ainteger(kind=int64), (:, :), intent(in), dimension(:,:)
kinteger, intent(in)
Returns:
resinteger(kind=int64), dimension(minval(shape(A))-abs(k)

trace (interface)#

trace (interface)

Computes the trace of a matrix (Specification: stdlib_linalg)

Procedures:

eye (interface)#

eye (interface)

Constructs the identity matrix (Specification: stdlib_linalg)

Procedures:

outer_product (interface)#

outer_product (interface)

Computes the outer product of two vectors, returning a rank-2 array (Specification: stdlib_linalg)

Procedures:
pure module function outer_product_rsp(u, v) -> res#
Arguments:
ureal(kind=sp), intent(in), dimension(:)
vreal(kind=sp), intent(in), dimension(:)
Returns:
resreal(kind=sp), size(v)), dimension(size(u)
pure module function outer_product_rdp(u, v) -> res#
Arguments:
ureal(kind=dp), intent(in), dimension(:)
vreal(kind=dp), intent(in), dimension(:)
Returns:
resreal(kind=dp), size(v)), dimension(size(u)
pure module function outer_product_csp(u, v) -> res#
Arguments:
ucomplex(kind=sp), intent(in), dimension(:)
vcomplex(kind=sp), intent(in), dimension(:)
Returns:
rescomplex(kind=sp), size(v)), dimension(size(u)
pure module function outer_product_cdp(u, v) -> res#
Arguments:
ucomplex(kind=dp), intent(in), dimension(:)
vcomplex(kind=dp), intent(in), dimension(:)
Returns:
rescomplex(kind=dp), size(v)), dimension(size(u)
pure module function outer_product_iint8(u, v) -> res#
Arguments:
uinteger(kind=int8), intent(in), dimension(:)
vinteger(kind=int8), intent(in), dimension(:)
Returns:
resinteger(kind=int8), size(v)), dimension(size(u)
pure module function outer_product_iint16(u, v) -> res#
Arguments:
uinteger(kind=int16), intent(in), dimension(:)
vinteger(kind=int16), intent(in), dimension(:)
Returns:
resinteger(kind=int16), size(v)), dimension(size(u)
pure module function outer_product_iint32(u, v) -> res#
Arguments:
uinteger(kind=int32), intent(in), dimension(:)
vinteger(kind=int32), intent(in), dimension(:)
Returns:
resinteger(kind=int32), size(v)), dimension(size(u)
pure module function outer_product_iint64(u, v) -> res#
Arguments:
uinteger(kind=int64), intent(in), dimension(:)
vinteger(kind=int64), intent(in), dimension(:)
Returns:
resinteger(kind=int64), size(v)), dimension(size(u)

kronecker_product (interface)#

kronecker_product (interface)

Computes the Kronecker product of two arrays of size M1xN1, and of M2xN2, returning an (M1*M2)x(N1*N2) array (Specification: stdlib_linalg)

Procedures:
pure module function kronecker_product_rsp(A, B) -> C#
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)
Breal(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
Creal(kind=sp), (size(A, dim=1)*size(B, dim=1), size(A, dim=2)*size(B, dim=2)), dimension(size(A,dim=1)*size(B,dim=1),size(A,dim=2)*size(B,dim=2)
pure module function kronecker_product_rdp(A, B) -> C#
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)
Breal(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
Creal(kind=dp), (size(A, dim=1)*size(B, dim=1), size(A, dim=2)*size(B, dim=2)), dimension(size(A,dim=1)*size(B,dim=1),size(A,dim=2)*size(B,dim=2)
pure module function kronecker_product_csp(A, B) -> C#
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)
Bcomplex(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
Ccomplex(kind=sp), (size(A, dim=1)*size(B, dim=1), size(A, dim=2)*size(B, dim=2)), dimension(size(A,dim=1)*size(B,dim=1),size(A,dim=2)*size(B,dim=2)
pure module function kronecker_product_cdp(A, B) -> C#
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)
Bcomplex(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
Ccomplex(kind=dp), (size(A, dim=1)*size(B, dim=1), size(A, dim=2)*size(B, dim=2)), dimension(size(A,dim=1)*size(B,dim=1),size(A,dim=2)*size(B,dim=2)
pure module function kronecker_product_iint8(A, B) -> C#
Arguments:
Ainteger(kind=int8), (:, :), intent(in), dimension(:,:)
Binteger(kind=int8), (:, :), intent(in), dimension(:,:)
Returns:
Cinteger(kind=int8), (size(A, dim=1)*size(B, dim=1), size(A, dim=2)*size(B, dim=2)), dimension(size(A,dim=1)*size(B,dim=1),size(A,dim=2)*size(B,dim=2)
pure module function kronecker_product_iint16(A, B) -> C#
Arguments:
Ainteger(kind=int16), (:, :), intent(in), dimension(:,:)
Binteger(kind=int16), (:, :), intent(in), dimension(:,:)
Returns:
Cinteger(kind=int16), (size(A, dim=1)*size(B, dim=1), size(A, dim=2)*size(B, dim=2)), dimension(size(A,dim=1)*size(B,dim=1),size(A,dim=2)*size(B,dim=2)
pure module function kronecker_product_iint32(A, B) -> C#
Arguments:
Ainteger(kind=int32), (:, :), intent(in), dimension(:,:)
Binteger(kind=int32), (:, :), intent(in), dimension(:,:)
Returns:
Cinteger(kind=int32), (size(A, dim=1)*size(B, dim=1), size(A, dim=2)*size(B, dim=2)), dimension(size(A,dim=1)*size(B,dim=1),size(A,dim=2)*size(B,dim=2)
pure module function kronecker_product_iint64(A, B) -> C#
Arguments:
Ainteger(kind=int64), (:, :), intent(in), dimension(:,:)
Binteger(kind=int64), (:, :), intent(in), dimension(:,:)
Returns:
Cinteger(kind=int64), (size(A, dim=1)*size(B, dim=1), size(A, dim=2)*size(B, dim=2)), dimension(size(A,dim=1)*size(B,dim=1),size(A,dim=2)*size(B,dim=2)

cross_product (interface)#

cross_product (interface)

Computes the cross product of two vectors, returning a rank-1 and size-3 array (Specification: stdlib_linalg)

Procedures:
pure module function cross_product_rsp(a, b) -> res#
Arguments:
areal(kind=sp), intent(in), dimension(3)
breal(kind=sp), intent(in), dimension(3)
Returns:
resreal(kind=sp), dimension(3)
pure module function cross_product_rdp(a, b) -> res#
Arguments:
areal(kind=dp), intent(in), dimension(3)
breal(kind=dp), intent(in), dimension(3)
Returns:
resreal(kind=dp), dimension(3)
pure module function cross_product_csp(a, b) -> res#
Arguments:
acomplex(kind=sp), intent(in), dimension(3)
bcomplex(kind=sp), intent(in), dimension(3)
Returns:
rescomplex(kind=sp), dimension(3)
pure module function cross_product_cdp(a, b) -> res#
Arguments:
acomplex(kind=dp), intent(in), dimension(3)
bcomplex(kind=dp), intent(in), dimension(3)
Returns:
rescomplex(kind=dp), dimension(3)
pure module function cross_product_iint8(a, b) -> res#
Arguments:
ainteger(kind=int8), intent(in), dimension(3)
binteger(kind=int8), intent(in), dimension(3)
Returns:
resinteger(kind=int8), dimension(3)
pure module function cross_product_iint16(a, b) -> res#
Arguments:
ainteger(kind=int16), intent(in), dimension(3)
binteger(kind=int16), intent(in), dimension(3)
Returns:
resinteger(kind=int16), dimension(3)
pure module function cross_product_iint32(a, b) -> res#
Arguments:
ainteger(kind=int32), intent(in), dimension(3)
binteger(kind=int32), intent(in), dimension(3)
Returns:
resinteger(kind=int32), dimension(3)
pure module function cross_product_iint64(a, b) -> res#
Arguments:
ainteger(kind=int64), intent(in), dimension(3)
binteger(kind=int64), intent(in), dimension(3)
Returns:
resinteger(kind=int64), dimension(3)

is_square (interface)#

is_square (interface)

Checks if a matrix (rank-2 array) is square (Specification: stdlib_linalg)

Procedures:

is_diagonal (interface)#

is_diagonal (interface)

Checks if a matrix (rank-2 array) is diagonal (Specification: stdlib_linalg)

Procedures:

is_symmetric (interface)#

is_symmetric (interface)

Checks if a matrix (rank-2 array) is symmetric (Specification: stdlib_linalg)

Procedures:

is_skew_symmetric (interface)#

is_skew_symmetric (interface)

Checks if a matrix (rank-2 array) is skew-symmetric (Specification: stdlib_linalg)

Procedures:

is_hermitian (interface)#

is_hermitian (interface)

Checks if a matrix (rank-2 array) is Hermitian (Specification: stdlib_linalg)

Procedures:

hermitian (interface)#

hermitian (interface)

Computes the Hermitian version of a rank-2 matrix. For complex matrices, this returns conjg(transpose(a)). For real or integer matrices, this returns transpose(a).

Usage:

A  = reshape([(1, 2), (3, 4), (5, 6), (7, 8)], [2, 2])
AH = hermitian(A)

Specification: stdlib_linalg

Procedures:
pure module function hermitian_rsp(a) -> ah#
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
ahreal(kind=sp), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)
pure module function hermitian_rdp(a) -> ah#
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
ahreal(kind=dp), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)
pure module function hermitian_csp(a) -> ah#
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
ahcomplex(kind=sp), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)
pure module function hermitian_cdp(a) -> ah#
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
ahcomplex(kind=dp), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)
pure module function hermitian_iint8(a) -> ah#
Arguments:
ainteger(kind=int8), (:, :), intent(in), dimension(:,:)
Returns:
ahinteger(kind=int8), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)
pure module function hermitian_iint16(a) -> ah#
Arguments:
ainteger(kind=int16), (:, :), intent(in), dimension(:,:)
Returns:
ahinteger(kind=int16), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)
pure module function hermitian_iint32(a) -> ah#
Arguments:
ainteger(kind=int32), (:, :), intent(in), dimension(:,:)
Returns:
ahinteger(kind=int32), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)
pure module function hermitian_iint64(a) -> ah#
Arguments:
ainteger(kind=int64), (:, :), intent(in), dimension(:,:)
Returns:
ahinteger(kind=int64), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)

is_triangular (interface)#

is_triangular (interface)

Checks if a matrix (rank-2 array) is triangular (Specification: stdlib_linalg)

Procedures:

is_hessenberg (interface)#

is_hessenberg (interface)

Checks if a matrix (rank-2 array) is Hessenberg (Specification: stdlib_linalg)

Procedures:
  • is_Hessenberg_rsp

  • is_Hessenberg_rdp

  • is_Hessenberg_csp

  • is_Hessenberg_cdp

  • is_Hessenberg_iint8

  • is_Hessenberg_iint16

  • is_Hessenberg_iint32

  • is_Hessenberg_iint64

solve (interface)#

solve (interface)

Solves the linear system ( A cdot x = b ) for the unknown vector ( x ) from a square matrix ( A ). (Specification: stdlib_linalg)

Procedures:
module function stdlib_linalg_s_solve_one(a, b, overwrite_a, err) -> x#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
xreal(kind=sp), allocatable, target, dimension(:)

Result array/matrix x[n] or x[n,nrhs]

pure module function stdlib_linalg_s_pure_solve_one(a, b) -> x#
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

breal(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

Returns:
xreal(kind=sp), allocatable, target, dimension(:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_d_solve_one(a, b, overwrite_a, err) -> x#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
xreal(kind=dp), allocatable, target, dimension(:)

Result array/matrix x[n] or x[n,nrhs]

pure module function stdlib_linalg_d_pure_solve_one(a, b) -> x#
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

breal(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

Returns:
xreal(kind=dp), allocatable, target, dimension(:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_c_solve_one(a, b, overwrite_a, err) -> x#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
xcomplex(kind=sp), allocatable, target, dimension(:)

Result array/matrix x[n] or x[n,nrhs]

pure module function stdlib_linalg_c_pure_solve_one(a, b) -> x#
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

Returns:
xcomplex(kind=sp), allocatable, target, dimension(:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_z_solve_one(a, b, overwrite_a, err) -> x#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
xcomplex(kind=dp), allocatable, target, dimension(:)

Result array/matrix x[n] or x[n,nrhs]

pure module function stdlib_linalg_z_pure_solve_one(a, b) -> x#
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

Returns:
xcomplex(kind=dp), allocatable, target, dimension(:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_s_solve_many(a, b, overwrite_a, err) -> x#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
xreal(kind=sp), allocatable, target, (:, :), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

pure module function stdlib_linalg_s_pure_solve_many(a, b) -> x#
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

breal(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

Returns:
xreal(kind=sp), allocatable, target, (:, :), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_d_solve_many(a, b, overwrite_a, err) -> x#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
xreal(kind=dp), allocatable, target, (:, :), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

pure module function stdlib_linalg_d_pure_solve_many(a, b) -> x#
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

breal(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

Returns:
xreal(kind=dp), allocatable, target, (:, :), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_c_solve_many(a, b, overwrite_a, err) -> x#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
xcomplex(kind=sp), allocatable, target, (:, :), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

pure module function stdlib_linalg_c_pure_solve_many(a, b) -> x#
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

Returns:
xcomplex(kind=sp), allocatable, target, (:, :), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_z_solve_many(a, b, overwrite_a, err) -> x#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
xcomplex(kind=dp), allocatable, target, (:, :), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

pure module function stdlib_linalg_z_pure_solve_many(a, b) -> x#
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

Returns:
xcomplex(kind=dp), allocatable, target, (:, :), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

Summary

Interface for solving a linear system arising from a general matrix.

Description

This interface provides methods for computing the solution of a linear matrix system. Supported data types include real and complex. No assumption is made on the matrix structure. The function can solve simultaneously either one (from a 1-d right-hand-side vector b(:)) or several (from a 2-d right-hand-side vector b(:,:)) systems.

Notes

The solution is based on LAPACK’s generic LU decomposition based solvers *GESV.

solve_lu (interface)#

solve_lu (interface)

Solves the linear system ( A cdot x = b ) for the unknown vector ( x ) from a square matrix ( A ). (Specification: stdlib_linalg)

Procedures:
pure module subroutine stdlib_linalg_s_solve_lu_one(a, b, x, pivot, overwrite_a, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=sp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_d_solve_lu_one(a, b, x, pivot, overwrite_a, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=dp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_c_solve_lu_one(a, b, x, pivot, overwrite_a, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=sp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_z_solve_lu_one(a, b, x, pivot, overwrite_a, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=dp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_s_solve_lu_many(a, b, x, pivot, overwrite_a, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=sp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_d_solve_lu_many(a, b, x, pivot, overwrite_a, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=dp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_c_solve_lu_many(a, b, x, pivot, overwrite_a, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=sp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_z_solve_lu_many(a, b, x, pivot, overwrite_a, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=dp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Subroutine interface for solving a linear system using LU decomposition.

Description

This interface provides methods for computing the solution of a linear matrix system using a subroutine. Supported data types include real and complex. No assumption is made on the matrix structure. Preallocated space for the solution vector x is user-provided, and it may be provided for the array of pivot indices, pivot. If all pre-allocated work spaces are provided, no internal memory allocations take place when using this interface. The function can solve simultaneously either one (from a 1-d right-hand-side vector b(:)) or several (from a 2-d right-hand-side vector b(:,:)) systems.

Notes

The solution is based on LAPACK’s generic LU decomposition based solvers *GESV.

solve_chol (interface)#

solve_chol (interface)

Solves the linear system ( A cdot x = b ) for the unknown vector ( x ) from a symmetric positive definite matrix ( A ). Combines factorization and solve in one call. (Specification: stdlib_linalg)

Procedures:
pure module subroutine stdlib_linalg_s_solve_chol_one(a, b, x, lower, overwrite_a, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input SPD matrix a[n,n]

breal(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=sp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

lowerlogical(kind=lk), intent(in), optional

[optional] Use lower triangular factorization? Default = .true.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed? Default = .false.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_d_solve_chol_one(a, b, x, lower, overwrite_a, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input SPD matrix a[n,n]

breal(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=dp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

lowerlogical(kind=lk), intent(in), optional

[optional] Use lower triangular factorization? Default = .true.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed? Default = .false.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_c_solve_chol_one(a, b, x, lower, overwrite_a, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input SPD matrix a[n,n]

bcomplex(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=sp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

lowerlogical(kind=lk), intent(in), optional

[optional] Use lower triangular factorization? Default = .true.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed? Default = .false.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_z_solve_chol_one(a, b, x, lower, overwrite_a, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input SPD matrix a[n,n]

bcomplex(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=dp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

lowerlogical(kind=lk), intent(in), optional

[optional] Use lower triangular factorization? Default = .true.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed? Default = .false.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_s_solve_chol_many(a, b, x, lower, overwrite_a, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input SPD matrix a[n,n]

breal(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=sp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

lowerlogical(kind=lk), intent(in), optional

[optional] Use lower triangular factorization? Default = .true.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed? Default = .false.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_d_solve_chol_many(a, b, x, lower, overwrite_a, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input SPD matrix a[n,n]

breal(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=dp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

lowerlogical(kind=lk), intent(in), optional

[optional] Use lower triangular factorization? Default = .true.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed? Default = .false.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_c_solve_chol_many(a, b, x, lower, overwrite_a, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input SPD matrix a[n,n]

bcomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=sp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

lowerlogical(kind=lk), intent(in), optional

[optional] Use lower triangular factorization? Default = .true.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed? Default = .false.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_z_solve_chol_many(a, b, x, lower, overwrite_a, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input SPD matrix a[n,n]

bcomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=dp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

lowerlogical(kind=lk), intent(in), optional

[optional] Use lower triangular factorization? Default = .true.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed? Default = .false.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

One-shot factorization and solve for SPD systems (wraps LAPACK POSV).

Description

This interface computes both the Cholesky factorization and solves the linear system in a single call. Use this for one-time solves. For repeated solves with the same matrix but different RHS, use cholesky + solve_lower_chol/solve_upper_chol for better performance. Supported data types include real and complex. By default, A is not overwritten. Set overwrite_a=.true. to allow in-place factorization for better performance.

Notes

The solution is based on LAPACK’s *POSV routines.

solve_lower_chol (interface)#

solve_lower_chol (interface)

Solves the linear system ( A cdot x = b ) for the unknown vector ( x ) from a symmetric positive definite matrix ( A ) using pre-computed LOWER Cholesky factor ( L ). (Specification: stdlib_linalg)

Procedures:
pure module subroutine stdlib_linalg_s_solve_lower_chol_one(l, b, x, err)#
Arguments:
lreal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix l[n,n] containing lower Cholesky factor L from cholesky(…,lower=.true.)

breal(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=sp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_d_solve_lower_chol_one(l, b, x, err)#
Arguments:
lreal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix l[n,n] containing lower Cholesky factor L from cholesky(…,lower=.true.)

breal(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=dp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_c_solve_lower_chol_one(l, b, x, err)#
Arguments:
lcomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix l[n,n] containing lower Cholesky factor L from cholesky(…,lower=.true.)

bcomplex(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=sp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_z_solve_lower_chol_one(l, b, x, err)#
Arguments:
lcomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix l[n,n] containing lower Cholesky factor L from cholesky(…,lower=.true.)

bcomplex(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=dp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_s_solve_lower_chol_many(l, b, x, err)#
Arguments:
lreal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix l[n,n] containing lower Cholesky factor L from cholesky(…,lower=.true.)

breal(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=sp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_d_solve_lower_chol_many(l, b, x, err)#
Arguments:
lreal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix l[n,n] containing lower Cholesky factor L from cholesky(…,lower=.true.)

breal(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=dp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_c_solve_lower_chol_many(l, b, x, err)#
Arguments:
lcomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix l[n,n] containing lower Cholesky factor L from cholesky(…,lower=.true.)

bcomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=sp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_z_solve_lower_chol_many(l, b, x, err)#
Arguments:
lcomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix l[n,n] containing lower Cholesky factor L from cholesky(…,lower=.true.)

bcomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=dp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Subroutine interface for solving a linear system using pre-computed lower Cholesky factor.

Description

This interface solves a linear system using a pre-computed lower triangular Cholesky factor ( L ) where ( A = L cdot L^T ). The input matrix must come from a prior call to cholesky with lower=.true.. Supported data types include real and complex.

Notes

The solution is based on LAPACK’s *POTRS routines.

solve_upper_chol (interface)#

solve_upper_chol (interface)

Solves the linear system ( A cdot x = b ) for the unknown vector ( x ) from a symmetric positive definite matrix ( A ) using pre-computed UPPER Cholesky factor ( U ). (Specification: stdlib_linalg)

Procedures:
pure module subroutine stdlib_linalg_s_solve_upper_chol_one(u, b, x, err)#
Arguments:
ureal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix u[n,n] containing upper Cholesky factor U from cholesky(…,lower=.false.)

breal(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=sp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_d_solve_upper_chol_one(u, b, x, err)#
Arguments:
ureal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix u[n,n] containing upper Cholesky factor U from cholesky(…,lower=.false.)

breal(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=dp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_c_solve_upper_chol_one(u, b, x, err)#
Arguments:
ucomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix u[n,n] containing upper Cholesky factor U from cholesky(…,lower=.false.)

bcomplex(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=sp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_z_solve_upper_chol_one(u, b, x, err)#
Arguments:
ucomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix u[n,n] containing upper Cholesky factor U from cholesky(…,lower=.false.)

bcomplex(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=dp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_s_solve_upper_chol_many(u, b, x, err)#
Arguments:
ureal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix u[n,n] containing upper Cholesky factor U from cholesky(…,lower=.false.)

breal(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=sp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_d_solve_upper_chol_many(u, b, x, err)#
Arguments:
ureal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix u[n,n] containing upper Cholesky factor U from cholesky(…,lower=.false.)

breal(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=dp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_c_solve_upper_chol_many(u, b, x, err)#
Arguments:
ucomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix u[n,n] containing upper Cholesky factor U from cholesky(…,lower=.false.)

bcomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=sp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_z_solve_upper_chol_many(u, b, x, err)#
Arguments:
ucomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix u[n,n] containing upper Cholesky factor U from cholesky(…,lower=.false.)

bcomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=dp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Subroutine interface for solving a linear system using pre-computed upper Cholesky factor.

Description

This interface solves a linear system using a pre-computed upper triangular Cholesky factor ( U ) where ( A = U^T cdot U ). The input matrix must come from a prior call to cholesky with lower=.false.. Supported data types include real and complex.

Notes

The solution is based on LAPACK’s *POTRS routines.

lstsq (interface)#

lstsq (interface)

Computes the squares solution to system ( A cdot x = b ). (Specification: stdlib_linalg)

Procedures:
module function stdlib_linalg_s_lstsq_one(a, b, cond, overwrite_a, rank, err) -> x#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

condreal(kind=sp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
xreal(kind=sp), allocatable, target, dimension(:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_d_lstsq_one(a, b, cond, overwrite_a, rank, err) -> x#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

condreal(kind=dp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
xreal(kind=dp), allocatable, target, dimension(:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_c_lstsq_one(a, b, cond, overwrite_a, rank, err) -> x#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

condreal(kind=sp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
xcomplex(kind=sp), allocatable, target, dimension(:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_z_lstsq_one(a, b, cond, overwrite_a, rank, err) -> x#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

condreal(kind=dp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
xcomplex(kind=dp), allocatable, target, dimension(:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_s_lstsq_many(a, b, cond, overwrite_a, rank, err) -> x#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

condreal(kind=sp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
xreal(kind=sp), allocatable, target, (:, :), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_d_lstsq_many(a, b, cond, overwrite_a, rank, err) -> x#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

condreal(kind=dp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
xreal(kind=dp), allocatable, target, (:, :), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_c_lstsq_many(a, b, cond, overwrite_a, rank, err) -> x#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

condreal(kind=sp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
xcomplex(kind=sp), allocatable, target, (:, :), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

module function stdlib_linalg_z_lstsq_many(a, b, cond, overwrite_a, rank, err) -> x#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

condreal(kind=dp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
xcomplex(kind=dp), allocatable, target, (:, :), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

Summary

Interface for computing least squares, i.e. the 2-norm ( || (b-A cdot x ||_2 ) minimizing solution.

Description

This interface provides methods for computing the least squares of a linear matrix system. Supported data types include real and complex.

Notes

The solution is based on LAPACK’s singular value decomposition *GELSD methods.

solve_lstsq (interface)#

solve_lstsq (interface)

Computes the squares solution to system ( A cdot x = b ). (Specification: stdlib_linalg)

Procedures:
module subroutine stdlib_linalg_s_solve_lstsq_one(a, b, x, real_storage, int_storage, cond, singvals, overwrite_a, rank, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=sp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

real_storagereal(kind=sp), target, intent(inout), optional, dimension(:)

[optional] real working storage space

int_storageinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] integer working storage space

condreal(kind=sp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

singvalsreal(kind=sp), target, intent(out), optional, dimension(:)

[optional] list of singular values [min(m,n)], in descending magnitude order, returned by the SVD

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_d_solve_lstsq_one(a, b, x, real_storage, int_storage, cond, singvals, overwrite_a, rank, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=dp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

real_storagereal(kind=dp), target, intent(inout), optional, dimension(:)

[optional] real working storage space

int_storageinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] integer working storage space

condreal(kind=dp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

singvalsreal(kind=dp), target, intent(out), optional, dimension(:)

[optional] list of singular values [min(m,n)], in descending magnitude order, returned by the SVD

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_c_solve_lstsq_one(a, b, x, real_storage, int_storage, cmpl_storage, cond, singvals, overwrite_a, rank, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=sp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

real_storagereal(kind=sp), target, intent(inout), optional, dimension(:)

[optional] real working storage space

int_storageinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] integer working storage space

cmpl_storagecomplex(kind=sp), target, intent(inout), optional, dimension(:)

[optional] complex working storage space

condreal(kind=sp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

singvalsreal(kind=sp), target, intent(out), optional, dimension(:)

[optional] list of singular values [min(m,n)], in descending magnitude order, returned by the SVD

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_z_solve_lstsq_one(a, b, x, real_storage, int_storage, cmpl_storage, cond, singvals, overwrite_a, rank, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=dp), contiguous, target, intent(inout), dimension(:)

Result array/matrix x[n] or x[n,nrhs]

real_storagereal(kind=dp), target, intent(inout), optional, dimension(:)

[optional] real working storage space

int_storageinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] integer working storage space

cmpl_storagecomplex(kind=dp), target, intent(inout), optional, dimension(:)

[optional] complex working storage space

condreal(kind=dp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

singvalsreal(kind=dp), target, intent(out), optional, dimension(:)

[optional] list of singular values [min(m,n)], in descending magnitude order, returned by the SVD

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_s_solve_lstsq_many(a, b, x, real_storage, int_storage, cond, singvals, overwrite_a, rank, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=sp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

real_storagereal(kind=sp), target, intent(inout), optional, dimension(:)

[optional] real working storage space

int_storageinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] integer working storage space

condreal(kind=sp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

singvalsreal(kind=sp), target, intent(out), optional, dimension(:)

[optional] list of singular values [min(m,n)], in descending magnitude order, returned by the SVD

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_d_solve_lstsq_many(a, b, x, real_storage, int_storage, cond, singvals, overwrite_a, rank, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

breal(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xreal(kind=dp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

real_storagereal(kind=dp), target, intent(inout), optional, dimension(:)

[optional] real working storage space

int_storageinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] integer working storage space

condreal(kind=dp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

singvalsreal(kind=dp), target, intent(out), optional, dimension(:)

[optional] list of singular values [min(m,n)], in descending magnitude order, returned by the SVD

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_c_solve_lstsq_many(a, b, x, real_storage, int_storage, cmpl_storage, cond, singvals, overwrite_a, rank, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=sp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

real_storagereal(kind=sp), target, intent(inout), optional, dimension(:)

[optional] real working storage space

int_storageinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] integer working storage space

cmpl_storagecomplex(kind=sp), target, intent(inout), optional, dimension(:)

[optional] complex working storage space

condreal(kind=sp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

singvalsreal(kind=sp), target, intent(out), optional, dimension(:)

[optional] list of singular values [min(m,n)], in descending magnitude order, returned by the SVD

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_z_solve_lstsq_many(a, b, x, real_storage, int_storage, cmpl_storage, cond, singvals, overwrite_a, rank, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

bcomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

xcomplex(kind=dp), contiguous, target, (:, :), intent(inout), dimension(:,:)

Result array/matrix x[n] or x[n,nrhs]

real_storagereal(kind=dp), target, intent(inout), optional, dimension(:)

[optional] real working storage space

int_storageinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] integer working storage space

cmpl_storagecomplex(kind=dp), target, intent(inout), optional, dimension(:)

[optional] complex working storage space

condreal(kind=dp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

singvalsreal(kind=dp), target, intent(out), optional, dimension(:)

[optional] list of singular values [min(m,n)], in descending magnitude order, returned by the SVD

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A,b data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Subroutine interface for computing least squares, i.e. the 2-norm ( || (b-A cdot x ||_2 ) minimizing solution.

Description

This interface provides methods for computing the least squares of a linear matrix system using a subroutine. Supported data types include real and complex. If pre-allocated work spaces are provided, no internal memory allocations take place when using this interface.

Notes

The solution is based on LAPACK’s singular value decomposition *GELSD methods.

lstsq_space (interface)#

lstsq_space (interface)

Computes the integer, real [, complex] working space required by the least-squares solver (Specification: stdlib_linalg)

Procedures:
pure module subroutine stdlib_linalg_s_lstsq_space_one(a, b, lrwork, liwork)#
Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

breal(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

lrworkinteger(kind=ilp), intent(out)

Size of the working space arrays

liworkinteger(kind=ilp), intent(out)

Size of the working space arrays

pure module subroutine stdlib_linalg_d_lstsq_space_one(a, b, lrwork, liwork)#
Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

breal(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

lrworkinteger(kind=ilp), intent(out)

Size of the working space arrays

liworkinteger(kind=ilp), intent(out)

Size of the working space arrays

pure module subroutine stdlib_linalg_c_lstsq_space_one(a, b, lrwork, liwork, lcwork)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

bcomplex(kind=sp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

lrworkinteger(kind=ilp), intent(out)

Size of the working space arrays

liworkinteger(kind=ilp), intent(out)

Size of the working space arrays

lcworkinteger(kind=ilp), intent(out)

Size of the working space arrays

pure module subroutine stdlib_linalg_z_lstsq_space_one(a, b, lrwork, liwork, lcwork)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

bcomplex(kind=dp), intent(in), dimension(:)

Right hand side vector or array, b[n] or b[n,nrhs]

lrworkinteger(kind=ilp), intent(out)

Size of the working space arrays

liworkinteger(kind=ilp), intent(out)

Size of the working space arrays

lcworkinteger(kind=ilp), intent(out)

Size of the working space arrays

pure module subroutine stdlib_linalg_s_lstsq_space_many(a, b, lrwork, liwork)#
Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

breal(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

lrworkinteger(kind=ilp), intent(out)

Size of the working space arrays

liworkinteger(kind=ilp), intent(out)

Size of the working space arrays

pure module subroutine stdlib_linalg_d_lstsq_space_many(a, b, lrwork, liwork)#
Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

breal(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

lrworkinteger(kind=ilp), intent(out)

Size of the working space arrays

liworkinteger(kind=ilp), intent(out)

Size of the working space arrays

pure module subroutine stdlib_linalg_c_lstsq_space_many(a, b, lrwork, liwork, lcwork)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

bcomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

lrworkinteger(kind=ilp), intent(out)

Size of the working space arrays

liworkinteger(kind=ilp), intent(out)

Size of the working space arrays

lcworkinteger(kind=ilp), intent(out)

Size of the working space arrays

pure module subroutine stdlib_linalg_z_lstsq_space_many(a, b, lrwork, liwork, lcwork)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

bcomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Right hand side vector or array, b[n] or b[n,nrhs]

lrworkinteger(kind=ilp), intent(out)

Size of the working space arrays

liworkinteger(kind=ilp), intent(out)

Size of the working space arrays

lcworkinteger(kind=ilp), intent(out)

Size of the working space arrays

Description

This interface provides sizes of integer, real [, complex] working spaces required by the least-squares solver. These sizes can be used to pre-allocated working arrays in case several repeated least-squares solutions to a same system are sought. If pre-allocated working arrays are provided, no internal allocations will take place.

constrained_lstsq (interface)#

constrained_lstsq (interface)

Computes the solution of the equality constrained least-squares problem

minimize || Ax - b ||² subject to Cx = d

where A is of size m x n and C of size p x n. (Specification: stdlib_linalg)

### Description

This interface provides methods for computing the solution of an equality-constrained least-squares problem using a function. Supported data types include real and complex.

Procedures:
module function stdlib_linalg_s_constrained_lstsq(A, b, C, d, overwrite_matrices, err) -> x#
Arguments:
Areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Least-squares cost

breal(kind=sp), target, intent(inout), dimension(:)

Least-squares cost

Creal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Equality constraints.

dreal(kind=sp), target, intent(inout), dimension(:)

Equality constraints.

overwrite_matriceslogical(kind=lk), intent(in), optional

[optional] Can A and C be overwritten?

errtype(linalg_state_type), intent(out), optional

[optional] State return flag.

Returns:
xreal(kind=sp), allocatable, target, dimension(:)

Solution of the constrained least-squares problem.

module function stdlib_linalg_d_constrained_lstsq(A, b, C, d, overwrite_matrices, err) -> x#
Arguments:
Areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Least-squares cost

breal(kind=dp), target, intent(inout), dimension(:)

Least-squares cost

Creal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Equality constraints.

dreal(kind=dp), target, intent(inout), dimension(:)

Equality constraints.

overwrite_matriceslogical(kind=lk), intent(in), optional

[optional] Can A and C be overwritten?

errtype(linalg_state_type), intent(out), optional

[optional] State return flag.

Returns:
xreal(kind=dp), allocatable, target, dimension(:)

Solution of the constrained least-squares problem.

module function stdlib_linalg_c_constrained_lstsq(A, b, C, d, overwrite_matrices, err) -> x#
Arguments:
Acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Least-squares cost

bcomplex(kind=sp), target, intent(inout), dimension(:)

Least-squares cost

Ccomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Equality constraints.

dcomplex(kind=sp), target, intent(inout), dimension(:)

Equality constraints.

overwrite_matriceslogical(kind=lk), intent(in), optional

[optional] Can A and C be overwritten?

errtype(linalg_state_type), intent(out), optional

[optional] State return flag.

Returns:
xcomplex(kind=sp), allocatable, target, dimension(:)

Solution of the constrained least-squares problem.

module function stdlib_linalg_z_constrained_lstsq(A, b, C, d, overwrite_matrices, err) -> x#
Arguments:
Acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Least-squares cost

bcomplex(kind=dp), target, intent(inout), dimension(:)

Least-squares cost

Ccomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Equality constraints.

dcomplex(kind=dp), target, intent(inout), dimension(:)

Equality constraints.

overwrite_matriceslogical(kind=lk), intent(in), optional

[optional] Can A and C be overwritten?

errtype(linalg_state_type), intent(out), optional

[optional] State return flag.

Returns:
xcomplex(kind=dp), allocatable, target, dimension(:)

Solution of the constrained least-squares problem.

Notes

The solution is based on LAPACK’s *GGLSE methods.

solve_constrained_lstsq (interface)#

solve_constrained_lstsq (interface)

Computes the solution of the equality constrained least-squares problem

minimize || Ax - b ||² subject to Cx = d

where A is of size m x n and C of size p x n. (Specification: stdlib_linalg)

### Description

This interface provides methods for computing the solution of an equality-constrained least-squares problem using a subroutine. Supported data types include real and complex. If a pre-allocated workspace is provided, no internal memory allocation takes place.

Procedures:
module subroutine stdlib_linalg_s_solve_constrained_lstsq(A, b, C, d, x, storage, overwrite_matrices, err)#
Arguments:
Areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Least-squares cost.

breal(kind=sp), target, intent(inout), dimension(:)

Least-squares cost.

Creal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Equality constraints.

dreal(kind=sp), target, intent(inout), dimension(:)

Equality constraints.

xreal(kind=sp), intent(out), dimension(:)

Solution vector.

storagereal(kind=sp), target, intent(out), optional, dimension(:)

[optional] Storage.

overwrite_matriceslogical(kind=lk), intent(in), optional

[optional] Can A and C be overwritten?

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code stops.

module subroutine stdlib_linalg_d_solve_constrained_lstsq(A, b, C, d, x, storage, overwrite_matrices, err)#
Arguments:
Areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Least-squares cost.

breal(kind=dp), target, intent(inout), dimension(:)

Least-squares cost.

Creal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Equality constraints.

dreal(kind=dp), target, intent(inout), dimension(:)

Equality constraints.

xreal(kind=dp), intent(out), dimension(:)

Solution vector.

storagereal(kind=dp), target, intent(out), optional, dimension(:)

[optional] Storage.

overwrite_matriceslogical(kind=lk), intent(in), optional

[optional] Can A and C be overwritten?

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code stops.

module subroutine stdlib_linalg_c_solve_constrained_lstsq(A, b, C, d, x, storage, overwrite_matrices, err)#
Arguments:
Acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Least-squares cost.

bcomplex(kind=sp), target, intent(inout), dimension(:)

Least-squares cost.

Ccomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Equality constraints.

dcomplex(kind=sp), target, intent(inout), dimension(:)

Equality constraints.

xcomplex(kind=sp), intent(out), dimension(:)

Solution vector.

storagecomplex(kind=sp), target, intent(out), optional, dimension(:)

[optional] Storage.

overwrite_matriceslogical(kind=lk), intent(in), optional

[optional] Can A and C be overwritten?

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code stops.

module subroutine stdlib_linalg_z_solve_constrained_lstsq(A, b, C, d, x, storage, overwrite_matrices, err)#
Arguments:
Acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Least-squares cost.

bcomplex(kind=dp), target, intent(inout), dimension(:)

Least-squares cost.

Ccomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Equality constraints.

dcomplex(kind=dp), target, intent(inout), dimension(:)

Equality constraints.

xcomplex(kind=dp), intent(out), dimension(:)

Solution vector.

storagecomplex(kind=dp), target, intent(out), optional, dimension(:)

[optional] Storage.

overwrite_matriceslogical(kind=lk), intent(in), optional

[optional] Can A and C be overwritten?

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code stops.

Notes

The solution is based on LAPACK’s *GGLSE methods.

constrained_lstsq_space (interface)#

constrained_lstsq_space (interface)
Computes the size of the workspace required by the constrained least-squares solver.

(Specification: stdlib_linalg)

### Description

This interface provides the size of the workspace array required by the constrained least-squares solver. It can be used to pre-allocate the working array in case several repeated solutions to a same system are sought. If pre-allocated, working arrays are provided, no internal allocation will take place.

Procedures:
module subroutine stdlib_linalg_s_constrained_lstsq_space(A, C, lwork, err)#
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)

Least-squares cost.

Creal(kind=sp), (:, :), intent(in), dimension(:,:)

Equality constraints.

lworkinteger(kind=ilp), intent(out)
errtype(linalg_state_type), intent(out), optional
module subroutine stdlib_linalg_d_constrained_lstsq_space(A, C, lwork, err)#
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)

Least-squares cost.

Creal(kind=dp), (:, :), intent(in), dimension(:,:)

Equality constraints.

lworkinteger(kind=ilp), intent(out)
errtype(linalg_state_type), intent(out), optional
module subroutine stdlib_linalg_c_constrained_lstsq_space(A, C, lwork, err)#
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Least-squares cost.

Ccomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Equality constraints.

lworkinteger(kind=ilp), intent(out)
errtype(linalg_state_type), intent(out), optional
module subroutine stdlib_linalg_z_constrained_lstsq_space(A, C, lwork, err)#
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Least-squares cost.

Ccomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Equality constraints.

lworkinteger(kind=ilp), intent(out)
errtype(linalg_state_type), intent(out), optional

weighted_lstsq (interface)#

weighted_lstsq (interface)

Computes the weighted least-squares solution to ( min_x |D(Ax - b)|_2^2 ) (Specification: stdlib_linalg)

Procedures:
module function stdlib_linalg_s_weighted_lstsq(w, a, b, cond, overwrite_a, rank, err) -> x#
Arguments:
wreal(kind=sp), intent(in), dimension(:)

Weight vector (must be positive, always real)

areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a(m,n)

breal(kind=sp), intent(in), dimension(:)

Right hand side vector b(m)

condreal(kind=sp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
xreal(kind=sp), allocatable, dimension(:)

Result array x(n)

module function stdlib_linalg_d_weighted_lstsq(w, a, b, cond, overwrite_a, rank, err) -> x#
Arguments:
wreal(kind=dp), intent(in), dimension(:)

Weight vector (must be positive, always real)

areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a(m,n)

breal(kind=dp), intent(in), dimension(:)

Right hand side vector b(m)

condreal(kind=dp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
xreal(kind=dp), allocatable, dimension(:)

Result array x(n)

module function stdlib_linalg_c_weighted_lstsq(w, a, b, cond, overwrite_a, rank, err) -> x#
Arguments:
wreal(kind=sp), intent(in), dimension(:)

Weight vector (must be positive, always real)

acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a(m,n)

bcomplex(kind=sp), intent(in), dimension(:)

Right hand side vector b(m)

condreal(kind=sp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
xcomplex(kind=sp), allocatable, dimension(:)

Result array x(n)

module function stdlib_linalg_z_weighted_lstsq(w, a, b, cond, overwrite_a, rank, err) -> x#
Arguments:
wreal(kind=dp), intent(in), dimension(:)

Weight vector (must be positive, always real)

acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a(m,n)

bcomplex(kind=dp), intent(in), dimension(:)

Right hand side vector b(m)

condreal(kind=dp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
xcomplex(kind=dp), allocatable, dimension(:)

Result array x(n)

Summary

Function interface for computing weighted least-squares via row scaling.

Description

This interface provides methods for computing weighted least-squares by transforming to ordinary least-squares through row scaling. Supported data types include real and complex.

Notes

The solution is based on LAPACK’s *GELSD after applying diagonal weights. Avoid extreme weight ratios (e.g., max(w)/min(w) > 1e6) as this may cause loss of precision in the SVD-based solver.

solve_weighted_lstsq (interface)#

solve_weighted_lstsq (interface)

Computes the weighted least-squares solution to ( min_x |D(Ax - b)|_2^2 ) (Specification: stdlib_linalg)

Procedures:
module subroutine stdlib_linalg_s_solve_weighted_lstsq(w, a, b, x, cond, overwrite_a, rank, err)#
Arguments:
wreal(kind=sp), intent(in), dimension(:)

Weight vector (must be positive, always real)

areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a(m,n)

breal(kind=sp), intent(in), dimension(:)

Right hand side vector b(m)

xreal(kind=sp), contiguous, target, intent(inout), dimension(:)

Result array x(n)

condreal(kind=sp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_d_solve_weighted_lstsq(w, a, b, x, cond, overwrite_a, rank, err)#
Arguments:
wreal(kind=dp), intent(in), dimension(:)

Weight vector (must be positive, always real)

areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a(m,n)

breal(kind=dp), intent(in), dimension(:)

Right hand side vector b(m)

xreal(kind=dp), contiguous, target, intent(inout), dimension(:)

Result array x(n)

condreal(kind=dp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_c_solve_weighted_lstsq(w, a, b, x, cond, overwrite_a, rank, err)#
Arguments:
wreal(kind=sp), intent(in), dimension(:)

Weight vector (must be positive, always real)

acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a(m,n)

bcomplex(kind=sp), intent(in), dimension(:)

Right hand side vector b(m)

xcomplex(kind=sp), contiguous, target, intent(inout), dimension(:)

Result array x(n)

condreal(kind=sp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_z_solve_weighted_lstsq(w, a, b, x, cond, overwrite_a, rank, err)#
Arguments:
wreal(kind=dp), intent(in), dimension(:)

Weight vector (must be positive, always real)

acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a(m,n)

bcomplex(kind=dp), intent(in), dimension(:)

Right hand side vector b(m)

xcomplex(kind=dp), contiguous, target, intent(inout), dimension(:)

Result array x(n)

condreal(kind=dp), intent(in), optional

[optional] cutoff for rank evaluation: singular values s(i)<=cond*maxval(s) are considered 0.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

rankinteger(kind=ilp), intent(out), optional

[optional] Return rank of A

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Subroutine interface for computing weighted least-squares via row scaling.

Description

This interface provides methods for computing weighted least-squares by transforming to ordinary least-squares through row scaling, using a subroutine. Supported data types include real and complex.

Notes

The solution is based on LAPACK’s *GELSD after applying diagonal weights. Avoid extreme weight ratios (e.g., max(w)/min(w) > 1e6) as this may cause loss of precision in the SVD-based solver.

qr (interface)#

qr (interface)

Computes the QR factorization of matrix ( A = Q R ). (Specification: stdlib_linalg)

Procedures:
pure module subroutine stdlib_linalg_s_qr(a, q, r, overwrite_a, storage, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,n]

qreal(kind=sp), contiguous, target, (:, :), intent(out), dimension(:,:)

Orthogonal matrix Q ([m,m], or [m,k] if reduced)

rreal(kind=sp), contiguous, target, (:, :), intent(out), dimension(:,:)

Upper triangular matrix R ([m,n], or [k,n] if reduced)

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagereal(kind=sp), target, intent(out), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with qr_space

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_s_pivoting_qr(a, q, r, pivots, overwrite_a, storage, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m, n]

qreal(kind=sp), contiguous, target, (:, :), intent(out), dimension(:,:)

Orthogonal matrix Q ([m, m] or [m, k] if reduced)

rreal(kind=sp), contiguous, target, (:, :), intent(out), dimension(:,:)

Upper triangular matrix R ([m, n] or [k, n] if reduced)

pivotsinteger(kind=ilp), intent(out), dimension(:)

Pivots.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagereal(kind=sp), target, intent(out), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with qr_space.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop.

pure module subroutine stdlib_linalg_d_qr(a, q, r, overwrite_a, storage, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,n]

qreal(kind=dp), contiguous, target, (:, :), intent(out), dimension(:,:)

Orthogonal matrix Q ([m,m], or [m,k] if reduced)

rreal(kind=dp), contiguous, target, (:, :), intent(out), dimension(:,:)

Upper triangular matrix R ([m,n], or [k,n] if reduced)

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagereal(kind=dp), target, intent(out), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with qr_space

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_d_pivoting_qr(a, q, r, pivots, overwrite_a, storage, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m, n]

qreal(kind=dp), contiguous, target, (:, :), intent(out), dimension(:,:)

Orthogonal matrix Q ([m, m] or [m, k] if reduced)

rreal(kind=dp), contiguous, target, (:, :), intent(out), dimension(:,:)

Upper triangular matrix R ([m, n] or [k, n] if reduced)

pivotsinteger(kind=ilp), intent(out), dimension(:)

Pivots.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagereal(kind=dp), target, intent(out), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with qr_space.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop.

pure module subroutine stdlib_linalg_c_qr(a, q, r, overwrite_a, storage, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,n]

qcomplex(kind=sp), contiguous, target, (:, :), intent(out), dimension(:,:)

Orthogonal matrix Q ([m,m], or [m,k] if reduced)

rcomplex(kind=sp), contiguous, target, (:, :), intent(out), dimension(:,:)

Upper triangular matrix R ([m,n], or [k,n] if reduced)

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagecomplex(kind=sp), target, intent(out), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with qr_space

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_c_pivoting_qr(a, q, r, pivots, overwrite_a, storage, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m, n]

qcomplex(kind=sp), contiguous, target, (:, :), intent(out), dimension(:,:)

Orthogonal matrix Q ([m, m] or [m, k] if reduced)

rcomplex(kind=sp), contiguous, target, (:, :), intent(out), dimension(:,:)

Upper triangular matrix R ([m, n] or [k, n] if reduced)

pivotsinteger(kind=ilp), intent(out), dimension(:)

Pivots.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagecomplex(kind=sp), target, intent(out), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with qr_space.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop.

pure module subroutine stdlib_linalg_z_qr(a, q, r, overwrite_a, storage, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,n]

qcomplex(kind=dp), contiguous, target, (:, :), intent(out), dimension(:,:)

Orthogonal matrix Q ([m,m], or [m,k] if reduced)

rcomplex(kind=dp), contiguous, target, (:, :), intent(out), dimension(:,:)

Upper triangular matrix R ([m,n], or [k,n] if reduced)

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagecomplex(kind=dp), target, intent(out), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with qr_space

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine stdlib_linalg_z_pivoting_qr(a, q, r, pivots, overwrite_a, storage, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m, n]

qcomplex(kind=dp), contiguous, target, (:, :), intent(out), dimension(:,:)

Orthogonal matrix Q ([m, m] or [m, k] if reduced)

rcomplex(kind=dp), contiguous, target, (:, :), intent(out), dimension(:,:)

Upper triangular matrix R ([m, n] or [k, n] if reduced)

pivotsinteger(kind=ilp), intent(out), dimension(:)

Pivots.

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagecomplex(kind=dp), target, intent(out), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with qr_space.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop.

Summary

Compute the QR factorization of a real or complex matrix: ( A = Q R ), where ( Q ) is orthonormal and ( R ) is upper-triangular. Matrix ( A ) has size [m,n], with ( mge n ).

Description

This interface provides methods for computing the QR factorization of a matrix. Supported data types include real and complex. If a pre-allocated work space is provided, no internal memory allocations take place when using this interface.

Given k = min(m,n), one can write ( A = ( Q_1 Q_2 ) cdot ( frac{R_1}{0}) ). The user may want the full problem (provide shape(Q)==[m,m], shape(R)==[m,n]) or the reduced problem only: ( A = Q_1 R_1 ) (provide shape(Q)==[m,k], shape(R)==[k,n]).

Notes

The solution is based on LAPACK’s QR factorization (*GEQRF) and ordered matrix output (*ORGQR, *UNGQR).

qr_space (interface)#

qr_space (interface)

Computes the working array space required by the QR factorization solver (Specification: stdlib_linalg)

Procedures:
pure module subroutine get_qr_s_workspace(a, lwork, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

lworkinteger(kind=ilp), intent(out)

Minimum workspace size for both operations

errtype(linalg_state_type), intent(out), optional

State return flag. Returns an error if the query failed

pure module subroutine get_pivoting_qr_s_workspace(a, lwork, pivoting, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m, n]

lworkinteger(kind=ilp), intent(out)

Minimum workspace size for both operations.

pivotinglogical(kind=lk), intent(in)

Pivoting flag.

errtype(linalg_state_type), intent(out), optional

State return flag. Returns an error if the query failed.

pure module subroutine get_qr_d_workspace(a, lwork, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

lworkinteger(kind=ilp), intent(out)

Minimum workspace size for both operations

errtype(linalg_state_type), intent(out), optional

State return flag. Returns an error if the query failed

pure module subroutine get_pivoting_qr_d_workspace(a, lwork, pivoting, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m, n]

lworkinteger(kind=ilp), intent(out)

Minimum workspace size for both operations.

pivotinglogical(kind=lk), intent(in)

Pivoting flag.

errtype(linalg_state_type), intent(out), optional

State return flag. Returns an error if the query failed.

pure module subroutine get_qr_c_workspace(a, lwork, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

lworkinteger(kind=ilp), intent(out)

Minimum workspace size for both operations

errtype(linalg_state_type), intent(out), optional

State return flag. Returns an error if the query failed

pure module subroutine get_pivoting_qr_c_workspace(a, lwork, pivoting, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m, n]

lworkinteger(kind=ilp), intent(out)

Minimum workspace size for both operations.

pivotinglogical(kind=lk), intent(in)

Pivoting flag.

errtype(linalg_state_type), intent(out), optional

State return flag. Returns an error if the query failed.

pure module subroutine get_qr_z_workspace(a, lwork, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

lworkinteger(kind=ilp), intent(out)

Minimum workspace size for both operations

errtype(linalg_state_type), intent(out), optional

State return flag. Returns an error if the query failed

pure module subroutine get_pivoting_qr_z_workspace(a, lwork, pivoting, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m, n]

lworkinteger(kind=ilp), intent(out)

Minimum workspace size for both operations.

pivotinglogical(kind=lk), intent(in)

Pivoting flag.

errtype(linalg_state_type), intent(out), optional

State return flag. Returns an error if the query failed.

Description

This interface returns the size of the real or complex working storage required by the QR factorization solver. The working size only depends on the kind (real or complex) and size of the matrix being factorized. Storage size can be used to pre-allocate a working array in case several repeated QR factorizations to a same-size matrix are sought. If pre-allocated working arrays are provided, no internal allocations will take place during the factorization.

schur (interface)#

schur (interface)

Computes the Schur decomposition of matrix ( A = Z T Z^H ). (Specification: stdlib_linalg)

Procedures:
module subroutine stdlib_linalg_s_schur(a, t, z, eigvals, overwrite_a, storage, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,m]

treal(kind=sp), contiguous, target, (:, :), intent(out), dimension(:,:)

Schur form of A: upper-triangular or quasi-upper-triangular matrix T

zreal(kind=sp), contiguous, target, (:, :), intent(out), optional, dimension(:,:)

Unitary/orthonormal transformation matrix Z

eigvalscomplex(kind=sp), contiguous, target, intent(out), optional, dimension(:)

[optional] Output eigenvalues that appear on the diagonal of T

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagereal(kind=sp), target, intent(inout), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with schur_space

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_real_eig_s_schur(a, t, z, eigvals, overwrite_a, storage, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,m]

treal(kind=sp), contiguous, target, (:, :), intent(out), dimension(:,:)

Schur form of A: upper-triangular or quasi-upper-triangular matrix T

zreal(kind=sp), contiguous, target, (:, :), intent(out), optional, dimension(:,:)

Unitary/orthonormal transformation matrix Z

eigvalsreal(kind=sp), contiguous, target, intent(out), dimension(:)

Output real eigenvalues that appear on the diagonal of T

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagereal(kind=sp), target, intent(inout), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with schur_space

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_d_schur(a, t, z, eigvals, overwrite_a, storage, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,m]

treal(kind=dp), contiguous, target, (:, :), intent(out), dimension(:,:)

Schur form of A: upper-triangular or quasi-upper-triangular matrix T

zreal(kind=dp), contiguous, target, (:, :), intent(out), optional, dimension(:,:)

Unitary/orthonormal transformation matrix Z

eigvalscomplex(kind=dp), contiguous, target, intent(out), optional, dimension(:)

[optional] Output eigenvalues that appear on the diagonal of T

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagereal(kind=dp), target, intent(inout), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with schur_space

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_real_eig_d_schur(a, t, z, eigvals, overwrite_a, storage, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,m]

treal(kind=dp), contiguous, target, (:, :), intent(out), dimension(:,:)

Schur form of A: upper-triangular or quasi-upper-triangular matrix T

zreal(kind=dp), contiguous, target, (:, :), intent(out), optional, dimension(:,:)

Unitary/orthonormal transformation matrix Z

eigvalsreal(kind=dp), contiguous, target, intent(out), dimension(:)

Output real eigenvalues that appear on the diagonal of T

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagereal(kind=dp), target, intent(inout), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with schur_space

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_c_schur(a, t, z, eigvals, overwrite_a, storage, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,m]

tcomplex(kind=sp), contiguous, target, (:, :), intent(out), dimension(:,:)

Schur form of A: upper-triangular or quasi-upper-triangular matrix T

zcomplex(kind=sp), contiguous, target, (:, :), intent(out), optional, dimension(:,:)

Unitary/orthonormal transformation matrix Z

eigvalscomplex(kind=sp), contiguous, target, intent(out), optional, dimension(:)

[optional] Output eigenvalues that appear on the diagonal of T

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagecomplex(kind=sp), target, intent(inout), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with schur_space

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_real_eig_c_schur(a, t, z, eigvals, overwrite_a, storage, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,m]

tcomplex(kind=sp), contiguous, target, (:, :), intent(out), dimension(:,:)

Schur form of A: upper-triangular or quasi-upper-triangular matrix T

zcomplex(kind=sp), contiguous, target, (:, :), intent(out), optional, dimension(:,:)

Unitary/orthonormal transformation matrix Z

eigvalsreal(kind=sp), contiguous, target, intent(out), dimension(:)

Output real eigenvalues that appear on the diagonal of T

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagecomplex(kind=sp), target, intent(inout), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with schur_space

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_z_schur(a, t, z, eigvals, overwrite_a, storage, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,m]

tcomplex(kind=dp), contiguous, target, (:, :), intent(out), dimension(:,:)

Schur form of A: upper-triangular or quasi-upper-triangular matrix T

zcomplex(kind=dp), contiguous, target, (:, :), intent(out), optional, dimension(:,:)

Unitary/orthonormal transformation matrix Z

eigvalscomplex(kind=dp), contiguous, target, intent(out), optional, dimension(:)

[optional] Output eigenvalues that appear on the diagonal of T

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagecomplex(kind=dp), target, intent(inout), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with schur_space

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_real_eig_z_schur(a, t, z, eigvals, overwrite_a, storage, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix a[m,m]

tcomplex(kind=dp), contiguous, target, (:, :), intent(out), dimension(:,:)

Schur form of A: upper-triangular or quasi-upper-triangular matrix T

zcomplex(kind=dp), contiguous, target, (:, :), intent(out), optional, dimension(:,:)

Unitary/orthonormal transformation matrix Z

eigvalsreal(kind=dp), contiguous, target, intent(out), dimension(:)

Output real eigenvalues that appear on the diagonal of T

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

storagecomplex(kind=dp), target, intent(inout), optional, dimension(:)

[optional] Provide pre-allocated workspace, size to be checked with schur_space

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

Summary

Compute the Schur decomposition of a real or complex matrix: ( A = Z T Z^H ), where ( Z ) is orthonormal/unitary and ( T ) is upper-triangular or quasi-upper-triangular. Matrix ( A ) has size [m,m].

Description

This interface provides methods for computing the Schur decomposition of a matrix. Supported data types include real and complex. If a pre-allocated workspace is provided, no internal memory allocations take place when using this interface.

The output matrix ( T ) is upper-triangular for complex input matrices and quasi-upper-triangular for real input matrices (with possible ( 2 times 2 ) blocks on the diagonal).

Notes

The solution is based on LAPACK’s Schur decomposition routines (*GEES).

schur_space (interface)#

schur_space (interface)

Computes the working array space required by the Schur decomposition solver (Specification: stdlib_linalg)

Procedures:
module subroutine get_schur_s_workspace(a, lwork, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,m]

lworkinteger(kind=ilp), intent(out)

Minimum workspace size for the decomposition operation

errtype(linalg_state_type), intent(out), optional

State return flag. Returns an error if the query failed

module subroutine get_schur_d_workspace(a, lwork, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,m]

lworkinteger(kind=ilp), intent(out)

Minimum workspace size for the decomposition operation

errtype(linalg_state_type), intent(out), optional

State return flag. Returns an error if the query failed

module subroutine get_schur_c_workspace(a, lwork, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,m]

lworkinteger(kind=ilp), intent(out)

Minimum workspace size for the decomposition operation

errtype(linalg_state_type), intent(out), optional

State return flag. Returns an error if the query failed

module subroutine get_schur_z_workspace(a, lwork, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,m]

lworkinteger(kind=ilp), intent(out)

Minimum workspace size for the decomposition operation

errtype(linalg_state_type), intent(out), optional

State return flag. Returns an error if the query failed

Description

This interface returns the size of the real or complex working storage required by the Schur decomposition solver. The working size only depends on the kind (real or complex) and size of the matrix being decomposed. Storage size can be used to pre-allocate a working array in case several repeated Schur decompositions of same-size matrices are sought. If pre-allocated working arrays are provided, no internal allocations will take place during the decomposition.

det (interface)#

det (interface)

Computes the determinant of a square matrix (Specification: stdlib_linalg)

Procedures:
  • stdlib_linalg_rspdeterminant

  • stdlib_linalg_pure_rspdeterminant

  • stdlib_linalg_rdpdeterminant

  • stdlib_linalg_pure_rdpdeterminant

  • stdlib_linalg_cspdeterminant

  • stdlib_linalg_pure_cspdeterminant

  • stdlib_linalg_cdpdeterminant

  • stdlib_linalg_pure_cdpdeterminant

Summary

Interface for computing matrix determinant.

Description

This interface provides methods for computing the determinant of a matrix. Supported data types include real and complex.

Notes

The provided functions are intended for square matrices only.

Example

real(sp) :: a(3,3), d
type(linalg_state_type) :: state  
a = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3])

! ...
d = det(a,err=state)
if (state%ok()) then 
print *, 'Success! det=',d
else
print *, state%print()
endif
! ...

operator(.det.) (interface)#

operator(.det.) (interface)

Determinant operator of a square matrix (Specification: stdlib_linalg)

Procedures:
  • stdlib_linalg_pure_rspdeterminant

  • stdlib_linalg_pure_rdpdeterminant

  • stdlib_linalg_pure_cspdeterminant

  • stdlib_linalg_pure_cdpdeterminant

Summary

Pure operator interface for computing matrix determinant.

Description

This pure operator interface provides a convenient way to compute the determinant of a matrix. Supported data types include real and complex.

Notes

The provided functions are intended for square matrices.

Example

! ...
real(sp) :: matrix(3,3), d
matrix = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3])
d = .det.matrix
! ...

inv (interface)#

inv (interface)

Inverse of a square matrix (Specification: stdlib_linalg)

Procedures:
module function stdlib_linalg_inverse_s(a, err) -> inva#
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
invareal(kind=sp), allocatable, (:, :), dimension(:,:)

Output matrix inverse

module function stdlib_linalg_inverse_d(a, err) -> inva#
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
invareal(kind=dp), allocatable, (:, :), dimension(:,:)

Output matrix inverse

module function stdlib_linalg_inverse_c(a, err) -> inva#
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
invacomplex(kind=sp), allocatable, (:, :), dimension(:,:)

Output matrix inverse

module function stdlib_linalg_inverse_z(a, err) -> inva#
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
invacomplex(kind=dp), allocatable, (:, :), dimension(:,:)

Output matrix inverse

Summary

This interface provides methods for computing the inverse of a square real or complex matrix. The inverse ( A^{-1} ) is defined such that ( A cdot A^{-1} = A^{-1} cdot A = I_n ).

Description

This function interface provides methods that return the inverse of a square matrix. Supported data types include real and complex. The inverse matrix ( A^{-1} ) is returned as a function result. Exceptions are raised in case of singular matrix or invalid size, and trigger an error stop if the state flag err is not provided.

Notes

The provided functions are intended for square matrices.

invert (interface)#

invert (interface)

Inversion of a square matrix (Specification: stdlib_linalg)

Procedures:
module subroutine stdlib_linalg_invert_inplace_s(a, pivot, err)#
Arguments:
areal(kind=sp), (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_invert_split_s(a, inva, pivot, err)#
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n].

invareal(kind=sp), (:, :), intent(out), dimension(:,:)

Inverse matrix a[n,n].

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_invert_inplace_d(a, pivot, err)#
Arguments:
areal(kind=dp), (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_invert_split_d(a, inva, pivot, err)#
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n].

invareal(kind=dp), (:, :), intent(out), dimension(:,:)

Inverse matrix a[n,n].

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_invert_inplace_c(a, pivot, err)#
Arguments:
acomplex(kind=sp), (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_invert_split_c(a, inva, pivot, err)#
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n].

invacomplex(kind=sp), (:, :), intent(out), dimension(:,:)

Inverse matrix a[n,n].

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_invert_inplace_z(a, pivot, err)#
Arguments:
acomplex(kind=dp), (:, :), intent(inout), dimension(:,:)

Input matrix a[n,n]

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_invert_split_z(a, inva, pivot, err)#
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n].

invacomplex(kind=dp), (:, :), intent(out), dimension(:,:)

Inverse matrix a[n,n].

pivotinteger(kind=ilp), target, intent(inout), optional, dimension(:)

[optional] Storage array for the diagonal pivot indices

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

This interface provides methods for inverting a square real or complex matrix in-place. The inverse ( A^{-1} ) is defined such that ( A cdot A^{-1} = A^{-1} cdot A = I_n ).

Description

This subroutine interface provides a way to compute the inverse of a matrix. Supported data types include real and complex. The user may provide a unique matrix argument a. In this case, a is replaced by the inverse matrix. on output. Otherwise, one may provide two separate arguments: an input matrix a and an output matrix inva. In this case, a will not be modified, and the inverse is returned in inva. Pre-allocated storage may be provided for the array of pivot indices, pivot. If all pre-allocated work spaces are provided, no internal memory allocations take place when using this interface.

Notes

The provided subroutines are intended for square matrices.

operator(.inv.) (interface)#

operator(.inv.) (interface)

Inverse operator of a square matrix (Specification: stdlib_linalg)

Procedures:
module function stdlib_linalg_inverse_s_operator(a) -> inva#
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

Returns:
invareal(kind=sp), allocatable, (:, :), dimension(:,:)

Result matrix

module function stdlib_linalg_inverse_d_operator(a) -> inva#
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

Returns:
invareal(kind=dp), allocatable, (:, :), dimension(:,:)

Result matrix

module function stdlib_linalg_inverse_c_operator(a) -> inva#
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

Returns:
invacomplex(kind=sp), allocatable, (:, :), dimension(:,:)

Result matrix

module function stdlib_linalg_inverse_z_operator(a) -> inva#
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[n,n]

Returns:
invacomplex(kind=dp), allocatable, (:, :), dimension(:,:)

Result matrix

Summary

Operator interface for computing the inverse of a square real or complex matrix.

Description

This operator interface provides a convenient way to compute the inverse of a matrix. Supported data types include real and complex. On input errors or singular matrix, NaNs will be returned.

Notes

The provided functions are intended for square matrices.

pinv (interface)#

pinv (interface)

Pseudo-inverse of a matrix (Specification: stdlib_linalg)

Procedures:
module function stdlib_linalg_pseudoinverse_s(a, rtol, err) -> pinva#
Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

rtolreal(kind=sp), intent(in), optional

[optional] Relative tolerance for singular value cutoff

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

Returns:
pinvareal(kind=sp), (size(a, 2, kind=ilp), size(a, 1, kind=ilp)), dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)

Output matrix pseudo-inverse [n,m]

module function stdlib_linalg_pseudoinverse_d(a, rtol, err) -> pinva#
Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

rtolreal(kind=dp), intent(in), optional

[optional] Relative tolerance for singular value cutoff

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

Returns:
pinvareal(kind=dp), (size(a, 2, kind=ilp), size(a, 1, kind=ilp)), dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)

Output matrix pseudo-inverse [n,m]

module function stdlib_linalg_pseudoinverse_c(a, rtol, err) -> pinva#
Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

rtolreal(kind=sp), intent(in), optional

[optional] Relative tolerance for singular value cutoff

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

Returns:
pinvacomplex(kind=sp), (size(a, 2, kind=ilp), size(a, 1, kind=ilp)), dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)

Output matrix pseudo-inverse [n,m]

module function stdlib_linalg_pseudoinverse_z(a, rtol, err) -> pinva#
Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

rtolreal(kind=dp), intent(in), optional

[optional] Relative tolerance for singular value cutoff

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

Returns:
pinvacomplex(kind=dp), (size(a, 2, kind=ilp), size(a, 1, kind=ilp)), dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)

Output matrix pseudo-inverse [n,m]

Summary

This interface provides methods for computing the Moore-Penrose pseudo-inverse of a matrix. The pseudo-inverse ( A^{+} ) is a generalization of the matrix inverse, computed for square, singular, or rectangular matrices. It is defined such that it satisfies the conditions: - ( A cdot A^{+} cdot A = A ) - ( A^{+} cdot A cdot A^{+} = A^{+} ) - ( (A cdot A^{+})^T = A cdot A^{+} ) - ( (A^{+} cdot A)^T = A^{+} cdot A )

Description

This function interface provides methods that return the Moore-Penrose pseudo-inverse of a matrix. Supported data types include real and complex. The pseudo-inverse ( A^{+} ) is returned as a function result. The computation is based on the singular value decomposition (SVD). An optional relative tolerance rtol is provided to control the inclusion of singular values during inversion. Singular values below ( text{rtol} cdot sigma_{max} ) are treated as zero, where ( sigma_{max} ) is the largest singular value. If rtol is not provided, a default threshold is applied.

Exceptions are raised in case of computational errors or invalid input, and trigger an error stop if the state flag err is not provided.

Notes

The provided functions are intended for both rectangular and square matrices.

pseudoinvert (interface)#

pseudoinvert (interface)

Computation of the Moore-Penrose pseudo-inverse (Specification: stdlib_linalg)

Procedures:
module subroutine stdlib_linalg_pseudoinvert_s(a, pinva, rtol, err)#
Arguments:
areal(kind=sp), (:, :), intent(inout), dimension(:,:)

Input matrix a[m,n]

pinvareal(kind=sp), (:, :), intent(out), dimension(:,:)

Output pseudo-inverse matrix [n,m]

rtolreal(kind=sp), intent(in), optional

[optional] Relative tolerance for singular value cutoff

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_pseudoinvert_d(a, pinva, rtol, err)#
Arguments:
areal(kind=dp), (:, :), intent(inout), dimension(:,:)

Input matrix a[m,n]

pinvareal(kind=dp), (:, :), intent(out), dimension(:,:)

Output pseudo-inverse matrix [n,m]

rtolreal(kind=dp), intent(in), optional

[optional] Relative tolerance for singular value cutoff

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_pseudoinvert_c(a, pinva, rtol, err)#
Arguments:
acomplex(kind=sp), (:, :), intent(inout), dimension(:,:)

Input matrix a[m,n]

pinvacomplex(kind=sp), (:, :), intent(out), dimension(:,:)

Output pseudo-inverse matrix [n,m]

rtolreal(kind=sp), intent(in), optional

[optional] Relative tolerance for singular value cutoff

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_pseudoinvert_z(a, pinva, rtol, err)#
Arguments:
acomplex(kind=dp), (:, :), intent(inout), dimension(:,:)

Input matrix a[m,n]

pinvacomplex(kind=dp), (:, :), intent(out), dimension(:,:)

Output pseudo-inverse matrix [n,m]

rtolreal(kind=dp), intent(in), optional

[optional] Relative tolerance for singular value cutoff

errtype(linalg_state_type), intent(out), optional

[optional] State return flag. On error if not requested, the code will stop

Summary

This interface provides methods for computing the Moore-Penrose pseudo-inverse of a rectangular or square real or complex matrix. The pseudo-inverse ( A^{+} ) generalizes the matrix inverse and satisfies the properties: - ( A cdot A^{+} cdot A = A ) - ( A^{+} cdot A cdot A^{+} = A^{+} ) - ( (A cdot A^{+})^T = A cdot A^{+} ) - ( (A^{+} cdot A)^T = A^{+} cdot A )

Description

This subroutine interface provides a way to compute the Moore-Penrose pseudo-inverse of a matrix. Supported data types include real and complex. Users must provide two matrices: the input matrix a [m,n] and the output pseudo-inverse pinva [n,m]. The input matrix a is used to compute the pseudo-inverse and is not modified. The computed pseudo-inverse is stored in pinva. The computation is based on the singular value decomposition (SVD).

An optional relative tolerance rtol is used to control the inclusion of singular values in the computation. Singular values below ( text{rtol} cdot sigma_{max} ) are treated as zero, where ( sigma_{max} ) is the largest singular value. If rtol is not provided, a default threshold is applied.

Exceptions are raised in case of computational errors or invalid input, and trigger an error stop if the state flag err is not provided.

Notes

The provided subroutines are intended for both rectangular and square matrices.

operator(.pinv.) (interface)#

operator(.pinv.) (interface)

Pseudo-inverse operator of a matrix (Specification: stdlib_linalg)

Procedures:
module function stdlib_linalg_pinv_s_operator(a) -> pinva#
Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

Returns:
pinvareal(kind=sp), (size(a, 2, kind=ilp), size(a, 1, kind=ilp)), dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)

Result pseudo-inverse matrix

module function stdlib_linalg_pinv_d_operator(a) -> pinva#
Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

Returns:
pinvareal(kind=dp), (size(a, 2, kind=ilp), size(a, 1, kind=ilp)), dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)

Result pseudo-inverse matrix

module function stdlib_linalg_pinv_c_operator(a) -> pinva#
Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

Returns:
pinvacomplex(kind=sp), (size(a, 2, kind=ilp), size(a, 1, kind=ilp)), dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)

Result pseudo-inverse matrix

module function stdlib_linalg_pinv_z_operator(a) -> pinva#
Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[m,n]

Returns:
pinvacomplex(kind=dp), (size(a, 2, kind=ilp), size(a, 1, kind=ilp)), dimension(size(a,2,kind=ilp),size(a,1,kind=ilp)

Result pseudo-inverse matrix

Summary

Operator interface for computing the Moore-Penrose pseudo-inverse of a real or complex matrix.

Description

This operator interface provides a convenient way to compute the Moore-Penrose pseudo-inverse of a matrix. Supported data types include real and complex. The pseudo-inverse ( A^{+} ) is computed using singular value decomposition (SVD), with singular values below an internal threshold treated as zero.

For computational errors or invalid input, the function may return a matrix filled with NaNs.

Notes

The provided functions are intended for both rectangular and square matrices.

eig (interface)#

eig (interface)

Solves the eigendecomposition ( A cdot bar{v} - lambda cdot bar{v} ) for square matrix ( A ). (Specification: stdlib_linalg)

Procedures:
module subroutine stdlib_linalg_eig_standard_s(a, lambda, right, left, overwrite_a, err)#

Eigendecomposition of matrix A returning an array lambda of eigenvalues, and optionally right or left eigenvectors.

Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

lambdacomplex(kind=sp), intent(out), dimension(:)

Array of eigenvalues

rightcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_real_eig_standard_s(a, lambda, right, left, overwrite_a, err)#

Eigendecomposition of matrix A returning an array lambda of real eigenvalues, and optionally right or left eigenvectors. Returns an error if the eigenvalues had non-trivial imaginary parts.

Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

lambdareal(kind=sp), intent(out), dimension(:)

Array of real eigenvalues

rightcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_eig_generalized_s(a, b, lambda, right, left, overwrite_a, overwrite_b, err)#

Eigendecomposition of matrix A returning an array lambda of eigenvalues, and optionally right or left eigenvectors.

Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

breal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Generalized problem matrix B[n,n]

lambdacomplex(kind=sp), intent(out), dimension(:)

Array of eigenvalues

rightcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

overwrite_blogical(kind=lk), intent(in), optional

[optional] Can B data be overwritten and destroyed? (default: no)

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_real_eig_generalized_s(a, b, lambda, right, left, overwrite_a, overwrite_b, err)#

Eigendecomposition of matrix A returning an array lambda of real eigenvalues, and optionally right or left eigenvectors. Returns an error if the eigenvalues had non-trivial imaginary parts.

Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

breal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Generalized problem matrix B[n,n]

lambdareal(kind=sp), intent(out), dimension(:)

Array of real eigenvalues

rightcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

overwrite_blogical(kind=lk), intent(in), optional

[optional] Can B data be overwritten and destroyed? (default: no)

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_eig_standard_d(a, lambda, right, left, overwrite_a, err)#

Eigendecomposition of matrix A returning an array lambda of eigenvalues, and optionally right or left eigenvectors.

Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

lambdacomplex(kind=dp), intent(out), dimension(:)

Array of eigenvalues

rightcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_real_eig_standard_d(a, lambda, right, left, overwrite_a, err)#

Eigendecomposition of matrix A returning an array lambda of real eigenvalues, and optionally right or left eigenvectors. Returns an error if the eigenvalues had non-trivial imaginary parts.

Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

lambdareal(kind=dp), intent(out), dimension(:)

Array of real eigenvalues

rightcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_eig_generalized_d(a, b, lambda, right, left, overwrite_a, overwrite_b, err)#

Eigendecomposition of matrix A returning an array lambda of eigenvalues, and optionally right or left eigenvectors.

Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

breal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Generalized problem matrix B[n,n]

lambdacomplex(kind=dp), intent(out), dimension(:)

Array of eigenvalues

rightcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

overwrite_blogical(kind=lk), intent(in), optional

[optional] Can B data be overwritten and destroyed? (default: no)

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_real_eig_generalized_d(a, b, lambda, right, left, overwrite_a, overwrite_b, err)#

Eigendecomposition of matrix A returning an array lambda of real eigenvalues, and optionally right or left eigenvectors. Returns an error if the eigenvalues had non-trivial imaginary parts.

Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

breal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Generalized problem matrix B[n,n]

lambdareal(kind=dp), intent(out), dimension(:)

Array of real eigenvalues

rightcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

overwrite_blogical(kind=lk), intent(in), optional

[optional] Can B data be overwritten and destroyed? (default: no)

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_eig_standard_c(a, lambda, right, left, overwrite_a, err)#

Eigendecomposition of matrix A returning an array lambda of eigenvalues, and optionally right or left eigenvectors.

Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

lambdacomplex(kind=sp), intent(out), dimension(:)

Array of eigenvalues

rightcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_real_eig_standard_c(a, lambda, right, left, overwrite_a, err)#

Eigendecomposition of matrix A returning an array lambda of real eigenvalues, and optionally right or left eigenvectors. Returns an error if the eigenvalues had non-trivial imaginary parts.

Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

lambdareal(kind=sp), intent(out), dimension(:)

Array of real eigenvalues

rightcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_eig_generalized_c(a, b, lambda, right, left, overwrite_a, overwrite_b, err)#

Eigendecomposition of matrix A returning an array lambda of eigenvalues, and optionally right or left eigenvectors.

Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

bcomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Generalized problem matrix B[n,n]

lambdacomplex(kind=sp), intent(out), dimension(:)

Array of eigenvalues

rightcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

overwrite_blogical(kind=lk), intent(in), optional

[optional] Can B data be overwritten and destroyed? (default: no)

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_real_eig_generalized_c(a, b, lambda, right, left, overwrite_a, overwrite_b, err)#

Eigendecomposition of matrix A returning an array lambda of real eigenvalues, and optionally right or left eigenvectors. Returns an error if the eigenvalues had non-trivial imaginary parts.

Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

bcomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Generalized problem matrix B[n,n]

lambdareal(kind=sp), intent(out), dimension(:)

Array of real eigenvalues

rightcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

overwrite_blogical(kind=lk), intent(in), optional

[optional] Can B data be overwritten and destroyed? (default: no)

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_eig_standard_z(a, lambda, right, left, overwrite_a, err)#

Eigendecomposition of matrix A returning an array lambda of eigenvalues, and optionally right or left eigenvectors.

Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

lambdacomplex(kind=dp), intent(out), dimension(:)

Array of eigenvalues

rightcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_real_eig_standard_z(a, lambda, right, left, overwrite_a, err)#

Eigendecomposition of matrix A returning an array lambda of real eigenvalues, and optionally right or left eigenvectors. Returns an error if the eigenvalues had non-trivial imaginary parts.

Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

lambdareal(kind=dp), intent(out), dimension(:)

Array of real eigenvalues

rightcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_eig_generalized_z(a, b, lambda, right, left, overwrite_a, overwrite_b, err)#

Eigendecomposition of matrix A returning an array lambda of eigenvalues, and optionally right or left eigenvectors.

Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

bcomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Generalized problem matrix B[n,n]

lambdacomplex(kind=dp), intent(out), dimension(:)

Array of eigenvalues

rightcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

overwrite_blogical(kind=lk), intent(in), optional

[optional] Can B data be overwritten and destroyed? (default: no)

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_real_eig_generalized_z(a, b, lambda, right, left, overwrite_a, overwrite_b, err)#

Eigendecomposition of matrix A returning an array lambda of real eigenvalues, and optionally right or left eigenvectors. Returns an error if the eigenvalues had non-trivial imaginary parts.

Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

bcomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Generalized problem matrix B[n,n]

lambdareal(kind=dp), intent(out), dimension(:)

Array of real eigenvalues

rightcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of RIGHT contain the right eigenvectors of A

leftcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of LEFT contain the left eigenvectors of A

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

overwrite_blogical(kind=lk), intent(in), optional

[optional] Can B data be overwritten and destroyed? (default: no)

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Subroutine interface for computing eigenvalues and eigenvectors of a square matrix.

Description

This interface provides methods for computing the eigenvalues, and optionally eigenvectors, of a general square matrix. Supported data types include real and complex, and no assumption is made on the matrix structure. The user may request either left, right, or both eigenvectors to be returned. They are returned as columns of a square matrix with the same size as A. Preallocated space for both eigenvalues lambda and the eigenvector matrices must be user-provided.

Notes

The solution is based on LAPACK’s general eigenproblem solvers *GEEV.

eigvals (interface)#

eigvals (interface)

Returns the eigenvalues ( lambda ), ( A cdot bar{v} - lambda cdot bar{v} ), for square matrix ( A ). (Specification: stdlib_linalg)

Procedures:
module function stdlib_linalg_eigvals_standard_s(a, err) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
areal(kind=sp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
lambdacomplex(kind=sp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_noerr_standard_s(a) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
areal(kind=sp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

Returns:
lambdacomplex(kind=sp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_generalized_s(a, b, err) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
areal(kind=sp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

breal(kind=sp), dimension(:, :), target, intent(inout)

Generalized problem matrix B[n,n]

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
lambdacomplex(kind=sp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_noerr_generalized_s(a, b) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
areal(kind=sp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

breal(kind=sp), dimension(:, :), target, intent(inout)

Generalized problem matrix B[n,n]

Returns:
lambdacomplex(kind=sp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_standard_d(a, err) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
areal(kind=dp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
lambdacomplex(kind=dp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_noerr_standard_d(a) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
areal(kind=dp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

Returns:
lambdacomplex(kind=dp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_generalized_d(a, b, err) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
areal(kind=dp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

breal(kind=dp), dimension(:, :), target, intent(inout)

Generalized problem matrix B[n,n]

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
lambdacomplex(kind=dp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_noerr_generalized_d(a, b) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
areal(kind=dp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

breal(kind=dp), dimension(:, :), target, intent(inout)

Generalized problem matrix B[n,n]

Returns:
lambdacomplex(kind=dp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_standard_c(a, err) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
acomplex(kind=sp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
lambdacomplex(kind=sp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_noerr_standard_c(a) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
acomplex(kind=sp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

Returns:
lambdacomplex(kind=sp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_generalized_c(a, b, err) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
acomplex(kind=sp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

bcomplex(kind=sp), dimension(:, :), target, intent(inout)

Generalized problem matrix B[n,n]

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
lambdacomplex(kind=sp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_noerr_generalized_c(a, b) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
acomplex(kind=sp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

bcomplex(kind=sp), dimension(:, :), target, intent(inout)

Generalized problem matrix B[n,n]

Returns:
lambdacomplex(kind=sp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_standard_z(a, err) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
acomplex(kind=dp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
lambdacomplex(kind=dp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_noerr_standard_z(a) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
acomplex(kind=dp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

Returns:
lambdacomplex(kind=dp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_generalized_z(a, b, err) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
acomplex(kind=dp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

bcomplex(kind=dp), dimension(:, :), target, intent(inout)

Generalized problem matrix B[n,n]

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
lambdacomplex(kind=dp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvals_noerr_generalized_z(a, b) -> lambda#

Return an array of eigenvalues of matrix A.

Arguments:
acomplex(kind=dp), dimension(:, :), target, intent(in)

Input matrix A[m,n]

bcomplex(kind=dp), dimension(:, :), target, intent(inout)

Generalized problem matrix B[n,n]

Returns:
lambdacomplex(kind=dp), allocatable, dimension(:)

Array of singular values

Summary

Function interface for computing the eigenvalues of a square matrix.

Description

This interface provides functions for returning the eigenvalues of a general square matrix. Supported data types include real and complex, and no assumption is made on the matrix structure. An error stop is thrown in case of failure; otherwise, error information can be returned as an optional type(linalg_state_type) output flag.

Notes

The solution is based on LAPACK’s general eigenproblem solvers *GEEV.

eigh (interface)#

eigh (interface)

Solves the eigendecomposition ( A cdot bar{v} - lambda cdot bar{v} ) for a real symmetric ( A = A^T ) or complex Hermitian ( A = A^H ) square matrix. (Specification: stdlib_linalg)

Procedures:
module subroutine stdlib_linalg_eigh_s(a, lambda, vectors, upper_a, overwrite_a, err)#

Eigendecomposition of a real symmetric or complex Hermitian matrix A returning an array lambda of eigenvalues, and optionally right or left eigenvectors.

Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

lambdareal(kind=sp), intent(out), dimension(:)

Array of eigenvalues

vectorsreal(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of vectors contain the orthonormal eigenvectors of A

upper_alogical(kind=lk), intent(in), optional

[optional] Should the upper/lower half of A be used? Default: lower

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_eigh_d(a, lambda, vectors, upper_a, overwrite_a, err)#

Eigendecomposition of a real symmetric or complex Hermitian matrix A returning an array lambda of eigenvalues, and optionally right or left eigenvectors.

Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

lambdareal(kind=dp), intent(out), dimension(:)

Array of eigenvalues

vectorsreal(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of vectors contain the orthonormal eigenvectors of A

upper_alogical(kind=lk), intent(in), optional

[optional] Should the upper/lower half of A be used? Default: lower

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_eigh_c(a, lambda, vectors, upper_a, overwrite_a, err)#

Eigendecomposition of a real symmetric or complex Hermitian matrix A returning an array lambda of eigenvalues, and optionally right or left eigenvectors.

Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

lambdareal(kind=sp), intent(out), dimension(:)

Array of eigenvalues

vectorscomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of vectors contain the orthonormal eigenvectors of A

upper_alogical(kind=lk), intent(in), optional

[optional] Should the upper/lower half of A be used? Default: lower

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

module subroutine stdlib_linalg_eigh_z(a, lambda, vectors, upper_a, overwrite_a, err)#

Eigendecomposition of a real symmetric or complex Hermitian matrix A returning an array lambda of eigenvalues, and optionally right or left eigenvectors.

Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

lambdareal(kind=dp), intent(out), dimension(:)

Array of eigenvalues

vectorscomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of vectors contain the orthonormal eigenvectors of A

upper_alogical(kind=lk), intent(in), optional

[optional] Should the upper/lower half of A be used? Default: lower

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Subroutine interface for computing eigenvalues and eigenvectors of a real symmetric or complex Hermitian square matrix.

Description

This interface provides methods for computing the eigenvalues, and optionally eigenvectors, of a real symmetric or complex Hermitian square matrix. Supported data types include real and complex. The matrix must be symmetric (if real) or Hermitian (if complex). Only the lower or upper half of the matrix is accessed, and the user can select which using the optional upper_a flag (default: use lower half). The vectors are orthogonal, and may be returned as columns of an optional matrix vectors with the same kind and size as A. Preallocated space for both eigenvalues lambda and the eigenvector matrix must be user-provided.

Notes

The solution is based on LAPACK’s eigenproblem solvers *SYEV/*HEEV.

eigvalsh (interface)#

eigvalsh (interface)

Returns the eigenvalues ( lambda ), ( A cdot bar{v} - lambda cdot bar{v} ), for a real symmetric ( A = A^T ) or complex Hermitian ( A = A^H ) square matrix. (Specification: stdlib_linalg)

Procedures:
module function stdlib_linalg_eigvalsh_s(a, upper_a, err) -> lambda#

Return an array of eigenvalues of real symmetric / complex hermitian A

Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix A[m,n]

upper_alogical(kind=lk), intent(in), optional

[optional] Should the upper/lower half of A be used? Default: lower

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
lambdareal(kind=sp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvalsh_noerr_s(a, upper_a) -> lambda#

Return an array of eigenvalues of real symmetric / complex hermitian A

Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix A[m,n]

upper_alogical(kind=lk), intent(in), optional

[optional] Should the upper/lower half of A be used? Default: lower

Returns:
lambdareal(kind=sp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvalsh_d(a, upper_a, err) -> lambda#

Return an array of eigenvalues of real symmetric / complex hermitian A

Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix A[m,n]

upper_alogical(kind=lk), intent(in), optional

[optional] Should the upper/lower half of A be used? Default: lower

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
lambdareal(kind=dp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvalsh_noerr_d(a, upper_a) -> lambda#

Return an array of eigenvalues of real symmetric / complex hermitian A

Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix A[m,n]

upper_alogical(kind=lk), intent(in), optional

[optional] Should the upper/lower half of A be used? Default: lower

Returns:
lambdareal(kind=dp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvalsh_c(a, upper_a, err) -> lambda#

Return an array of eigenvalues of real symmetric / complex hermitian A

Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix A[m,n]

upper_alogical(kind=lk), intent(in), optional

[optional] Should the upper/lower half of A be used? Default: lower

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
lambdareal(kind=sp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvalsh_noerr_c(a, upper_a) -> lambda#

Return an array of eigenvalues of real symmetric / complex hermitian A

Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix A[m,n]

upper_alogical(kind=lk), intent(in), optional

[optional] Should the upper/lower half of A be used? Default: lower

Returns:
lambdareal(kind=sp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvalsh_z(a, upper_a, err) -> lambda#

Return an array of eigenvalues of real symmetric / complex hermitian A

Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix A[m,n]

upper_alogical(kind=lk), intent(in), optional

[optional] Should the upper/lower half of A be used? Default: lower

errtype(linalg_state_type), intent(out)

[optional] state return flag. On error if not requested, the code will stop

Returns:
lambdareal(kind=dp), allocatable, dimension(:)

Array of singular values

module function stdlib_linalg_eigvalsh_noerr_z(a, upper_a) -> lambda#

Return an array of eigenvalues of real symmetric / complex hermitian A

Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix A[m,n]

upper_alogical(kind=lk), intent(in), optional

[optional] Should the upper/lower half of A be used? Default: lower

Returns:
lambdareal(kind=dp), allocatable, dimension(:)

Array of singular values

Summary

Function interface for computing the eigenvalues of a real symmetric or complex hermitian square matrix.

Description

This interface provides functions for returning the eigenvalues of a real symmetric or complex Hermitian square matrix. Supported data types include real and complex. The matrix must be symmetric (if real) or Hermitian (if complex). Only the lower or upper half of the matrix is accessed, and the user can select which using the optional upper_a flag (default: use lower half). An error stop is thrown in case of failure; otherwise, error information can be returned as an optional type(linalg_state_type) output flag.

Notes

The solution is based on LAPACK’s eigenproblem solvers *SYEV/*HEEV.

svd (interface)#

svd (interface)

Computes the singular value decomposition of a real or complex 2d matrix. (Specification: stdlib_linalg)

Procedures:
module subroutine stdlib_linalg_svd_s(a, s, u, vt, overwrite_a, full_matrices, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

sreal(kind=sp), intent(out), dimension(:)

Array of singular values

ureal(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of U contain the left singular vectors

vtreal(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The rows of V^T contain the right singular vectors

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

full_matriceslogical(kind=lk), intent(in), optional

[optional] full matrices have shape(u)==[m,m], shape(vh)==[n,n] (default); otherwise they are shape(u)==[m,k] and shape(vh)==[k,n] with k=min(m,n)

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Compute singular value decomposition of a matrix ( A = U cdot S cdot V^T )

Description

This function computes the singular value decomposition of a real or complex matrix ( A ), and returns the array of singular values, and optionally the left matrix ( U ) containing the left unitary singular vectors, and the right matrix ( V^T ), containing the right unitary singular vectors.

param: a Input matrix of size [m,n]. param: s Output real array of size [min(m,n)] returning a list of singular values. param: u [optional] Output left singular matrix of size [m,m] or [m,min(m,n)] (.not.full_matrices). Contains singular vectors as columns. param: vt [optional] Output right singular matrix of size [n,n] or [min(m,n),n] (.not.full_matrices). Contains singular vectors as rows. param: overwrite_a [optional] Flag indicating if the input matrix can be overwritten. param: full_matrices [optional] If .true. (default), matrices ( U ) and ( V^T ) have size [m,m], [n,n]. Otherwise, they are [m,k], [k,n] with k=min(m,n). param: err [optional] State return flag.

module subroutine stdlib_linalg_svd_d(a, s, u, vt, overwrite_a, full_matrices, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

sreal(kind=dp), intent(out), dimension(:)

Array of singular values

ureal(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of U contain the left singular vectors

vtreal(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The rows of V^T contain the right singular vectors

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

full_matriceslogical(kind=lk), intent(in), optional

[optional] full matrices have shape(u)==[m,m], shape(vh)==[n,n] (default); otherwise they are shape(u)==[m,k] and shape(vh)==[k,n] with k=min(m,n)

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Compute singular value decomposition of a matrix ( A = U cdot S cdot V^T )

Description

This function computes the singular value decomposition of a real or complex matrix ( A ), and returns the array of singular values, and optionally the left matrix ( U ) containing the left unitary singular vectors, and the right matrix ( V^T ), containing the right unitary singular vectors.

param: a Input matrix of size [m,n]. param: s Output real array of size [min(m,n)] returning a list of singular values. param: u [optional] Output left singular matrix of size [m,m] or [m,min(m,n)] (.not.full_matrices). Contains singular vectors as columns. param: vt [optional] Output right singular matrix of size [n,n] or [min(m,n),n] (.not.full_matrices). Contains singular vectors as rows. param: overwrite_a [optional] Flag indicating if the input matrix can be overwritten. param: full_matrices [optional] If .true. (default), matrices ( U ) and ( V^T ) have size [m,m], [n,n]. Otherwise, they are [m,k], [k,n] with k=min(m,n). param: err [optional] State return flag.

module subroutine stdlib_linalg_svd_c(a, s, u, vt, overwrite_a, full_matrices, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

sreal(kind=sp), intent(out), dimension(:)

Array of singular values

ucomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of U contain the left singular vectors

vtcomplex(kind=sp), target, (:, :), intent(out), optional, dimension(:,:)

The rows of V^T contain the right singular vectors

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

full_matriceslogical(kind=lk), intent(in), optional

[optional] full matrices have shape(u)==[m,m], shape(vh)==[n,n] (default); otherwise they are shape(u)==[m,k] and shape(vh)==[k,n] with k=min(m,n)

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Compute singular value decomposition of a matrix ( A = U cdot S cdot V^T )

Description

This function computes the singular value decomposition of a real or complex matrix ( A ), and returns the array of singular values, and optionally the left matrix ( U ) containing the left unitary singular vectors, and the right matrix ( V^T ), containing the right unitary singular vectors.

param: a Input matrix of size [m,n]. param: s Output real array of size [min(m,n)] returning a list of singular values. param: u [optional] Output left singular matrix of size [m,m] or [m,min(m,n)] (.not.full_matrices). Contains singular vectors as columns. param: vt [optional] Output right singular matrix of size [n,n] or [min(m,n),n] (.not.full_matrices). Contains singular vectors as rows. param: overwrite_a [optional] Flag indicating if the input matrix can be overwritten. param: full_matrices [optional] If .true. (default), matrices ( U ) and ( V^T ) have size [m,m], [n,n]. Otherwise, they are [m,k], [k,n] with k=min(m,n). param: err [optional] State return flag.

module subroutine stdlib_linalg_svd_z(a, s, u, vt, overwrite_a, full_matrices, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(inout), dimension(:,:)

Input matrix A[m,n]

sreal(kind=dp), intent(out), dimension(:)

Array of singular values

ucomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The columns of U contain the left singular vectors

vtcomplex(kind=dp), target, (:, :), intent(out), optional, dimension(:,:)

The rows of V^T contain the right singular vectors

overwrite_alogical(kind=lk), intent(in), optional

[optional] Can A data be overwritten and destroyed?

full_matriceslogical(kind=lk), intent(in), optional

[optional] full matrices have shape(u)==[m,m], shape(vh)==[n,n] (default); otherwise they are shape(u)==[m,k] and shape(vh)==[k,n] with k=min(m,n)

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Compute singular value decomposition of a matrix ( A = U cdot S cdot V^T )

Description

This function computes the singular value decomposition of a real or complex matrix ( A ), and returns the array of singular values, and optionally the left matrix ( U ) containing the left unitary singular vectors, and the right matrix ( V^T ), containing the right unitary singular vectors.

param: a Input matrix of size [m,n]. param: s Output real array of size [min(m,n)] returning a list of singular values. param: u [optional] Output left singular matrix of size [m,m] or [m,min(m,n)] (.not.full_matrices). Contains singular vectors as columns. param: vt [optional] Output right singular matrix of size [n,n] or [min(m,n),n] (.not.full_matrices). Contains singular vectors as rows. param: overwrite_a [optional] Flag indicating if the input matrix can be overwritten. param: full_matrices [optional] If .true. (default), matrices ( U ) and ( V^T ) have size [m,m], [n,n]. Otherwise, they are [m,k], [k,n] with k=min(m,n). param: err [optional] State return flag.

Summary

Interface for computing the singular value decomposition of a real or complex 2d matrix.

Description

This interface provides methods for computing the singular value decomposition of a matrix. Supported data types include real and complex. The subroutine returns a real array of singular values, and optionally, left- and right- singular vector matrices, U and V. For a matrix A with size [m,n], full matrix storage for U and V should be [m,m] and [n,n]. It is possible to use partial storage [m,k] and [k,n], k=min(m,n), choosing full_matrices=.false..

Notes

The solution is based on LAPACK’s singular value decomposition *GESDD methods.

Example

real(sp) :: a(2,3), s(2), u(2,2), vt(3,3) 
a = reshape([3,2, 2,3, 2,-2],[2,3])

call svd(A,s,u,v)
print *, 'singular values = ',s

svdvals (interface)#

svdvals (interface)

Computes the singular values of a real or complex 2d matrix. (Specification: stdlib_linalg)

Procedures:
module function stdlib_linalg_svdvals_s(a, err) -> s#
Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix A[m,n]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
sreal(kind=sp), allocatable, dimension(:)

Array of singular values

Summary

Compute singular values (S ) from the singular-value decomposition of a matrix ( A = U cdot S cdot V^T ).

Description

This function returns the array of singular values from the singular value decomposition of a real or complex matrix ( A = U cdot S cdot V^T ).

param: a Input matrix of size [m,n]. param: err [optional] State return flag.

Return value

param: s real array of size [min(m,n)] returning a list of singular values.

module function stdlib_linalg_svdvals_d(a, err) -> s#
Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix A[m,n]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
sreal(kind=dp), allocatable, dimension(:)

Array of singular values

Summary

Compute singular values (S ) from the singular-value decomposition of a matrix ( A = U cdot S cdot V^T ).

Description

This function returns the array of singular values from the singular value decomposition of a real or complex matrix ( A = U cdot S cdot V^T ).

param: a Input matrix of size [m,n]. param: err [optional] State return flag.

Return value

param: s real array of size [min(m,n)] returning a list of singular values.

module function stdlib_linalg_svdvals_c(a, err) -> s#
Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix A[m,n]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
sreal(kind=sp), allocatable, dimension(:)

Array of singular values

Summary

Compute singular values (S ) from the singular-value decomposition of a matrix ( A = U cdot S cdot V^T ).

Description

This function returns the array of singular values from the singular value decomposition of a real or complex matrix ( A = U cdot S cdot V^T ).

param: a Input matrix of size [m,n]. param: err [optional] State return flag.

Return value

param: s real array of size [min(m,n)] returning a list of singular values.

module function stdlib_linalg_svdvals_z(a, err) -> s#
Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix A[m,n]

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
sreal(kind=dp), allocatable, dimension(:)

Array of singular values

Summary

Compute singular values (S ) from the singular-value decomposition of a matrix ( A = U cdot S cdot V^T ).

Description

This function returns the array of singular values from the singular value decomposition of a real or complex matrix ( A = U cdot S cdot V^T ).

param: a Input matrix of size [m,n]. param: err [optional] State return flag.

Return value

param: s real array of size [min(m,n)] returning a list of singular values.

Summary

Function interface for computing the array of singular values from the singular value decomposition of a real or complex 2d matrix.

Description

This interface provides methods for computing the singular values a 2d matrix. Supported data types include real and complex. The function returns a real array of singular values, with size [min(m,n)].

Notes

The solution is based on LAPACK’s singular value decomposition *GESDD methods.

Example

real(sp) :: a(2,3), s(2)
a = reshape([3,2, 2,3, 2,-2],[2,3])

s = svdvals(A)
print *, 'singular values = ',s

norm (interface)#

norm (interface)

Computes the vector norm of a generic-rank array ( A ). (Specification: stdlib_linalg)

Procedures:
pure module function stdlib_linalg_norm_1D_order_char_s(a, order) -> nrm#

Scalar norms: real(sp)

Arguments:
areal(kind=sp), intent(in), dimension(:)

Input 1-d matrix a(:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_1D_order_err_char_s(a, order, err) -> nrm#
Arguments:
areal(kind=sp), intent(in), dimension(:)

Input 1-d matrix a(:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_order_char_s(a, order) -> nrm#
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_2D_order_err_char_s(a, order, err) -> nrm#
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_3D_order_char_s(a, order) -> nrm#
Arguments:
areal(kind=sp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_3D_order_err_char_s(a, order, err) -> nrm#
Arguments:
areal(kind=sp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_4D_order_char_s(a, order) -> nrm#
Arguments:
areal(kind=sp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_4D_order_err_char_s(a, order, err) -> nrm#
Arguments:
areal(kind=sp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_to_1D_char_s(a, order, dim) -> nrm#

Array norms: real(sp)

Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_2D_to_1D_err_char_s(a, order, dim, err) -> nrm#
Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_3D_to_2D_char_s(a, order, dim) -> nrm#
Arguments:
areal(kind=sp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_3D_to_2D_err_char_s(a, order, dim, err) -> nrm#
Arguments:
areal(kind=sp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_4D_to_3D_char_s(a, order, dim) -> nrm#
Arguments:
areal(kind=sp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_4D_to_3D_err_char_s(a, order, dim, err) -> nrm#
Arguments:
areal(kind=sp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_1D_order_int_s(a, order) -> nrm#

Scalar norms: real(sp)

Arguments:
areal(kind=sp), intent(in), dimension(:)

Input 1-d matrix a(:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_1D_order_err_int_s(a, order, err) -> nrm#
Arguments:
areal(kind=sp), intent(in), dimension(:)

Input 1-d matrix a(:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_order_int_s(a, order) -> nrm#
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_2D_order_err_int_s(a, order, err) -> nrm#
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_3D_order_int_s(a, order) -> nrm#
Arguments:
areal(kind=sp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_3D_order_err_int_s(a, order, err) -> nrm#
Arguments:
areal(kind=sp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_4D_order_int_s(a, order) -> nrm#
Arguments:
areal(kind=sp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_4D_order_err_int_s(a, order, err) -> nrm#
Arguments:
areal(kind=sp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_to_1D_int_s(a, order, dim) -> nrm#

Array norms: real(sp)

Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_2D_to_1D_err_int_s(a, order, dim, err) -> nrm#
Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_3D_to_2D_int_s(a, order, dim) -> nrm#
Arguments:
areal(kind=sp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_3D_to_2D_err_int_s(a, order, dim, err) -> nrm#
Arguments:
areal(kind=sp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_4D_to_3D_int_s(a, order, dim) -> nrm#
Arguments:
areal(kind=sp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_4D_to_3D_err_int_s(a, order, dim, err) -> nrm#
Arguments:
areal(kind=sp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_1D_order_char_d(a, order) -> nrm#

Scalar norms: real(dp)

Arguments:
areal(kind=dp), intent(in), dimension(:)

Input 1-d matrix a(:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_1D_order_err_char_d(a, order, err) -> nrm#
Arguments:
areal(kind=dp), intent(in), dimension(:)

Input 1-d matrix a(:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_order_char_d(a, order) -> nrm#
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_2D_order_err_char_d(a, order, err) -> nrm#
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_3D_order_char_d(a, order) -> nrm#
Arguments:
areal(kind=dp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_3D_order_err_char_d(a, order, err) -> nrm#
Arguments:
areal(kind=dp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_4D_order_char_d(a, order) -> nrm#
Arguments:
areal(kind=dp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_4D_order_err_char_d(a, order, err) -> nrm#
Arguments:
areal(kind=dp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_to_1D_char_d(a, order, dim) -> nrm#

Array norms: real(dp)

Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_2D_to_1D_err_char_d(a, order, dim, err) -> nrm#
Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_3D_to_2D_char_d(a, order, dim) -> nrm#
Arguments:
areal(kind=dp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_3D_to_2D_err_char_d(a, order, dim, err) -> nrm#
Arguments:
areal(kind=dp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_4D_to_3D_char_d(a, order, dim) -> nrm#
Arguments:
areal(kind=dp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_4D_to_3D_err_char_d(a, order, dim, err) -> nrm#
Arguments:
areal(kind=dp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_1D_order_int_d(a, order) -> nrm#

Scalar norms: real(dp)

Arguments:
areal(kind=dp), intent(in), dimension(:)

Input 1-d matrix a(:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_1D_order_err_int_d(a, order, err) -> nrm#
Arguments:
areal(kind=dp), intent(in), dimension(:)

Input 1-d matrix a(:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_order_int_d(a, order) -> nrm#
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_2D_order_err_int_d(a, order, err) -> nrm#
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_3D_order_int_d(a, order) -> nrm#
Arguments:
areal(kind=dp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_3D_order_err_int_d(a, order, err) -> nrm#
Arguments:
areal(kind=dp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_4D_order_int_d(a, order) -> nrm#
Arguments:
areal(kind=dp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_4D_order_err_int_d(a, order, err) -> nrm#
Arguments:
areal(kind=dp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_to_1D_int_d(a, order, dim) -> nrm#

Array norms: real(dp)

Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_2D_to_1D_err_int_d(a, order, dim, err) -> nrm#
Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_3D_to_2D_int_d(a, order, dim) -> nrm#
Arguments:
areal(kind=dp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_3D_to_2D_err_int_d(a, order, dim, err) -> nrm#
Arguments:
areal(kind=dp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_4D_to_3D_int_d(a, order, dim) -> nrm#
Arguments:
areal(kind=dp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_4D_to_3D_err_int_d(a, order, dim, err) -> nrm#
Arguments:
areal(kind=dp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_1D_order_char_c(a, order) -> nrm#

Scalar norms: complex(sp)

Arguments:
acomplex(kind=sp), intent(in), dimension(:)

Input 1-d matrix a(:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_1D_order_err_char_c(a, order, err) -> nrm#
Arguments:
acomplex(kind=sp), intent(in), dimension(:)

Input 1-d matrix a(:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_order_char_c(a, order) -> nrm#
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_2D_order_err_char_c(a, order, err) -> nrm#
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_3D_order_char_c(a, order) -> nrm#
Arguments:
acomplex(kind=sp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_3D_order_err_char_c(a, order, err) -> nrm#
Arguments:
acomplex(kind=sp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_4D_order_char_c(a, order) -> nrm#
Arguments:
acomplex(kind=sp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_4D_order_err_char_c(a, order, err) -> nrm#
Arguments:
acomplex(kind=sp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_to_1D_char_c(a, order, dim) -> nrm#

Array norms: complex(sp)

Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_2D_to_1D_err_char_c(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_3D_to_2D_char_c(a, order, dim) -> nrm#
Arguments:
acomplex(kind=sp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_3D_to_2D_err_char_c(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=sp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_4D_to_3D_char_c(a, order, dim) -> nrm#
Arguments:
acomplex(kind=sp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_4D_to_3D_err_char_c(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=sp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_1D_order_int_c(a, order) -> nrm#

Scalar norms: complex(sp)

Arguments:
acomplex(kind=sp), intent(in), dimension(:)

Input 1-d matrix a(:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_1D_order_err_int_c(a, order, err) -> nrm#
Arguments:
acomplex(kind=sp), intent(in), dimension(:)

Input 1-d matrix a(:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_order_int_c(a, order) -> nrm#
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_2D_order_err_int_c(a, order, err) -> nrm#
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_3D_order_int_c(a, order) -> nrm#
Arguments:
acomplex(kind=sp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_3D_order_err_int_c(a, order, err) -> nrm#
Arguments:
acomplex(kind=sp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_4D_order_int_c(a, order) -> nrm#
Arguments:
acomplex(kind=sp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function stdlib_linalg_norm_4D_order_err_int_c(a, order, err) -> nrm#
Arguments:
acomplex(kind=sp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_to_1D_int_c(a, order, dim) -> nrm#

Array norms: complex(sp)

Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_2D_to_1D_err_int_c(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_3D_to_2D_int_c(a, order, dim) -> nrm#
Arguments:
acomplex(kind=sp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_3D_to_2D_err_int_c(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=sp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_4D_to_3D_int_c(a, order, dim) -> nrm#
Arguments:
acomplex(kind=sp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_4D_to_3D_err_int_c(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=sp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_1D_order_char_z(a, order) -> nrm#

Scalar norms: complex(dp)

Arguments:
acomplex(kind=dp), intent(in), dimension(:)

Input 1-d matrix a(:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_1D_order_err_char_z(a, order, err) -> nrm#
Arguments:
acomplex(kind=dp), intent(in), dimension(:)

Input 1-d matrix a(:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_order_char_z(a, order) -> nrm#
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_2D_order_err_char_z(a, order, err) -> nrm#
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_3D_order_char_z(a, order) -> nrm#
Arguments:
acomplex(kind=dp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_3D_order_err_char_z(a, order, err) -> nrm#
Arguments:
acomplex(kind=dp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_4D_order_char_z(a, order) -> nrm#
Arguments:
acomplex(kind=dp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_4D_order_err_char_z(a, order, err) -> nrm#
Arguments:
acomplex(kind=dp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_to_1D_char_z(a, order, dim) -> nrm#

Array norms: complex(dp)

Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_2D_to_1D_err_char_z(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_3D_to_2D_char_z(a, order, dim) -> nrm#
Arguments:
acomplex(kind=dp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_3D_to_2D_err_char_z(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=dp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_4D_to_3D_char_z(a, order, dim) -> nrm#
Arguments:
acomplex(kind=dp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_4D_to_3D_err_char_z(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=dp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_1D_order_int_z(a, order) -> nrm#

Scalar norms: complex(dp)

Arguments:
acomplex(kind=dp), intent(in), dimension(:)

Input 1-d matrix a(:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_1D_order_err_int_z(a, order, err) -> nrm#
Arguments:
acomplex(kind=dp), intent(in), dimension(:)

Input 1-d matrix a(:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_order_int_z(a, order) -> nrm#
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_2D_order_err_int_z(a, order, err) -> nrm#
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_3D_order_int_z(a, order) -> nrm#
Arguments:
acomplex(kind=dp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_3D_order_err_int_z(a, order, err) -> nrm#
Arguments:
acomplex(kind=dp), (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_4D_order_int_z(a, order) -> nrm#
Arguments:
acomplex(kind=dp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function stdlib_linalg_norm_4D_order_err_int_z(a, order, err) -> nrm#
Arguments:
acomplex(kind=dp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp)

Norm of the matrix.

pure module function stdlib_linalg_norm_2D_to_1D_int_z(a, order, dim) -> nrm#

Array norms: complex(dp)

Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_2D_to_1D_err_int_z(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_3D_to_2D_int_z(a, order, dim) -> nrm#
Arguments:
acomplex(kind=dp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_3D_to_2D_err_int_z(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=dp), target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

pure module function stdlib_linalg_norm_4D_to_3D_int_z(a, order, dim) -> nrm#
Arguments:
acomplex(kind=dp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

module function stdlib_linalg_norm_4D_to_3D_err_int_z(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=dp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out)

Output state return flag.

Returns:
nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

Summary

Return one of several scalar norm metrics of a real or complex input array ( A ), that can have any rank. For generic rank-n arrays, the scalar norm over the whole array is returned by default. If n>=2 and the optional input dimension dim is specified, a rank n-1 array is returned with dimension dim collapsed, containing all 1D array norms evaluated along dimension dim only.

Description

This interface provides methods for computing the vector norm(s) of an array. Supported data types include real and complex. Input arrays may have generic rank from 1 to 4.

Norm type input is mandatory, and it is provided via the order argument. This can be provided as either an integer value or a character string. Allowed metrics are: - 1-norm ( sum_i{ left|a_iright| } ): order = 1 or ‘1’ - Euclidean norm ( sqrt{sum_i{ a_i^2 }} ): order = 2 or ‘2’ - p-norm ( left( sum_i{ left|a_iright|^p }right) ^{1/p} ): integer order, order>=3 - Infinity norm ( max_i{ left|a_iright| } ): order = huge(0) or ‘inf’ - Minus-infinity norm ( min_i{ left|a_iright| } ): order = -huge(0) or ‘-inf’

Example

real(sp) :: a(3,3), na, rown(3)
a = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3])

! L2 norm: whole matrix
na = norm(a, 2)

! Infinity norm of each row
rown = norm(a, 'inf', dim=2)

get_norm (interface)#

get_norm (interface)

Vector norm: subroutine interface version: experimental

Computes the vector norm of a generic-rank array ( A ). (Specification: stdlib_linalg)

Procedures:
pure module subroutine norm_1D_char_s(a, nrm, order, err)#

Scalar norms: real(sp)

Arguments:
areal(kind=sp), target, intent(in), dimension(:)

Input 1-d matrix a(:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_char_s(a, nrm, order, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_char_s(a, nrm, order, err)#
Arguments:
areal(kind=sp), target, (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_char_s(a, nrm, order, err)#
Arguments:
areal(kind=sp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_to_1D_char_s(a, nrm, order, dim, err)#

Array norms: real(sp)

Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[..]

nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_to_2D_char_s(a, nrm, order, dim, err)#
Arguments:
areal(kind=sp), (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_to_3D_char_s(a, nrm, order, dim, err)#
Arguments:
areal(kind=sp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_1D_int_s(a, nrm, order, err)#

Scalar norms: real(sp)

Arguments:
areal(kind=sp), target, intent(in), dimension(:)

Input 1-d matrix a(:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_int_s(a, nrm, order, err)#
Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_int_s(a, nrm, order, err)#
Arguments:
areal(kind=sp), target, (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_int_s(a, nrm, order, err)#
Arguments:
areal(kind=sp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_to_1D_int_s(a, nrm, order, dim, err)#

Array norms: real(sp)

Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[..]

nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_to_2D_int_s(a, nrm, order, dim, err)#
Arguments:
areal(kind=sp), (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_to_3D_int_s(a, nrm, order, dim, err)#
Arguments:
areal(kind=sp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_1D_char_d(a, nrm, order, err)#

Scalar norms: real(dp)

Arguments:
areal(kind=dp), target, intent(in), dimension(:)

Input 1-d matrix a(:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_char_d(a, nrm, order, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_char_d(a, nrm, order, err)#
Arguments:
areal(kind=dp), target, (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_char_d(a, nrm, order, err)#
Arguments:
areal(kind=dp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_to_1D_char_d(a, nrm, order, dim, err)#

Array norms: real(dp)

Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[..]

nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_to_2D_char_d(a, nrm, order, dim, err)#
Arguments:
areal(kind=dp), (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_to_3D_char_d(a, nrm, order, dim, err)#
Arguments:
areal(kind=dp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_1D_int_d(a, nrm, order, err)#

Scalar norms: real(dp)

Arguments:
areal(kind=dp), target, intent(in), dimension(:)

Input 1-d matrix a(:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_int_d(a, nrm, order, err)#
Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_int_d(a, nrm, order, err)#
Arguments:
areal(kind=dp), target, (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_int_d(a, nrm, order, err)#
Arguments:
areal(kind=dp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_to_1D_int_d(a, nrm, order, dim, err)#

Array norms: real(dp)

Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[..]

nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_to_2D_int_d(a, nrm, order, dim, err)#
Arguments:
areal(kind=dp), (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_to_3D_int_d(a, nrm, order, dim, err)#
Arguments:
areal(kind=dp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_1D_char_c(a, nrm, order, err)#

Scalar norms: complex(sp)

Arguments:
acomplex(kind=sp), target, intent(in), dimension(:)

Input 1-d matrix a(:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_char_c(a, nrm, order, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_char_c(a, nrm, order, err)#
Arguments:
acomplex(kind=sp), target, (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_char_c(a, nrm, order, err)#
Arguments:
acomplex(kind=sp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_to_1D_char_c(a, nrm, order, dim, err)#

Array norms: complex(sp)

Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[..]

nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_to_2D_char_c(a, nrm, order, dim, err)#
Arguments:
acomplex(kind=sp), (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_to_3D_char_c(a, nrm, order, dim, err)#
Arguments:
acomplex(kind=sp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_1D_int_c(a, nrm, order, err)#

Scalar norms: complex(sp)

Arguments:
acomplex(kind=sp), target, intent(in), dimension(:)

Input 1-d matrix a(:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_int_c(a, nrm, order, err)#
Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_int_c(a, nrm, order, err)#
Arguments:
acomplex(kind=sp), target, (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_int_c(a, nrm, order, err)#
Arguments:
acomplex(kind=sp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

nrmreal(kind=sp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_to_1D_int_c(a, nrm, order, dim, err)#

Array norms: complex(sp)

Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a[..]

nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_to_2D_int_c(a, nrm, order, dim, err)#
Arguments:
acomplex(kind=sp), (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_to_3D_int_c(a, nrm, order, dim, err)#
Arguments:
acomplex(kind=sp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

nrmreal(kind=sp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_1D_char_z(a, nrm, order, err)#

Scalar norms: complex(dp)

Arguments:
acomplex(kind=dp), target, intent(in), dimension(:)

Input 1-d matrix a(:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_char_z(a, nrm, order, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_char_z(a, nrm, order, err)#
Arguments:
acomplex(kind=dp), target, (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_char_z(a, nrm, order, err)#
Arguments:
acomplex(kind=dp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_to_1D_char_z(a, nrm, order, dim, err)#

Array norms: complex(dp)

Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[..]

nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_to_2D_char_z(a, nrm, order, dim, err)#
Arguments:
acomplex(kind=dp), (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_to_3D_char_z(a, nrm, order, dim, err)#
Arguments:
acomplex(kind=dp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_1D_int_z(a, nrm, order, err)#

Scalar norms: complex(dp)

Arguments:
acomplex(kind=dp), target, intent(in), dimension(:)

Input 1-d matrix a(:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_int_z(a, nrm, order, err)#
Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input 2-d matrix a(:,:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_int_z(a, nrm, order, err)#
Arguments:
acomplex(kind=dp), target, (:, :, :), intent(in), dimension(:,:,:)

Input 3-d matrix a(:,:,:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_int_z(a, nrm, order, err)#
Arguments:
acomplex(kind=dp), target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input 4-d matrix a(:,:,:,:)

nrmreal(kind=dp), intent(out)

Norm of the matrix.

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_2D_to_1D_int_z(a, nrm, order, dim, err)#

Array norms: complex(dp)

Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a[..]

nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_3D_to_2D_int_z(a, nrm, order, dim, err)#
Arguments:
acomplex(kind=dp), (:, :, :), intent(in), dimension(:,:,:)

Input matrix a[..]

nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

pure module subroutine norm_4D_to_3D_int_z(a, nrm, order, dim, err)#
Arguments:
acomplex(kind=dp), (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a[..]

nrmreal(kind=dp), (merge(size(a, 1), size(a, 2), mask=1<dim), merge(size(a, 2), size(a, 3), mask=2<dim), merge(size(a, 3), size(a, 4), mask=3<dim)), intent(out), dimension(merge(size(a,1),size(a,2),mask=1<dim),merge(size(a,2),size(a,3),mask=2<dim),merge(size(a,3),size(a,4),mask=3<dim)

Norm of the matrix. (Same shape as a, with dim dropped).

orderinteger(kind=ilp), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in)

Dimension the norm is computed along

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Summary

Subroutine interface that returns one of several scalar norm metrics of a real or complex input array ( A ), that can have any rank. For generic rank-n arrays, the scalar norm over the whole array is returned by default. If n>=2 and the optional input dimension dim is specified, a rank n-1 array is returned with dimension dim collapsed, containing all 1D array norms evaluated along dimension dim only.

Description

This pure subroutine `interface provides methods for computing the vector norm(s) of an array. Supported data types include `real and complex. Input arrays may have generic rank from 1 to 4.

Norm type input is mandatory, and it is provided via the order argument. This can be provided as either an integer value or a character string. Allowed metrics are: - 1-norm ( sum_i{ left|a_iright| } ): order = 1 or ‘1’ - Euclidean norm ( sqrt{sum_i{ a_i^2 }} ): order = 2 or ‘2’ - p-norm ( left( sum_i{ left|a_iright|^p }right) ^{1/p} ): integer order, order>=3 - Infinity norm ( max_i{ left|a_iright| } ): order = huge(0) or ‘inf’ - Minus-infinity norm ( min_i{ left|a_iright| } ): order = -huge(0) or ‘-inf’

Example

real(sp) :: a(3,3), na, rown(3)
type(linalg_state_type) :: err
a = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3])

! L2 norm: whole matrix
call get_norm(a, na, 2)

! Infinity norms of each row, with error control
call get_norm(a, rown, 'inf', dim=2, err=err)

mnorm (interface)#

mnorm (interface)

Matrix norms: function interface version: experimental

Computes the matrix norm of a generic-rank array ( A ). (Specification: stdlib_linalg)

Procedures:
module function matrix_norm_char_s(a, order, err) -> nrm#

Matrix norms: real(sp) rank-2 arrays

Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a(m,n)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function matrix_norm_3D_to_1D_char_s(a, order, dim, err) -> nrm#

Matrix norms: real(sp) higher rank arrays

Arguments:
areal(kind=sp), contiguous, target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a(m,n)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=sp), allocatable, dimension(:)

Norm of the matrix.

module function matrix_norm_4D_to_2D_char_s(a, order, dim, err) -> nrm#
Arguments:
areal(kind=sp), contiguous, target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a(m,n)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=sp), allocatable, (:, :), dimension(:,:)

Norm of the matrix.

module function matrix_norm_int_s(a, order, err) -> nrm#

Matrix norms: real(sp) rank-2 arrays

Arguments:
areal(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a(m,n)

orderinteger(kind=ilp), intent(in), optional

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function matrix_norm_3D_to_1D_int_s(a, order, dim, err) -> nrm#

Matrix norms: real(sp) higher rank arrays

Arguments:
areal(kind=sp), contiguous, target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a(m,n)

orderinteger(kind=ilp), intent(in), optional

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=sp), allocatable, dimension(:)

Norm of the matrix.

module function matrix_norm_4D_to_2D_int_s(a, order, dim, err) -> nrm#
Arguments:
areal(kind=sp), contiguous, target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a(m,n)

orderinteger(kind=ilp), intent(in), optional

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=sp), allocatable, (:, :), dimension(:,:)

Norm of the matrix.

module function matrix_norm_char_d(a, order, err) -> nrm#

Matrix norms: real(dp) rank-2 arrays

Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a(m,n)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function matrix_norm_3D_to_1D_char_d(a, order, dim, err) -> nrm#

Matrix norms: real(dp) higher rank arrays

Arguments:
areal(kind=dp), contiguous, target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a(m,n)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=dp), allocatable, dimension(:)

Norm of the matrix.

module function matrix_norm_4D_to_2D_char_d(a, order, dim, err) -> nrm#
Arguments:
areal(kind=dp), contiguous, target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a(m,n)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=dp), allocatable, (:, :), dimension(:,:)

Norm of the matrix.

module function matrix_norm_int_d(a, order, err) -> nrm#

Matrix norms: real(dp) rank-2 arrays

Arguments:
areal(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a(m,n)

orderinteger(kind=ilp), intent(in), optional

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function matrix_norm_3D_to_1D_int_d(a, order, dim, err) -> nrm#

Matrix norms: real(dp) higher rank arrays

Arguments:
areal(kind=dp), contiguous, target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a(m,n)

orderinteger(kind=ilp), intent(in), optional

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=dp), allocatable, dimension(:)

Norm of the matrix.

module function matrix_norm_4D_to_2D_int_d(a, order, dim, err) -> nrm#
Arguments:
areal(kind=dp), contiguous, target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a(m,n)

orderinteger(kind=ilp), intent(in), optional

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=dp), allocatable, (:, :), dimension(:,:)

Norm of the matrix.

module function matrix_norm_char_c(a, order, err) -> nrm#

Matrix norms: complex(sp) rank-2 arrays

Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a(m,n)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function matrix_norm_3D_to_1D_char_c(a, order, dim, err) -> nrm#

Matrix norms: complex(sp) higher rank arrays

Arguments:
acomplex(kind=sp), contiguous, target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a(m,n)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=sp), allocatable, dimension(:)

Norm of the matrix.

module function matrix_norm_4D_to_2D_char_c(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=sp), contiguous, target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a(m,n)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=sp), allocatable, (:, :), dimension(:,:)

Norm of the matrix.

module function matrix_norm_int_c(a, order, err) -> nrm#

Matrix norms: complex(sp) rank-2 arrays

Arguments:
acomplex(kind=sp), target, (:, :), intent(in), dimension(:,:)

Input matrix a(m,n)

orderinteger(kind=ilp), intent(in), optional

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=sp)

Norm of the matrix.

module function matrix_norm_3D_to_1D_int_c(a, order, dim, err) -> nrm#

Matrix norms: complex(sp) higher rank arrays

Arguments:
acomplex(kind=sp), contiguous, target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a(m,n)

orderinteger(kind=ilp), intent(in), optional

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=sp), allocatable, dimension(:)

Norm of the matrix.

module function matrix_norm_4D_to_2D_int_c(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=sp), contiguous, target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a(m,n)

orderinteger(kind=ilp), intent(in), optional

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=sp), allocatable, (:, :), dimension(:,:)

Norm of the matrix.

module function matrix_norm_char_z(a, order, err) -> nrm#

Matrix norms: complex(dp) rank-2 arrays

Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a(m,n)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function matrix_norm_3D_to_1D_char_z(a, order, dim, err) -> nrm#

Matrix norms: complex(dp) higher rank arrays

Arguments:
acomplex(kind=dp), contiguous, target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a(m,n)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=dp), allocatable, dimension(:)

Norm of the matrix.

module function matrix_norm_4D_to_2D_char_z(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=dp), contiguous, target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a(m,n)

ordercharacter(len=*), intent(in)

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=dp), allocatable, (:, :), dimension(:,:)

Norm of the matrix.

module function matrix_norm_int_z(a, order, err) -> nrm#

Matrix norms: complex(dp) rank-2 arrays

Arguments:
acomplex(kind=dp), target, (:, :), intent(in), dimension(:,:)

Input matrix a(m,n)

orderinteger(kind=ilp), intent(in), optional

Order of the matrix norm being computed.

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=dp)

Norm of the matrix.

module function matrix_norm_3D_to_1D_int_z(a, order, dim, err) -> nrm#

Matrix norms: complex(dp) higher rank arrays

Arguments:
acomplex(kind=dp), contiguous, target, (:, :, :), intent(in), dimension(:,:,:)

Input matrix a(m,n)

orderinteger(kind=ilp), intent(in), optional

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=dp), allocatable, dimension(:)

Norm of the matrix.

module function matrix_norm_4D_to_2D_int_z(a, order, dim, err) -> nrm#
Arguments:
acomplex(kind=dp), contiguous, target, (:, :, :, :), intent(in), dimension(:,:,:,:)

Input matrix a(m,n)

orderinteger(kind=ilp), intent(in), optional

Order of the matrix norm being computed.

diminteger(kind=ilp), intent(in), optional, dimension(2)

[optional] dimensions of the sub-matrices the norms should be evaluated at (default = [1,2])

errtype(linalg_state_type), intent(out), optional

[optional] state return flag. On error if not requested, the code will stop

Returns:
nrmreal(kind=dp), allocatable, (:, :), dimension(:,:)

Norm of the matrix.

Summary

Return one of several matrix norm metrics of a real or complex input array ( A ), that can have rank 2 or higher. For rank-2 arrays, the matrix norm is returned. If rank>2 and the optional input dimensions dim are specified, a rank n-2 array is returned with dimensions dim(1),dim(2) collapsed, containing all matrix norms evaluated over the specified dimensions only. dim==[1,2] are assumed as default dimensions if not specified.

Description

This interface provides methods for computing the matrix norm(s) of an array. Supported data types include real and complex. Input arrays must have rank >= 2.

Norm type input is optional, and it is provided via the order argument. This can be provided as either an integer value or a character string. Allowed metrics are: - 1-norm: order = 1 or ‘1’ - 2-norm: order = 2 or ‘2’ - Euclidean/Frobenius: order = ‘Euclidean’,’Frobenius’, or argument not specified - Infinity norm: order = huge(0) or ‘Inf’

If an invalid norm type is provided, the routine returns an error state.

Example

real(sp) :: a(3,3), na
real(sp) :: b(3,3,4), nb(4)  ! Array of 4 3x3 matrices
a = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3])

! Euclidean/Frobenius norm of single matrix
na = mnorm(a)
na = mnorm(a, 'Euclidean')

! 1-norm of each 3x3 matrix in b
nb = mnorm(b, 1, dim=[1,2])

! Infinity-norm 
na = mnorm(b, 'inf', dim=[3,2])

expm (interface)#

expm (interface)

Matrix exponential: function interface version : experimental

Computes the exponential of a matrix using a rational Pade approximation. (Specification: stdlib_linalg)

Procedures:
module function stdlib_linalg_s_expm_fun(A, order) -> E#
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a(:, :).

orderinteger(kind=ilp), intent(in), optional

[optional] Order of the Pade approximation (default order=10)

Returns:
Ereal(kind=sp), allocatable, (:, :), dimension(:,:)

Exponential of the input matrix E = exp(A).

module function stdlib_linalg_d_expm_fun(A, order) -> E#
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a(:, :).

orderinteger(kind=ilp), intent(in), optional

[optional] Order of the Pade approximation (default order=10)

Returns:
Ereal(kind=dp), allocatable, (:, :), dimension(:,:)

Exponential of the input matrix E = exp(A).

module function stdlib_linalg_c_expm_fun(A, order) -> E#
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix a(:, :).

orderinteger(kind=ilp), intent(in), optional

[optional] Order of the Pade approximation (default order=10)

Returns:
Ecomplex(kind=sp), allocatable, (:, :), dimension(:,:)

Exponential of the input matrix E = exp(A).

module function stdlib_linalg_z_expm_fun(A, order) -> E#
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix a(:, :).

orderinteger(kind=ilp), intent(in), optional

[optional] Order of the Pade approximation (default order=10)

Returns:
Ecomplex(kind=dp), allocatable, (:, :), dimension(:,:)

Exponential of the input matrix E = exp(A).

Description

This interface provides methods for computing the exponential of a matrix represented as a standard Fortran rank-2 array. Supported data types include real and complex.

By default, the order of the Pade approximation is set to 10. It can be changed via the order argument that must be non-negative.

If the input matrix is non-square or the order of the Pade approximation is negative, the function returns an error state.

Example

real(dp) :: A(3, 3), E(3, 3)

A = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3])

! Default Pade approximation of the matrix exponential.
E = expm(A)

! Pade approximation with specified order.
E = expm(A, order=12)

matrix_exp (interface)#

matrix_exp (interface)

Matrix exponential: subroutine interface version : experimental

Computes the exponential of a matrix using a rational Pade approximation. (Specification: stdlib_linalg)

Procedures:
module subroutine stdlib_linalg_s_expm_inplace(A, order, err)#
Arguments:
Areal(kind=sp), (:, :), intent(inout), dimension(:,:)

Input matrix A(n, n) / Output matrix E = exp(A)

orderinteger(kind=ilp), intent(in), optional

[optional] Order of the Pade approximation (default order=10)

errtype(linalg_state_type), intent(out), optional

[optional] Error handling.

module subroutine stdlib_linalg_s_expm(A, E, order, err)#
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix A(n, n)

Ereal(kind=sp), (:, :), intent(out), dimension(:,:)

Output matrix exponential E = exp(A)

orderinteger(kind=ilp), intent(in), optional

[optional] Order of the Pade approximation (default order=10)

errtype(linalg_state_type), intent(out), optional

[optional] Error handling.

module subroutine stdlib_linalg_d_expm_inplace(A, order, err)#
Arguments:
Areal(kind=dp), (:, :), intent(inout), dimension(:,:)

Input matrix A(n, n) / Output matrix E = exp(A)

orderinteger(kind=ilp), intent(in), optional

[optional] Order of the Pade approximation (default order=10)

errtype(linalg_state_type), intent(out), optional

[optional] Error handling.

module subroutine stdlib_linalg_d_expm(A, E, order, err)#
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix A(n, n)

Ereal(kind=dp), (:, :), intent(out), dimension(:,:)

Output matrix exponential E = exp(A)

orderinteger(kind=ilp), intent(in), optional

[optional] Order of the Pade approximation (default order=10)

errtype(linalg_state_type), intent(out), optional

[optional] Error handling.

module subroutine stdlib_linalg_c_expm_inplace(A, order, err)#
Arguments:
Acomplex(kind=sp), (:, :), intent(inout), dimension(:,:)

Input matrix A(n, n) / Output matrix E = exp(A)

orderinteger(kind=ilp), intent(in), optional

[optional] Order of the Pade approximation (default order=10)

errtype(linalg_state_type), intent(out), optional

[optional] Error handling.

module subroutine stdlib_linalg_c_expm(A, E, order, err)#
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)

Input matrix A(n, n)

Ecomplex(kind=sp), (:, :), intent(out), dimension(:,:)

Output matrix exponential E = exp(A)

orderinteger(kind=ilp), intent(in), optional

[optional] Order of the Pade approximation (default order=10)

errtype(linalg_state_type), intent(out), optional

[optional] Error handling.

module subroutine stdlib_linalg_z_expm_inplace(A, order, err)#
Arguments:
Acomplex(kind=dp), (:, :), intent(inout), dimension(:,:)

Input matrix A(n, n) / Output matrix E = exp(A)

orderinteger(kind=ilp), intent(in), optional

[optional] Order of the Pade approximation (default order=10)

errtype(linalg_state_type), intent(out), optional

[optional] Error handling.

module subroutine stdlib_linalg_z_expm(A, E, order, err)#
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)

Input matrix A(n, n)

Ecomplex(kind=dp), (:, :), intent(out), dimension(:,:)

Output matrix exponential E = exp(A)

orderinteger(kind=ilp), intent(in), optional

[optional] Order of the Pade approximation (default order=10)

errtype(linalg_state_type), intent(out), optional

[optional] Error handling.

Description

This interface provides methods for computing the exponential of a matrix represented as a standard Fortran rank-2 array. Supported data types include real and complex.

By default, the order of the Pade approximation is set to 10. It can be changed via the order argument that must be non-negative.

If the input matrix is non-square or the order of the Pade approximation is negative, the function returns an error state.

Example

real(dp) :: A(3, 3), E(3, 3)

A = reshape([1, 2, 3, 4, 5, 6, 7, 8, 9], [3, 3])

! Default Pade approximation of the matrix exponential.
call matrix_exp(A, E) ! Out-of-place
! call matrix_exp(A) for in-place computation.

! Pade approximation with specified order.
call matrix_exp(A, E, order=12)

Procedures

eye_rsp (function)#

pure function eye_rsp(dim1, dim2, mold) -> result

Constructs the identity matrix. (Specification: stdlib_linalg)

Arguments:
dim1integer, intent(in)
dim2integer, intent(in), optional
moldreal(kind=sp), intent(in)
Returns:
resultreal(kind=sp), allocatable, (:, :), dimension(:,:)

eye_rdp (function)#

pure function eye_rdp(dim1, dim2, mold) -> result
Arguments:
dim1integer, intent(in)
dim2integer, intent(in), optional
moldreal(kind=dp), intent(in), optional
Returns:
resultreal(kind=dp), allocatable, (:, :), dimension(:,:)

eye_csp (function)#

pure function eye_csp(dim1, dim2, mold) -> result
Arguments:
dim1integer, intent(in)
dim2integer, intent(in), optional
moldcomplex(kind=sp), intent(in)
Returns:
resultcomplex(kind=sp), allocatable, (:, :), dimension(:,:)

eye_cdp (function)#

pure function eye_cdp(dim1, dim2, mold) -> result
Arguments:
dim1integer, intent(in)
dim2integer, intent(in), optional
moldcomplex(kind=dp), intent(in)
Returns:
resultcomplex(kind=dp), allocatable, (:, :), dimension(:,:)

eye_iint8 (function)#

pure function eye_iint8(dim1, dim2, mold) -> result
Arguments:
dim1integer, intent(in)
dim2integer, intent(in), optional
moldinteger(kind=int8), intent(in)
Returns:
resultinteger(kind=int8), allocatable, (:, :), dimension(:,:)

eye_iint16 (function)#

pure function eye_iint16(dim1, dim2, mold) -> result
Arguments:
dim1integer, intent(in)
dim2integer, intent(in), optional
moldinteger(kind=int16), intent(in)
Returns:
resultinteger(kind=int16), allocatable, (:, :), dimension(:,:)

eye_iint32 (function)#

pure function eye_iint32(dim1, dim2, mold) -> result
Arguments:
dim1integer, intent(in)
dim2integer, intent(in), optional
moldinteger(kind=int32), intent(in)
Returns:
resultinteger(kind=int32), allocatable, (:, :), dimension(:,:)

eye_iint64 (function)#

pure function eye_iint64(dim1, dim2, mold) -> result
Arguments:
dim1integer, intent(in)
dim2integer, intent(in), optional
moldinteger(kind=int64), intent(in)
Returns:
resultinteger(kind=int64), allocatable, (:, :), dimension(:,:)

trace_rsp (function)#

function trace_rsp(A) -> res
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
resreal(kind=sp)

trace_rdp (function)#

function trace_rdp(A) -> res
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
resreal(kind=dp)

trace_csp (function)#

function trace_csp(A) -> res
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
rescomplex(kind=sp)

trace_cdp (function)#

function trace_cdp(A) -> res
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
rescomplex(kind=dp)

trace_iint8 (function)#

function trace_iint8(A) -> res
Arguments:
Ainteger(kind=int8), (:, :), intent(in), dimension(:,:)
Returns:
resinteger(kind=int8)

trace_iint16 (function)#

function trace_iint16(A) -> res
Arguments:
Ainteger(kind=int16), (:, :), intent(in), dimension(:,:)
Returns:
resinteger(kind=int16)

trace_iint32 (function)#

function trace_iint32(A) -> res
Arguments:
Ainteger(kind=int32), (:, :), intent(in), dimension(:,:)
Returns:
resinteger(kind=int32)

trace_iint64 (function)#

function trace_iint64(A) -> res
Arguments:
Ainteger(kind=int64), (:, :), intent(in), dimension(:,:)
Returns:
resinteger(kind=int64)

is_square_rsp (function)#

pure function is_square_rsp(A) -> res
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_square_rdp (function)#

pure function is_square_rdp(A) -> res
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_square_csp (function)#

pure function is_square_csp(A) -> res
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_square_cdp (function)#

pure function is_square_cdp(A) -> res
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_square_iint8 (function)#

pure function is_square_iint8(A) -> res
Arguments:
Ainteger(kind=int8), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_square_iint16 (function)#

pure function is_square_iint16(A) -> res
Arguments:
Ainteger(kind=int16), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_square_iint32 (function)#

pure function is_square_iint32(A) -> res
Arguments:
Ainteger(kind=int32), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_square_iint64 (function)#

pure function is_square_iint64(A) -> res
Arguments:
Ainteger(kind=int64), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_diagonal_rsp (function)#

pure function is_diagonal_rsp(A) -> res
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_diagonal_rdp (function)#

pure function is_diagonal_rdp(A) -> res
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_diagonal_csp (function)#

pure function is_diagonal_csp(A) -> res
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_diagonal_cdp (function)#

pure function is_diagonal_cdp(A) -> res
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_diagonal_iint8 (function)#

pure function is_diagonal_iint8(A) -> res
Arguments:
Ainteger(kind=int8), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_diagonal_iint16 (function)#

pure function is_diagonal_iint16(A) -> res
Arguments:
Ainteger(kind=int16), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_diagonal_iint32 (function)#

pure function is_diagonal_iint32(A) -> res
Arguments:
Ainteger(kind=int32), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_diagonal_iint64 (function)#

pure function is_diagonal_iint64(A) -> res
Arguments:
Ainteger(kind=int64), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_symmetric_rsp (function)#

pure function is_symmetric_rsp(A) -> res
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_symmetric_rdp (function)#

pure function is_symmetric_rdp(A) -> res
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_symmetric_csp (function)#

pure function is_symmetric_csp(A) -> res
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_symmetric_cdp (function)#

pure function is_symmetric_cdp(A) -> res
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_symmetric_iint8 (function)#

pure function is_symmetric_iint8(A) -> res
Arguments:
Ainteger(kind=int8), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_symmetric_iint16 (function)#

pure function is_symmetric_iint16(A) -> res
Arguments:
Ainteger(kind=int16), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_symmetric_iint32 (function)#

pure function is_symmetric_iint32(A) -> res
Arguments:
Ainteger(kind=int32), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_symmetric_iint64 (function)#

pure function is_symmetric_iint64(A) -> res
Arguments:
Ainteger(kind=int64), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_skew_symmetric_rsp (function)#

pure function is_skew_symmetric_rsp(A) -> res
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_skew_symmetric_rdp (function)#

pure function is_skew_symmetric_rdp(A) -> res
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_skew_symmetric_csp (function)#

pure function is_skew_symmetric_csp(A) -> res
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_skew_symmetric_cdp (function)#

pure function is_skew_symmetric_cdp(A) -> res
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_skew_symmetric_iint8 (function)#

pure function is_skew_symmetric_iint8(A) -> res
Arguments:
Ainteger(kind=int8), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_skew_symmetric_iint16 (function)#

pure function is_skew_symmetric_iint16(A) -> res
Arguments:
Ainteger(kind=int16), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_skew_symmetric_iint32 (function)#

pure function is_skew_symmetric_iint32(A) -> res
Arguments:
Ainteger(kind=int32), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_skew_symmetric_iint64 (function)#

pure function is_skew_symmetric_iint64(A) -> res
Arguments:
Ainteger(kind=int64), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_hermitian_rsp (function)#

pure function is_hermitian_rsp(A) -> res
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_hermitian_rdp (function)#

pure function is_hermitian_rdp(A) -> res
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_hermitian_iint8 (function)#

pure function is_hermitian_iint8(A) -> res
Arguments:
Ainteger(kind=int8), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_hermitian_iint16 (function)#

pure function is_hermitian_iint16(A) -> res
Arguments:
Ainteger(kind=int16), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_hermitian_iint32 (function)#

pure function is_hermitian_iint32(A) -> res
Arguments:
Ainteger(kind=int32), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_hermitian_iint64 (function)#

pure function is_hermitian_iint64(A) -> res
Arguments:
Ainteger(kind=int64), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_hermitian_csp (function)#

pure function is_hermitian_csp(A) -> res
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

is_hermitian_cdp (function)#

pure function is_hermitian_cdp(A) -> res
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
reslogical

hermitian_rsp (function)#

pure module function hermitian_rsp(a) -> ah
Arguments:
areal(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
ahreal(kind=sp), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)

hermitian_rdp (function)#

pure module function hermitian_rdp(a) -> ah
Arguments:
areal(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
ahreal(kind=dp), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)

hermitian_csp (function)#

pure module function hermitian_csp(a) -> ah
Arguments:
acomplex(kind=sp), (:, :), intent(in), dimension(:,:)
Returns:
ahcomplex(kind=sp), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)

hermitian_cdp (function)#

pure module function hermitian_cdp(a) -> ah
Arguments:
acomplex(kind=dp), (:, :), intent(in), dimension(:,:)
Returns:
ahcomplex(kind=dp), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)

hermitian_iint8 (function)#

pure module function hermitian_iint8(a) -> ah
Arguments:
ainteger(kind=int8), (:, :), intent(in), dimension(:,:)
Returns:
ahinteger(kind=int8), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)

hermitian_iint16 (function)#

pure module function hermitian_iint16(a) -> ah
Arguments:
ainteger(kind=int16), (:, :), intent(in), dimension(:,:)
Returns:
ahinteger(kind=int16), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)

hermitian_iint32 (function)#

pure module function hermitian_iint32(a) -> ah
Arguments:
ainteger(kind=int32), (:, :), intent(in), dimension(:,:)
Returns:
ahinteger(kind=int32), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)

hermitian_iint64 (function)#

pure module function hermitian_iint64(a) -> ah
Arguments:
ainteger(kind=int64), (:, :), intent(in), dimension(:,:)
Returns:
ahinteger(kind=int64), (size(a, 2), size(a, 1)), dimension(size(a,2),size(a,1)

is_triangular_rsp (function)#

function is_triangular_rsp(A, uplo) -> res
Arguments:
Areal(kind=sp), (:, :), intent(in), dimension(:,:)
uplocharacter(len=1), intent(in)
Returns:
reslogical

is_triangular_rdp (function)#

function is_triangular_rdp(A, uplo) -> res
Arguments:
Areal(kind=dp), (:, :), intent(in), dimension(:,:)
uplocharacter(len=1), intent(in)
Returns:
reslogical

is_triangular_csp (function)#

function is_triangular_csp(A, uplo) -> res
Arguments:
Acomplex(kind=sp), (:, :), intent(in), dimension(:,:)
uplocharacter(len=1), intent(in)
Returns:
reslogical

is_triangular_cdp (function)#

function is_triangular_cdp(A, uplo) -> res
Arguments:
Acomplex(kind=dp), (:, :), intent(in), dimension(:,:)
uplocharacter(len=1), intent(in)
Returns:
reslogical

is_triangular_iint8 (function)#

function is_triangular_iint8(A, uplo) -> res
Arguments:
Ainteger(kind=int8), (:, :), intent(in), dimension(:,:)
uplocharacter(len=1), intent(in)
Returns:
reslogical

is_triangular_iint16 (function)#

function is_triangular_iint16(A, uplo) -> res
Arguments:
Ainteger(kind=int16), (:, :), intent(in), dimension(:,:)
uplocharacter(len=1), intent(in)
Returns:
reslogical

is_triangular_iint32 (function)#

function is_triangular_iint32(A, uplo) -> res
Arguments:
Ainteger(kind=int32), (:, :), intent(in), dimension(:,:)
uplocharacter(len=1), intent(in)
Returns:
reslogical

is_triangular_iint64 (function)#

function is_triangular_iint64(A, uplo) -> res
Arguments:
Ainteger(kind=int64), (:, :), intent(in), dimension(:,:)
uplocharacter(len=1), intent(in)
Returns:
reslogical