linalg  1.4.3
A linear algebra library that provides a user-friendly interface to several BLAS and LAPACK routines.
linalg_sorting::sort Interface Reference

Sorts an array. More...

Private Member Functions

subroutine sort_dbl_array (x, ascend)
 Sorts an array. More...
 
subroutine sort_dbl_array_ind (x, ind, ascend, err)
 Sorts an array. More...
 
subroutine sort_cmplx_array (x, ascend)
 Sorts an array. More...
 
subroutine sort_cmplx_array_ind (x, ind, ascend, err)
 Sorts an array. More...
 
subroutine sort_eigen_cmplx (vals, vecs, ascend, err)
 A sorting routine specifically tailored for sorting of eigenvalues and their associated eigenvectors using a quick-sort approach. More...
 
subroutine sort_eigen_dbl (vals, vecs, ascend, err)
 A sorting routine specifically tailored for sorting of eigenvalues and their associated eigenvectors using a quick-sort approach. More...
 

Detailed Description

Sorts an array.

Definition at line 19 of file linalg_sorting.f90.

Member Function/Subroutine Documentation

◆ sort_cmplx_array()

subroutine linalg_sorting::sort::sort_cmplx_array ( complex(real64), dimension(:), intent(inout)  x,
logical, intent(in), optional  ascend 
)
private

Sorts an array.

Parameters
[in,out]xOn input, the array to sort. On output, the sorted array.
[in]ascendAn optional input that, if specified, controls if the the array is sorted in an ascending order (default), or a descending order.
Remarks
This routine utilizes a quick sort algorithm. As this routine operates on complex valued items, the complex values are sorted based upon the real component of the number.
Notes
This implementation is a slight modification of the code presented at http://www.fortran.com/qsort_c.f95.

Definition at line 157 of file linalg_sorting.f90.

◆ sort_cmplx_array_ind()

subroutine linalg_sorting::sort::sort_cmplx_array_ind ( complex(real64), dimension(:), intent(inout)  x,
integer(int32), dimension(:), intent(inout)  ind,
logical, intent(in), optional  ascend,
class(errors), intent(inout), optional, target  err 
)
private

Sorts an array.

Parameters
[in,out]xOn input, the array to sort. On output, the sorted array.
[in,out]indOn input, an integer array. On output, the contents of this array are shifted in the same order as that of x as a means of tracking the sorting operation. It is often useful to set this array to an ascending group of values (1, 2, ... n) such that this array tracks the original positions of the sorted array. Such an array can then be used to align other arrays. This array must be the same size as x.
[in]ascendAn optional input that, if specified, controls if the the array is sorted in an ascending order (default), or a descending order.
[out]errAn optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
  • LA_ARRAY_SIZE_ERROR: Occurs if ind is not sized to match x.
Remarks
This routine utilizes a quick sort algorithm. As this routine operates on complex valued items, the complex values are sorted based upon the real component of the number.
Notes
This implementation is a slight modification of the code presented at http://www.fortran.com/qsort_c.f95.

Definition at line 206 of file linalg_sorting.f90.

◆ sort_dbl_array()

subroutine linalg_sorting::sort::sort_dbl_array ( real(real64), dimension(:), intent(inout)  x,
logical, intent(in), optional  ascend 
)
private

Sorts an array.

Parameters
[in,out]xOn input, the array to sort. On output, the sorted array.
[in]ascendAn optional input that, if specified, controls if the the array is sorted in an ascending order (default), or a descending order.
Remarks
The routine utilizes a quick sort algorithm unless the size of the array is less than or equal to 20. For such small arrays an insertion sort algorithm is utilized.
Notes
This routine utilizes the LAPACK routine DLASRT.

Definition at line 48 of file linalg_sorting.f90.

◆ sort_dbl_array_ind()

subroutine linalg_sorting::sort::sort_dbl_array_ind ( real(real64), dimension(:), intent(inout)  x,
integer(int32), dimension(:), intent(inout)  ind,
logical, intent(in), optional  ascend,
class(errors), intent(inout), optional, target  err 
)
private

Sorts an array.

Parameters
[in,out]xOn input, the array to sort. On output, the sorted array.
[in,out]indOn input, an integer array. On output, the contents of this array are shifted in the same order as that of x as a means of tracking the sorting operation. It is often useful to set this array to an ascending group of values (1, 2, ... n) such that this array tracks the original positions of the sorted array. Such an array can then be used to align other arrays. This array must be the same size as x.
[in]ascendAn optional input that, if specified, controls if the the array is sorted in an ascending order (default), or a descending order.
[out]errAn optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
  • LA_ARRAY_SIZE_ERROR: Occurs if ind is not sized to match x.
Remarks
This routine utilizes a quick sort algorithm explained at http://www.fortran.com/qsort_c.f95.

Definition at line 98 of file linalg_sorting.f90.

◆ sort_eigen_cmplx()

subroutine linalg_sorting::sort::sort_eigen_cmplx ( complex(real64), dimension(:), intent(inout)  vals,
complex(real64), dimension(:,:), intent(inout)  vecs,
logical, intent(in), optional  ascend,
class(errors), intent(inout), optional, target  err 
)
private

A sorting routine specifically tailored for sorting of eigenvalues and their associated eigenvectors using a quick-sort approach.

Parameters
[in,out]valsOn input, an N-element array containing the eigenvalues. On output, the sorted eigenvalues.
[in,out]vecsOn input, an N-by-N matrix containing the eigenvectors associated with vals (one vector per column). On output, the sorted eigenvector matrix.
[in]ascendAn optional input that, if specified, controls if the the array is sorted in an ascending order (default), or a descending order.
[out]errAn optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
  • LA_ARRAY_SIZE_ERROR: Occurs if vecs is not sized to match vals.
  • LA_OUT_OF_MEMORY_ERROR: Occurs if there is insufficient memory available to comoplete this operation.

Definition at line 268 of file linalg_sorting.f90.

◆ sort_eigen_dbl()

subroutine linalg_sorting::sort::sort_eigen_dbl ( real(real64), dimension(:), intent(inout)  vals,
real(real64), dimension(:,:), intent(inout)  vecs,
logical, intent(in), optional  ascend,
class(errors), intent(inout), optional, target  err 
)
private

A sorting routine specifically tailored for sorting of eigenvalues and their associated eigenvectors using a quick-sort approach.

Parameters
[in,out]valsOn input, an N-element array containing the eigenvalues. On output, the sorted eigenvalues.
[in,out]vecsOn input, an N-by-N matrix containing the eigenvectors associated with vals (one vector per column). On output, the sorted eigenvector matrix.
[in]ascendAn optional input that, if specified, controls if the the array is sorted in an ascending order (default), or a descending order.
[out]errAn optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
  • LA_ARRAY_SIZE_ERROR: Occurs if vecs is not sized to match vals.
  • LA_OUT_OF_MEMORY_ERROR: Occurs if there is insufficient memory available to comoplete this operation.

Definition at line 346 of file linalg_sorting.f90.


The documentation for this interface was generated from the following file: