Minimum/Maximum over a certain dimension [message #4015] |
Thu, 20 April 1995 00:00  |
smd
Messages: 4 Registered: April 1995
|
Junior Member |
|
|
Hi,
I use IDL v3.6.1a on a PC. I would like to find out if there is
a vectorized (fast) way of computing the minimum/maximum of an
array along a given dimension.
To explain, if A is a bytarr of size (2,30,40) and I wish
to compute the minimum along the first dimension, the result
should be a bytarr of size (30,40) in which each element is
the pointwise minimum of A(0,*,*) and A(1,*,*).
Such a feature is available for the TOTAL() function, but
is not available for MIN() or MAX(). Does anyone know how
to do this operation without using a FOR loop that goes
over all the elements. In the above example, the FOR loop
would have to extend over 30*40 = 1200 elements. I have
to deal with images that are of size 720 x 480 and this
takes enough computation time.
Thanks
Sandeep Dalal
------------------------------------------------------------
Philips Laboratories
345, Scarborough Road,
Briarcliff Manor, NY 10510
Email: smd@philabs.philips.com
------------------------------------------------------------
|
|
|
Re:Minimum/Maximum over a certain dimension [message #4073 is a reply to message #4015] |
Tue, 25 April 1995 00:00  |
dudley
Messages: 8 Registered: August 1993
|
Junior Member |
|
|
smd@philabs.philips.com writes:
> To explain, if A is a bytarr of size (2,30,40) and I wish
> to compute the minimum along the first dimension, the result
> should be a bytarr of size (30,40) in which each element is
> the pointwise minimum of A(0,*,*) and A(1,*,*).
The above can be done by:
c=A(0,*,*)<A(1,*,*)
--
John Wesley Dudley II,Ph.D. dudley@shell.com
Sr. Research Physicist !{uupsi}!shell!dudley
Shell Exploration & Production Co. (713)245-7927
|
|
|