Generate and return .true.
if the input array is sorted in descending order (with the possibility of elements being equal), otherwise, generate and return .false.
.
- Parameters
-
[in] | array | : The input contiguous array of rank 1 of either
-
type css_pdt or,
-
type css_type or,
-
type
character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) of arbitrary length type parameter or,
-
type
integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64) or,
-
type
logical of kind any supported by the processor (e.g., LK) or,
-
type
complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128) or,
-
type
real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128) or,
or,
-
a scalar of type
character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) of arbitrary length type parameter,
whose elements will be checked for an all descending order
(with the possibility of elements being equal). |
- Returns
sorted
: An output logical
of default kind LK that is .true.
if all elements of the input array are in descending order (with the possibility of elements being equal) or all equal. Otherwise, it is .false.
.
Possible calling interfaces ⛓
Generate and return .true. if the input array is sorted in descending order (with the possibility of ...
This module contains procedures and generic interfaces for various sorting tasks.
- Warning
- The output of this procedure is
.true.
when the input array has zero length.
-
The
pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.
By default, these procedures are pure
in release
build and impure
in debug
and testing
builds.
- See also
- isSorted
isAscending
setSorted
setSorted
Example usage ⛓
9 type(display_type) :: disp
17 call disp%show(
"isDescending('?Aa')")
20 call disp%show(
"isDescending('A!b')")
23 call disp%show(
"isDescending('zxw')")
26 call disp%show(
"isDescending('AAA')")
31 call disp%show(
"isDescending([character(0) ::])")
34 call disp%show(
"isDescending(['?', 'A', 'a'])")
37 call disp%show(
"isDescending(['A', '!', 'b'])")
40 call disp%show(
"isDescending(['z', 'x', 'w'])")
43 call disp%show(
"isDescending(['A', 'A', 'A'])")
48 call disp%show(
"isDescending([integer ::])")
51 call disp%show(
"isDescending([+1, +2, +3])")
54 call disp%show(
"isDescending([-1, -2, -3])")
57 call disp%show(
"isDescending([-1, +2, -3])")
60 call disp%show(
"isDescending([-1, -1, -1])")
65 call disp%show(
"isDescending([logical ::])")
68 call disp%show(
"isDescending([.false., .false., .true.])")
71 call disp%show(
"isDescending([.true., .false., .false.])")
74 call disp%show(
"isDescending([.false., .true., .false.])")
77 call disp%show(
"isDescending([.true., .true., .true.])")
82 call disp%show(
"isDescending([complex ::])")
85 call disp%show(
"isDescending([(+1., -1.), (+2., -2.), (+3., -3.)])")
88 call disp%show(
"isDescending([(-1., +1.), (-2., +2.), (-3., +3.)])")
91 call disp%show(
"isDescending([(-1., +1.), (+2., -2.), (-3., +3.)])")
94 call disp%show(
"isDescending([(-1., +1.), (-1., +1.), (-1., +1.)])")
97 call disp%show(
"isDescending([(-1., +1.), (-1., -2.), (-1., +3.)])")
102 call disp%show(
"isDescending([real ::])")
105 call disp%show(
"isDescending([+1., +2., +3.])")
108 call disp%show(
"isDescending([-1., -2., -3.])")
111 call disp%show(
"isDescending([-1., +2., -3.])")
114 call disp%show(
"isDescending([-1., -1., -1.])")
124 call disp%show(
"isDescending([css_pdt('is'), css_pdt( 'sorted'), css_pdt('string')])")
127 call disp%show(
"isDescending([css_pdt('string'), css_pdt('is'), css_pdt('sorted')])")
130 call disp%show(
"isDescending([css_pdt('same string'), css_pdt('same '), css_pdt('same')])")
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
This module contains the derived types for generating allocatable containers of scalar,...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
This is the css_pdt parameterized type for generating instances of container of scalar of string obje...
Generate and return an object of type display_type.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example output ⛓
- Test:
- test_pm_arraySort
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.
-
If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
-
If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.
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.
- Copyright
- Computational Data Science Lab
- Author:
- Amir Shahmoradi, April 21, 2017, 3:54 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
Definition at line 1724 of file pm_arraySort.F90.