On 2015-03-05 at 09:58:49 -0600, PDL users list wrote:
> I just learnt from the message below about DDP, but when I run
>    $  perl -MDDP -MPDL -e '$a=pdl(1); p $a;'
> I get
>   PDL  {
>       public methods (368) : abs, acos,...
>       private methods (43) : __ANON__, _badvalue_int0,...
>       internals: 39438384
>   }
> instead of
>   PDL {
>            Data     : 1
>            Type     : double
>            Shape    : Empty[0]
>            Nelem    : 1
>            Min      : 1
>            Max      : 1
>            Badflag  : No
>            Has Bads : No
>         },
> as below. Is this related to the configuration of DDP?

Yes! That's because you'll need to have
<https://metacpan.org/pod/Data::Printer::Filter::PDL> installed.

The file has some examples of how to configure the `.dataprinter` file
and your `.perldlrc`.

All the work was Joel Berger's and I just made it into a CPAN module. If
we want to bring it into PDL itself, I can start a thread on pdl-devel.

Speaking of mailing lists, the configuration of this list is odd. The original 
authors
of the e-mails don't show up in the From: header:
<http://thread.gmane.org/gmane.comp.lang.perl.pdl.general/8634>.

Regards,
- Zaki Mughal

> Regards,
> Luis
> 
> 
> On Thu, Mar 05, 2015 at 12:46:09AM -0600, PDL users list wrote:
> > Hello all,
> > 
> > I was trying something out and wanted to create a new piddle from a
> > scalar that matched the dimensions of another piddle, so I tried the
> > following:
> > 
> >     use PDL;
> >     my $other = zeros(3,2);
> >     my $cases = {
> >         'scalar' => 1,      # Just a Perl scalar
> >         'pdl'    => pdl(1), # a 0-dim piddle
> >     };
> >     
> >     $_ += $other  for values %$cases;
> >     
> >     
> >     use DDP; p $cases;
> > 
> > and I got the following output:
> > 
> >     \ {
> >         pdl      PDL {
> >             Data     : 1
> >             Type     : double
> >             Shape    : Empty[0]
> >             Nelem    : 1
> >             Min      : 1
> >             Max      : 1
> >             Badflag  : No
> >             Has Bads : No
> >         },
> >         scalar   PDL {
> >             Data     : [
> >                         [1 1 1]
> >                         [1 1 1]
> >                        ]
> >             Type     : double
> >             Shape    : [3 2]
> >             Nelem    : 6
> >             Min      : 1
> >             Max      : 1
> >             Badflag  : No
> >             Has Bads : No
> >         }
> >     }
> > 
> > I think I understand the reasoning behind this behaviour, but what I
> > would like to know is if there is a way to be able to get the same
> > output as in the scalar case when using the 0-dim piddle `pdl(1)` ( or
> > even `pdl([ 1 ])` ).
> > 
> > Regards,
> > - Zaki Mughal
> > 
> > ------------------------------------------------------------------------------
> > Dive into the World of Parallel Programming The Go Parallel Website, 
> > sponsored
> > by Intel and developed in partnership with Slashdot Media, is your hub for 
> > all
> > things parallel software development, from weekly thought leadership blogs 
> > to
> > news, videos, case studies, tutorials and more. Take a look and join the 
> > conversation now. http://goparallel.sourceforge.net/
> > _______________________________________________
> > pdl-general mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/pdl-general
> > 
> 
> -- 
> 
>                                                                   o
> W. Luis Mochán,                      | tel:(52)(777)329-1734     /<(*)
> Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388     `>/   /\
> Apdo. Postal 48-3, 62251             |                           (*)/\/  \
> Cuernavaca, Morelos, México          | [email protected]   /\_/\__/
> GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16  C2DF 5F0A C52B 791E B9EB
> 
> 
> 
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the 
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> pdl-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pdl-general

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to