Hugh Sasse wrote:
> On Fri, 19 Sep 2008, Craig DeForest wrote:
>
>   
>> PDL::Complex was never fully implemented, in the sense of overloading all the
>> basic operators.  Hence many operations will "fall through" to the PDL
>> implementation that is under the hood.  PDL::Complex places the
>> (real,imaginary) component in the 0 dimension, which is why your 3x3
>> PDL::Complex object turns out to be a 2x3x3 PDL under the hood.
>>
>> To be fair, there is no non-surprising way to implement the "at" method for
>> PDL::Complex objects, because PDL::at returns a Perl scalar and Perl doesn't
>> implement a complex scalar type.
>>     
>
> Then it could return a reference.  PDLs are not native perl types as
> such, but we can cope with that.  Perl does have a Math::Complex
> type, and it conflicts with the present arrangement.  Maybe it came
> along later.
>
>   


One of the things I would like to see would be an extension to the PDL 
types to
include objects/refs/etc.  An example might be an array of elements, 
each element
is of type X, represented as the packed C structure.  For the Complex type,
this might be elements of size 16B containing two doubles.  This would 
allow at()
to return a perl scalar for this case too.

This could take advantage of hierarchical clumping to simplify operations
depending on the view of the data.  For example, a double piddle with
dims 2x3x3 might be considered equivalent to a (2xdouble) piddle with
dims 3x3...

--Chris

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

Reply via email to