Computes the singular values of a real
or complex
2d matrix.
(Specification)
Function interface for computing the array of singular values from the singular value decomposition
of a real
or complex
2d matrix.
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)].
Note
The solution is based on LAPACK's singular value decomposition *GESDD
methods.
real(sp) :: a(2,3), s(2)
a = reshape([3,2, 2,3, 2,-2],[2,3])
s = svdvals(A)
print *, 'singular values = ',s
Compute singular values from the singular-value decomposition of a matrix .
This function returns the array of singular values from the singular value decomposition of a real
or complex
matrix .
param: a Input matrix of size [m,n]. param: err [optional] State return flag.
param: s real
array of size [min(m,n)] returning a list of singular values.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=sp), | intent(in), | target | :: | a(:,:) |
Input matrix A[m,n] |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[optional] state return flag. On error if not requested, the code will stop |
Array of singular values
Compute singular values from the singular-value decomposition of a matrix .
This function returns the array of singular values from the singular value decomposition of a real
or complex
matrix .
param: a Input matrix of size [m,n]. param: err [optional] State return flag.
param: s real
array of size [min(m,n)] returning a list of singular values.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | target | :: | a(:,:) |
Input matrix A[m,n] |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[optional] state return flag. On error if not requested, the code will stop |
Array of singular values
Compute singular values from the singular-value decomposition of a matrix .
This function returns the array of singular values from the singular value decomposition of a real
or complex
matrix .
param: a Input matrix of size [m,n]. param: err [optional] State return flag.
param: s real
array of size [min(m,n)] returning a list of singular values.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(in), | target | :: | a(:,:) |
Input matrix A[m,n] |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[optional] state return flag. On error if not requested, the code will stop |
Array of singular values
Compute singular values from the singular-value decomposition of a matrix .
This function returns the array of singular values from the singular value decomposition of a real
or complex
matrix .
param: a Input matrix of size [m,n]. param: err [optional] State return flag.
param: s real
array of size [min(m,n)] returning a list of singular values.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(in), | target | :: | a(:,:) |
Input matrix A[m,n] |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[optional] state return flag. On error if not requested, the code will stop |
Array of singular values