Subject: intrinsics-maxloc-proposal, version 2

From: Guy Steele <[email-masked]>
Date: Wed, 20 May 92 18:03:47 EDT

Proposal for extension to MINLOC and MAXLOC for HPF

Guy L. Steele Jr.
Thinking Machines Corporation
Version of May 20, 1992

The MAXLOC and MINLOC instrinsics should have an optional DIM
argument.  If such an argument is present, then the shape of the
result equals the shape of the first argument with one dimension
(the one indicated by the DIM argument) deleted; it is as if a
series of one-dimensional MAXLOC or MINLOC operations were performed.

Example: If A has the value

[  0  -5   8  -3  ]
[  3   4  -1   2  ]
[  1   5   6  -4  ]

then	MINLOC(A, DIM=1) has the value [ 1, 1, 2, 3 ]
	MAXLOC(A, DIM=1) has the value [ 2, 3, 1, 2 ]
	MINLOC(A, DIM=2) has the value [ 2, 3, 4 ]
	MAXLOC(A, DIM=2) has the value [ 3, 2, 3 ].