in reply to In PDL, how to raise a matrix $m to a power $v
Looks like there is no such function. To clarify, we want, e.g., matrix
0 1 2 3
when squared, to become
2 3 6 11
Searching CPAN, (link that talexb provided), Math::MatrixReal can do it, but inefficiently -- O(n) rather than O(log n). And it's definitely not PDL.
Indeed, as you say, very simple and reasonably efficient function can be written, utilizing exponentiation by squaring, maybe peeking at how numpy does it, but, of course, it's so simple, that the latter may not be necessary :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: In PDL, how to raise a matrix $m to a power $v
by talexb (Chancellor) on Feb 02, 2019 at 04:10 UTC | |
|
Re^2: In PDL, how to raise a matrix $m to a power $v
by pryrt (Abbot) on Feb 02, 2019 at 00:22 UTC | |
by syphilis (Archbishop) on Feb 02, 2019 at 00:34 UTC | |
by vr (Curate) on Feb 02, 2019 at 01:04 UTC | |
by pryrt (Abbot) on Feb 02, 2019 at 17:04 UTC | |
by bliako (Abbot) on Feb 03, 2019 at 12:53 UTC | |
by vr (Curate) on Feb 02, 2019 at 17:57 UTC | |
by pryrt (Abbot) on Feb 02, 2019 at 18:47 UTC | |
by syphilis (Archbishop) on Feb 02, 2019 at 01:54 UTC |