I found this night a curious behavior when creating pdl's from arrays
of complex pdl's. If the array has a single element, the created pdl
is complex, but if the array has more than one element, the result is
a real pdl. I was aware of the later behavior, and so was surprised by
the limit case of only one element.

pdl> use PDL::Complex
pdl> $a=sequence(2,2)->complex
pdl> push @a, $a #make an array with one complex pdl
pdl> p pdl(@a) #make a pdl out of it
[0 +1i  2 +3i] #the result is the original complex pdl
pdl> push @a, $a #now the array has two complex pdl's
pdl> p pdl(@a) #the result is a real pdl, not a complex one
[
 [
  [0 1]
  [2 3]
 ]
 [
  [0 1]
  [2 3]
 ]
]


Best regards,

Luis


-- 

                                                                  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          | moc...@fis.unam.mx   /\_/\__/
GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16  C2DF 5F0A C52B 791E B9EB




_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel

Reply via email to