Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Processing values of a piddle (PDL) speedup using 'at' vs. 'index'

by kevbot (Vicar)
on Jul 15, 2012 at 06:13 UTC ( [id://981884]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $val = $my_pdl->index($i);
    
  2. or download this
    my $val = $my_pdl->at($i);
    
  3. or download this
    #!/usr/bin/env perl
    
    ...
    
        return;
    }
    
  4. or download this
                  Rate  pdl_values perl_values
    pdl_values  16.8/s          --        -74%
    perl_values 64.1/s        282%          --
    
  5. or download this
    #!/usr/bin/env perl
    
    ...
        return;
    }
    
  6. or download this
                  Rate  pdl_values perl_values
    pdl_values  1.51/s          --        -97%
    perl_values 52.1/s       3347%          --
    
  7. or download this
    pdl> $a = xvals(5)*2; # $a is a PDL
    pdl> $a4 = $a->at(4); # $a4 is a perl scalar
    
  8. or download this
    pdl> @a = $a->list; pdl> for($a->list) { print $_, - ; }
    0-2-4-6-8-
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://981884]
Approved by moritz
Front-paged by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 21:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found