C Library Functions  - issorted (3)

NAME

issorted(3f) - [M_sets] Report if A is sorted in ascending order or not.

CONTENTS

Synopsis
Description
Options
Returns
Examples
Authors
License

SYNOPSIS

issorted(A,setOrder)

DESCRIPTION

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.

OPTIONS

A input array to test

RETURNS

1 if input array A is sorted in ascending order, 0 otherwise

EXAMPLES

sample program:

   program demo_issorted
   use M_sets, only: issorted
   character(len=*),parameter :: g=’(*(g0,1x))’
   integer,allocatable        :: A(:)

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

Results:

 > 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

AUTHORS

John S. Urban, 2023-07-20

LICENSE

CC0-1.0


Nemo Release 3.1 issorted (3) February 23, 2025
Generated by manServer 1.08 from c43404d3-cdac-4068-9467-7c1573367b16 using man macros.