Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


  >  Docs Center  >  Libraries  >  JBIU  >  IS_SORTED

IS_SORTED

IS_SORTED

Name


    IS_SORTED

Purpose


    Checks whether an array is already sorted.

Category


    Misc

Calling Sequence


    Result = IS_SORTED(Array)

Inputs


    Array: An array to check.

Example


    IDL> print, is_sorted([0,10,15,25])
      1
    IDL> print, is_sorted([0,15,10,25])
      0

Modification History


    Written by: Jeremy Bailin
    20 May 2011 Initial writing
unction is_sorted, array
eturn, total(abs(sort(array) - lindgen(n_elements(array))),/int) eq 0
nd



© 2018 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us