On Sun, Jun 20, 2010 at 2:54 PM, Chris Marshall <[email protected]> wrote:
> Works for me with the latest git:
> PDL> use Storable;
>
>  PDL> use PDL::IO::Storable;
>
>  PDL> my $a = pdl(1984,325,1.4504,23.9576,200.4562,30456,-2.3451,22.0979);
>
>  PDL> my $row = ones(458)->dummy * $a;

The above should be 4587 instead of 458... 10 times bigger. Maybe that
was the issue?


>
>  PDL> my $i = ones(2889)->dummy->dummy * $row;
>
>  PDL> store($i,'pdl.dat')
>
>  PDL>  $j = retrieve('pdl.dat')
>
>  PDL> help 'vars'
>  PDL variables in package main::
>
>  Name         Type   Dimension       Flow  State          Mem
>  ----------------------------------------------------------------
>  $j           Double D [8,458,2889]         P           80.76Mb
>
>  PDL> p sum($i-$j)
>  0
>
>  PDL> quit
>
> I don't have PDL-2.4.6 to test at the moment.
>
> --Chris
>
> On 6/20/2010 3:32 PM, P Kishor wrote:
>>
>> 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 }
>>
>>
>>
>>
>>
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 9.0.829 / Virus Database: 271.1.1/2951 - Release Date: 06/20/10
>> 02:37:00
>>
>
>



-- 
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