Questions tagged [pdl]

PDL ("Perl Data Language") gives standard Perl the ability to compactly store and speedily manipulate the large N-dimensional data arrays which are the bread and butter of scientific computing.

PDL turns Perl in to a free, array-oriented, numerical language similar to (but, we believe, better than) such commerical packages as IDL and MatLab. One can write simple perl expressions to manipulate entire numerical arrays all at once. Simple interactive shells, pdl2 and perldl, are provided for use from the command line along with the PDL module for use in Perl scripts.

61 questions
2
votes
1 answer

"First steps with PDL" image created with Gnuplot differs from the one in PDL Book

I found an example from http://pdl.perl.org/?page=FirstSteps that is: pdl> use PDL::Graphics::Simple pdl> imag (sin(rvals(200,200)+1) I tried to run this example but unsuccessfully. As a consequence to that I tried to adjust the example that it…
zubenel
  • 300
  • 4
  • 10
2
votes
2 answers

Loading PDL matrix from tsv file with header does not work as expected

I have a tsv file foo.tsv with colnames: "a", "b", "c", "d". I want to read this file and load its content to PDL matrix. File foo.tsv looks like this: a b c d 1 6 7 4 2 7 6 10 3 8 5 6 4 9 4 8 5 10 3 7 I used this…
zubenel
  • 300
  • 4
  • 10
2
votes
1 answer

Has anyone managed to create plots with PDL using the PDL edition of Strawberry Perl 5.30.1.1 on Windows?

Has anyone managed to create plots with PDL (Perl Data Language) using the PDL edition of Strawberry Perl on Windows? I installed the PDL edition of Strawberry Perl 5.30.1.1 from http://strawberryperl.com/releases.html on Windows 10 (64 bits),…
Louis Strous
  • 942
  • 9
  • 15
2
votes
2 answers

Perl : cpan PDL install issue

I have Cygwin under win10 and I try to install PDL lib for Perl in order to use PDL::Matrix When making cpan install PDL I have make errors I do not manage to solve : make[3]: *** [Makefile:323: OpenGLQ.o] Error 1 make[2]: *** [Makefile:521:…
Alexglvr
  • 427
  • 5
  • 18
2
votes
1 answer

Perl Inline::C return pdl or 0 on failure

I am building a module which connects to a camera, takes a picture, and reads the data into a piddle. All of this takes place in an Inline::C command. Using the procedure in the PDL documentation I can create a pdl * and return it. However the…
Joel Berger
  • 20,180
  • 5
  • 49
  • 104
2
votes
2 answers

How can I check if a Perl variable is in PDL format (i.e. is a piddle)?

I'm using PDL. If I am given variable $foo that can be a hash reference, an array reference, a scalar, or a piddle (which can be empty or null), how can I tell if it's a piddle?
Zhang18
  • 4,800
  • 10
  • 50
  • 67
2
votes
2 answers

How to use threads to replace looping a subroutine in perl/pdl

I have a perfectly good perl subroutine written as part of a perl module. Without going into too many details, it takes a string and a short list as arguments (often taken from terminal) and spits out a value (right now, always a floating point, but…
Feynman
  • 51
  • 1
  • 7
2
votes
2 answers

Perl PDL not working as expected

I really don't understand PDL's input functions. Personally, I've been using the rcols feature to create pdls, as was recommended to me in various places around the web. I have an input file like this : 3 -4 -1 0 5 2 3 5 6 2 5 2 5 5 5 5 5…
leman
  • 33
  • 4
1
vote
1 answer

segmentation fault in pdl2 with some code from my .perldlrc that works OK directly from the pdl2 shell

combining Is there an equivalent to the perl debugger 'x' in pdl2 (or Devel::REPL)? and How can I list all variables that are in a given scope? I have created my perldlrc like use feature ':5.10'; use Data::Dumper; use PadWalker qw/peek_our…
Pablo Marin-Garcia
  • 4,151
  • 2
  • 32
  • 50
1
vote
1 answer

how to add a commented line in pdl2 shell

I am using pdl2, the interactive perl pdl shell, and I want to add comments in lines to document the next code line so I can review my interactive session later on. pdl> # this is a comment Can't exec "this": No such file or directory at…
Pablo Marin-Garcia
  • 4,151
  • 2
  • 32
  • 50
1
vote
1 answer

PDL/perldl mac weird permissions/malware errors

after a system update to Mac OS 10.15.4, when I try to execute perldl, I get popup messages that are unfamiliar, and when I google them, I get no results... That seems very odd. The first message is: “Gnu.bundle” cannot be opened because the…
user20412
  • 193
  • 7
1
vote
2 answers

Perl PDL : How to change an value in a matrix

I want to change a value in a PDL matrix : ex : my $matrix= pdl [[1,2,3],[4,5,6]]; $matrix->at(0,0)=0; But this is not working... Thank you for your help
Alexglvr
  • 427
  • 5
  • 18
1
vote
1 answer

How to avoid input modification in PDL subroutines

I would like to avoid the assignment operator .= to modify the user input from a subroutine. One way to avoid this is to perform a copy of the input inside the subroutine. Is this the best way to proceed? Are there other solutions? use PDL;use…
1
vote
0 answers

How to avoid error when multiplying an array with one element in PDL?

I've tried using PDL to multiply arrays in a faster way, but get an error with one-element piddles. The example code is use PDL::Core; use PDL::Primitive; my $m = [ [ 2 ] ]; pdl($m) x pdl($m); The error is: Undefined subroutine &PDL::mult called…
jinawee
  • 492
  • 5
  • 16
1
vote
2 answers

Perl PDL : points coordinates and matrix construction

I have a text file with points coordinates. X1 Y1 X2 Y2 X3 Y3 ... Xn Yn The idea is to build a matrix of this coordinates. I coded a first version that reads the X and Y values, push them into respectively @Xs and @Yx array, and then create the…
Alexglvr
  • 427
  • 5
  • 18