When I use object of type PDL::Complex, $obj->xchg
(1,2) return object of type PDL::Complex but $obj->xchg
(0,1) no (PDL).
Logged In: NO
Sorry, it's a mistake
You can remove it...
Logged In: YES
This is a wart, not a bug. The PDL::Complex object is a
loose ("convenience") subclass of PDL, so you still have
acess to the 0th dim just as you would with a raw PDL. But
exchanging the 0th dim with some other invalidates the
subclass, because (in your example) now the 1st dim runs
over the components of the compex, and the 0th runs over
something else entirely. But the PDL::Complex subclass
needs the 0th dimension to run over the components.
If you really mean to do that, you can force it back to
PDL::Complex with bless(): $b =
Hmmm... in my other response, I argued that the
complained-about behavior would be reasonable, but I can't
seem to reproduce it. xchg() always returns a PDL::Complex,
as I would expect [even though it breaks the class as
I'm closing this bug out, but if anyone wants to make
PDL::Complex more airtight, please feel free. Right now,
it's an expert-friendly convenience class. But there are no
handrails or trigger-guards -- it's sort of dangerous to the
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.