next up previous contents
Next: Further Example of Array Up: HPF Intrinsics and Library Previous: Array Sorting Functions

 

Example of Array Sorting Functions

Given,

  A = (/2,3,7,4,9,1,5,5,0,5,5/)

then GRADE_DOWN(A) is the 2D ( tex2html_wrap_inline28947 ) array:

  (/5,3,7,8,10,11,4,2,1,6,9/)

and

GRADE_UP(A,DIM=1) is the 1D array:

  (/9,6,1,2,4,7,8,10,11,3,5/)

Note how the multiple values of 5 are sorted.

The result when not using DIM= has shape

  (/ SIZE(SHAPE(A)),PRODUCT(SHAPE(A))/)

Otherwise the shape is the same as A.


next up previous contents
Next: Further Example of Array Up: HPF Intrinsics and Library Previous: Array Sorting Functions

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.