comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: max/min over only one dimension?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: max/min over only one dimension? [message #13205] Fri, 23 October 1998 00:00
Kevin Ivory is currently offline  Kevin Ivory
Messages: 71
Registered: January 1997
Member
Arel Weisberg wrote:
> Is it possible in IDL to find the maximum in each row of a 2-D array
> without a for loop?
>
> More generally is it possible to find extema in only one dimension of a N
> dimensional array without for loops?

I'll just cite a post to this newsgroup by Craig Markwardt on 18 Mar 1998:

> I have also had the need for totalling over selective dimensions
> (sometimes more than one dimension), and also MIN/MAX.
>
> Check out my IDL web page for CMAPPLY(), which can apply quite a
> number of operations to selected dimensions of an array. You can do
> this to more than one dimension at a time using a *list* of dimensions
> (similar to the DIMENSIONS parameter to MAKE_ARRAY or to REFORM).
>
> http://astrog.physics.wisc.edu/~craigm/idl/idl.html
>
> CMAPPLY supports more than just addition; it does:
>
> '+' addition '*' multiplication
> 'AND' logical AND 'OR' logical OR
> 'MAX' maximum 'MIN' minimum
>
> Where possible I avoid loops to improve performance, but your mileage
> may vary depending on the detailed use. [ For example, for small
> arrays, your own loop may be faster ].
>
> Craig
>
> --
> ------------------------------------------------------------ --------------
> Craig B. Markwardt, Ph.D. EMAIL: craigmnet@astrog.physics.wisc.edu
> Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
> ------------------------------------------------------------ --------------

--
Kevin Ivory Tel: +49 5556 979 434
Max-Planck-Institut fuer Aeronomie Fax: +49 5556 979 240
Max-Planck-Str. 2 mailto:Kevin.Ivory@linmpi.mpg.de
D-37191 Katlenburg-Lindau, GERMANY http://www.gwdg.de/~kivory2/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: scale3
Next Topic: Re: Temporary variables still checked out ...

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:51:02 PDT 2025

Total time taken to generate the page: 0.00537 seconds