logo       

Re: finding position of a value in a piddle: msg#00015

Subject: Re: finding position of a value in a piddle
Hi all:  There is also:  maximum_ind.

--Doug

dhunt@xxxxxxxx
Software Engineer III
UCAR - COSMIC, Tel. (303) 497-2611

On Tue, 11 Dec 2007, Jarle Brinchmann wrote:

Just to add to Rahman's answer, for some specific situations there might be faster options than which or where (see help where - I often find that where is the more efficient but it depends on what you need). For instance if you require the maximum/minimum and the location then the function you want is probably minmaximum (yes, the name isn't the best).

It does get you the maximum and minimum values as well as the indices. Since this is all done in one pass it will require 1/2 (roughly) the time of a first call to max and then a call to which. I say roughly because there is a tad more overhead in minmaximum than in max.

                                        Cheers,
                                                Jarle.



On 11 Dec 2007, at 00:21, <rhann@xxxxxxxxxxxx> wrote:

Hi,

I have searched the documetation and came up empty on this one. Is there a PDL function that will return the position of a value within a piddle ? For example: I search for the maximum value within a one-dimensional vector:

$x is a 1-D piddle

$max = max($x);

$max will contain the largest value from $x. Is there a way to find out what it's position is within $x without copying the PDL vector to a perl list and looping ?

Rai

_______________________________________________
Perldl mailing list
Perldl@xxxxxxxxxxxxxxx
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl


_______________________________________________
Perldl mailing list
Perldl@xxxxxxxxxxxxxxx
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe