M107: Sort Rows of a Matrix

Author(s): F. Carminati Library: KERNLIB
Submitter: Submitted: 09.02.1989
Language: Fortran Revised:

SORTR re-arranges the row order of a matrix in such a way that the elements of a selected column are either in increasing or decreasing order as described. When these elements are equal, the rows are kept in their original order.

Structure:

SUBROUTINE subprogram
User Entry Names: SORTR, SORTI, SORTD
External References: VECMAN, USWOP (not on all machines)

Usage:

For tex2html_wrap_inline75 (type INTEGER), tex2html_wrap_inline77 (type REAL), tex2html_wrap_inline79 (type DOUBLE PRECISION),

    CALL SORTt(MX,NC,NR,NCS)
performs an ordering operation on the matrix MX of type t, dimensioned (NC,NR), using the NCS-th element of each row as ordering criterion.

The matrix MX is stored by rows, the first element of a row following immediately after the last element of the preceding row.

Obviously, tex2html_wrap_inline81 is a condition. If this is not met or if tex2html_wrap_inline83 , SORTX will do nothing.

If tex2html_wrap_inline85 , the subroutine re-orders the rows of MX in such a way that the NCS-th element of each row is greater than or equal to the NCS-th element of the preceding row. If tex2html_wrap_inline87 , the rows of MX are re-ordered in such a way that the NCS-th element of each row is smaller than or equal to the NCS-th element of the preceding row.
tex2html_wrap_inline89


Michel Goossens Wed Jun 5 07:04:43 METDST 1996