Help Files: Fortran77: Sorting Memory





     HELP                      Sep. 15, 1984           F77/SORT_MEMORY



                         Sorting Values in Memory

     Vectors and arrays may be sorted using the UNIX qsort() procedure
     or procedures in the IMSL and NAG libraries.

     The UNIX qsort() procedure is designed to sort a vector.  It  can
     also  be  used  to sort an arrays by column.  The vector or array
     can contain reals, double precision values, integers, or  charac-
     ter strings.  See "man 3f qsort" for more details.

     NAG section M01 contains  20  subroutines  for  sorting  vectors,
     pointers  to  vectors,  arrays,  etc.  IMSL chapter V contains 14
     subroutines for sorting.  Although there is overlap  between  the
     IMSL  and NAG subroutines, there are also subroutines in each not
     in the other.  While the NAG or IMSL libraries are  available  or
     many systems, they are not part of the standard distribution; see
     your system administrator to find out if they are on your system.

     To sort a vector vec of length lenvec of single  precision  reals
     in ascending order, you can use IMSL's VSRTA:

             CALL VSRTA( VEC, LENVEC )

     For double precision vectors, use either IMSL's VSRTAD:

             CALL VRSTAD( VEC, LENVEC )

     or NAG's M01ANF:

             IFAIL = 0
             CALL M01ANF( VEC, 1, LENVEC, IFAIL )

     For more information, see the NAG and IMSL manuals.


Comments to decf@euler.berkeley.edu
© 1998 UC Regents