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

Home » Public Forums » archive » Re: Need efficient routine to calculate max of two arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Need efficient routine to calculate max of two arrays [message #3402] Wed, 25 January 1995 17:07 Go to previous message
mfishler is currently offline  mfishler
Messages: 5
Registered: October 1994
Junior Member
In article <3g3p8i$1o6@cobra.aer.com>, gallery@aer.com (William O. Gallery) writes:
> Here is the problem:
>
> There are two arrays: a and b of equal length, I want to calculate
> an array c of the same length so that:
> c(i) = min(a(i),b(i))
>
> For efficiency, I want to use vectors and not a do loop.
>
> Any suggestions? This would seem to be a common enough problem,
>

For the operation stated, c = a < b will do the trick.
For max instead of min, use c = a > b .

Good luck!

==Matthew

--
+---------+----------------------------------------+-------- --------------+
| (_|_ | M a t t h e w G. F i s h l e r | |
| ___ | The Johns Hopkins School of Medicine | "It is a miracle |
| (_) ) | 720 Rutland Ave --- 701 Traylor Bldg | that curiosity |
| _ | Baltimore, MD 21205 | survives formal |
| (_ | tel:(410)955-0077 fax:(410)955-0549 | education." |
| (_ | e-mail: mfishler@bme.jhu.edu | --Albert Einstein |
+---------+----------------------------------------+-------- --------------+
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: emacs and IDL (typos in URLs)
Next Topic: floating pt. sliders....

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

Current Time: Fri Oct 10 15:22:45 PDT 2025

Total time taken to generate the page: 0.87898 seconds