ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
Return .true.
if the input array is sorted, either ascending or descending, or all equal.
More...
Return .true.
if the input array is sorted, either ascending or descending, or all equal.
[in] | array | : The input contiguous array of rank 1 of either
|
isSorted | : The external user-specified function that takes two input scalar arguments of the same type and kind as the input array .It returns a scalar logical of default kind LK that is .true. if the first input scalar argument is sorted with respect to the second input argument according to the user-defined condition within isSorted , otherwise, it is .false. .If array is a scalar string (i.e., an assumed-length scalar character ), then both input arguments to isSorted() are scalar characters of length 1 of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU).The following illustrates the generic interface of isSorted() , function isSorted(lhs, rhs) result(sorted)
TYPE(KIND) , intent(in) :: lhs, rhs
logical(LK) :: sorted
end function
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar... Definition: pm_kind.F90:268 integer, parameter LK The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(.... Definition: pm_kind.F90:541 TYPE(KIND) is the same as the type and kind of the input argument array , which can be one of the following. character(*, SK), intent(in) :: lhs, rhs
character(1, SK), intent(in) :: lhs, rhs
type(css_type) , intent(in) :: lhs, rhs
type(css_pdt) , intent(in) :: lhs, rhs
integer(IK) , intent(in) :: lhs, rhs
logical(LK) , intent(in) :: lhs, rhs
complex(CK) , intent(in) :: lhs, rhs
real(RK) , intent(in) :: lhs, rhs
This module contains the derived types for generating allocatable containers of scalar,... Definition: pm_container.F90:113 This is the css_pdt parameterized type for generating instances of container of scalar of string obje... Definition: pm_container.F90:783 This is the css_type type for generating instances of container of scalar of string objects. Definition: pm_container.F90:191 SK , IK , LK , CK , RK ) can refer to any of the supported kinds by the processor.This user-defined equivalence check is extremely useful where a user-defined sorting criterion other than simple ascending order is needed, for example, when the case-sensitivity of an input string or array of strings is irrelevant or when sorting of the absolute values matters excluding the signs of the numbers, or when descending order is desired. In such cases, user can define a custom sorting condition within the user-defined external function isSorted to achieve the goal.(optional, the default sorting condition is ascending order, that is a < b .) |
sorted
: An output logical
of default kind LK that is .true.
if all elements of the input array are in ascending order, in descending order, or all equal. Otherwise, it is .false.
.
Possible calling interfaces ⛓
.true.
when the input array has zero length.pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.pure
in release
build and impure
in debug
and testing
builds. The procedures under this generic interface are always impure
when the input argument isSorted()
is present.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 2251 of file pm_arraySort.F90.