mtx_rank Interface

public interface mtx_rank

An interface to the matrix rank routines.


Module Procedures

private function mtx_rank_dbl(a, tol, work, olwork, err) result(rnk)

Computes the rank of a matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(inout), dimension(:,:) :: a

The matrix.

real(kind=real64), intent(in), optional :: tol

An optional input, that if supplied, overrides the default tolerance on singular values such that singular values less than this tolerance are treated as zero. The default tolerance is: MAX(M, N) * EPS * MAX(S). If the supplied value is less than the smallest value that causes an overflow if inverted, the tolerance reverts back to its default value, and the operation continues; however, a warning message is issued.

real(kind=real64), intent(out), optional, target, dimension(:) :: work

An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork. If not provided, the memory required is allocated within.

integer(kind=int32), intent(out), optional :: olwork

An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

class(errors), intent(inout), optional, target :: err

An error object to report any errors that occur.

Return Value integer(kind=int32)

The rank of the matrix.

private function mtx_rank_cmplx(a, tol, work, olwork, rwork, err) result(rnk)

Computes the rank of a matrix.

Arguments

Type IntentOptional Attributes Name
complex(kind=real64), intent(inout), dimension(:,:) :: a

The matrix.

real(kind=real64), intent(in), optional :: tol

An optional input, that if supplied, overrides the default tolerance on singular values such that singular values less than this tolerance are treated as zero. The default tolerance is: MAX(M, N) * EPS * MAX(S). If the supplied value is less than the smallest value that causes an overflow if inverted, the tolerance reverts back to its default value, and the operation continues; however, a warning message is issued.

complex(kind=real64), intent(out), optional, target, dimension(:) :: work

An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork. If not provided, the memory required is allocated within.

integer(kind=int32), intent(out), optional :: olwork

An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

real(kind=real64), intent(out), optional, target, dimension(:) :: rwork

An optional input, that if provided, prevents any local memory allocation for real-valued workspace arrays. If not provided, the memory required is allocated within. If provided, the length of the array must be at least 6 * MIN(M, N).

class(errors), intent(inout), optional, target :: err

The rank of the matrix.

Return Value integer(kind=int32)

The rank of the matrix.