See mpow. On the plus side, it allows strange but probably amazing additional things -- fractional powers, or (reading source) power being not scalar but another matrix. On the minus side, see this comment. For familiar integer powers, it does O(n) loop (line 544). And it's buggy: if power is 0, same matrix is returned (as if power was 1). To fix, replace line 539 with $ret = identity($m); and start loop (line 544) from 0. And use PDL::MatrixOps qw/identity/; somewhere. But formally, yes, such function does exist.
In reply to Re: In PDL, how to raise a matrix $m to a power $v
by vr
in thread In PDL, how to raise a matrix $m to a power $v
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |