in reply to In PDL, how to raise a matrix $m to a power $v
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: In PDL, how to raise a matrix $m to a power $v
by etj (Priest) on May 02, 2022 at 18:31 UTC |