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

Home » Public Forums » archive » Numerical Recipes Article
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: Numerical Recipes Article [message #10306 is a reply to message #10273] Fri, 07 November 1997 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Paul E Howland wrote:
>
> Wayne Landsman wrote:
>
> As both a Mathematica and IDL user, I too was interested to read this
> article. The principal reason for the IDL code "clearly winning" lies
> in the way they have written their code. A better Mathematica example
> would have been:
>
> Reverse[#]&/@Select[Transpose[{vels,mags}], (100<#[[1]]<=200)&]
> answer=%[[Ceiling[Length[%]/4]]][[1]]
>
> which performs the sort and select without even having to explicitly
> call the Sort routine. I would argue that this is not much more
> complicated than the IDL example:
>
> temp=mags(where(vels le 200. and vels gt 100., n))
> answer=temp((sort(temp))(ceil(n/4)))

You'll have to pardon me, but I'm not a Mathematica user, and the
code here looks like it was scraped off the walls of some Egyptian
temple. If you were to show the IDL code to a programmer not familiar
with IDL, he/she could probably figure out what it's doing. Show
the Mathematica code to a programmer not familiar with Mathematica
and he'll probably think your type-writer broke.

There's often a trade-off between elegance/simplicity and
functionality. Is Mathematica's sorting capabilities that much more
flexible and powerful to justify such strange syntax?

Dave
--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Read color table in Win95 PV-WAVE?
Next Topic: Accessing other widgets.

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

Current Time: Fri Oct 10 04:11:12 PDT 2025

Total time taken to generate the page: 0.16484 seconds