Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Fast data structure..!!!

by moklevat (Priest)
on Apr 15, 2008 at 15:54 UTC ( #680548=note: print w/ replies, xml ) Need Help??

in reply to Fast data structure..!!!

Depending on the type of data you are working with, you might benefit from using PDL. For numerical tasks I have found that it can be very fast and memory efficient.

Update: As requested below, let's say you want a 2D array. You can create a "piddle" (the PDL data structure) with a sequence of arbitraty length and two dimensions as simply as:

#!/usr/bin/perl use strict; use warnings; use PDL; my $sequence = pdl [0..20],[0..20]; print "$sequence\n"; ***Outputs*** [ [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20] [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20] ]

Comment on Re: Fast data structure..!!!
Download Code
Replies are listed 'Best First'.
Re^2: Fast data structure..!!!
by MimisIVI (Acolyte) on Apr 15, 2008 at 16:19 UTC
    Hi moklevat,

    I dont know anything about PDL..

    Can you give a simple example how can use the numerical task with the PDL??

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (18)
As of 2015-11-30 15:23 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (774 votes), past polls