Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: mutliplying each element of a list by the same number

by moklevat (Priest)
on May 15, 2008 at 14:34 UTC ( #686737=note: print w/ replies, xml ) Need Help??


in reply to mutliplying each element of a list by the same number

PDL makes this operation trivial.

#!/usr/bin/perl use strict; use warnings; use PDL; my $max = $ARGV[0]; my $ratio_list = pdl (0..$max); my $minutes_list = 10 * $ratio_list;


Comment on Re: mutliplying each element of a list by the same number
Download Code
Re^2: mutliplying each element of a list by the same number
by wade (Pilgrim) on May 15, 2008 at 17:52 UTC

    Kind-of seems to me like pounding a thumbtack with a sledgehammer. Of course, TIMTOWTDI

    --
    Wade
      Sure, but steph_bow asked for simple. It was simple to write and it's simple to read and it DWIM.
        yeah, but it's not necessarily simple to come up with. Sometimes it's actually more efficient (in terms of time, money, frustration or whatever) to work harder and not smarter.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://686737]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2014-08-23 12:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (173 votes), past polls