issorted(3f) - [M_sets] Report if A is sorted in ascending order or not.
Synopsis
Description
Options
Returns
Examples
Authors
License
issorted(A,setOrder)
Report if A is sorted in ascending order or not. A 1 (true) is returned when the elements of A are listed in ascending order and 0 (false) otherwise.
A input array to test
1 if input array A is sorted in ascending order, 0 otherwise
sample program:
program demo_issorted use M_sets, only: issorted character(len=*),parameter :: g=(*(g0,1x)) integer,allocatable :: A(:)Results:write(*,g) ISSORTED,Find the issorted elements of vector A. A = [10, -10, 0, 1, 2, 3, 3, 2, 1, -10] write(*,g) A=, A write(*,g) issorted(A) A = [-10, 10, 100, 201] write(*,g) A=, A write(*,g) issorted(A)
end program demo_issorted
> ISSORTED Find the issorted elements of vector A. > A= 10 -10 0 1 2 3 3 2 1 -10 > 0 > A= -10 10 100 201 > 1
John S. Urban, 2023-07-20
CC0-1.0
Nemo Release 3.1 | issorted (3) | February 23, 2025 |