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

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
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2014-09-22 19:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls