go ahead... be a heretic | |
PerlMonks |
Re: PDL & Math::MatrixRealby Fletch (Bishop) |
on Nov 05, 2021 at 16:27 UTC ( [id://11138476]=note: print w/replies, xml ) | Need Help?? |
Just because both classes are a representation of a matrix doesn't mean any method will work on it; you can't ask a cat to bark or a dog to meow. Well, you can. Just not going to do anything as you've discovered. Unless you've got a reason for switching back and forth you're going to need to pick a representation and use that one; sounds like for your particular application between your two choices Math::MatrixReal may support more of the operations you need natively. Otherwise your choices are to implement what you need using PDL (I'm not finding easy hits looking for "pdl matrix diagonalize"), or convert from the one to the other, get the diagonal, then convert back. The first option's likely to be more efficient, but if you only need to go back and forth once or twice it may be worth the performance hit to not have to bother reimplementing things.
The cake is a lie.
In Section
Seekers of Perl Wisdom
|
|