So, with the help of the syntax that Daniel suggested, and
PDL::IO::Storable (based on an earlier suggestion from Christian
Soeller) I made the following piddle

    my $a = pdl(1984,325,1.4504,23.9576,200.4562,30456,-2.3451,22.0979);
    my $row = ones(4587)->dummy * $a;
    my $i = ones(2889)->dummy->dummy * $row;
    store $i, 'pdl.dat';

The above resulted in a nice 848_118_001 (848 MB) file. Then I tried
to retrieve it

    my $j = retrieve 'pdl.dat';
    print $j->info . "\n";

I got the following output

        PDL: Double D [8,4587,2889]
        
But I also got the following errors --

Error: File Core.pm; Line 936: Use of uninitialized value $dim in
numeric lt (<) <DATA> line 206.

Error: File Core.pm; Line 942: Use of uninitialized value $dim in
repeat (x) <DATA> line 206.

Error: File Core.pm; Line 943: Use of uninitialized value $dim in
subtraction (-) <DATA> line 206.

Error: File Core.pm; Line 939: Use of uninitialized value $dim in
numeric lt (<) <DATA> line 206.


The said lines in Core.pm being

934 sub PDL::dummy($$;$) {
935    my ($pdl,$dim,$size) = @_;
936    $dim = $pdl->getndims+1+$dim if $dim < 0;
937    $size = 1 unless defined($size);
938
939    barf("For safety, <pos> < -(dims+1) forbidden in dummy.  min="
940      . -($pdl->getndims+1).", pos=". ($dim-1-$pdl->getndims) ) if($dim<0);
941
942    my($s) = ',' x ( ($dim > $pdl->getndims) ? ($pdl->getndims) : ($dim) );
943    $s .= '*,' x ( $dim-$pdl->getndims-1 );
944    $s .= "*$size";
945
946    $pdl->slice($s);
947 }



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to