在perl中对矩阵求幂
我正在寻找一个使用 perl 对矩阵求幂的函数。我搜索了 CPAN 但似乎找不到合适的东西。有谁知道合适的包或简单的功能?
例如,对于以下矩阵 ($m):
$m = [[-1.85294,0.36417,1.34865,0.14012],
[0.13385,-0.70885,0.16502,0.40998],
[0.48588,0.16174,-0.77471,0.12709],
[0.13424,1.06859,0.33797,-1.54081]];
e^m ~=
0.25438971 0.2029723 0.4580481 0.08458940
0.07460393 0.6061030 0.1588883 0.16040370
0.16502112 0.1557330 0.6025270 0.07671839
0.08103971 0.4180838 0.2040153 0.29685570
I'm looking for a function to exponentiate a matrix using perl. I've searched CPAN but can't seem to find anything suitable. Does anyone know of a suitable package, or easy function?
For example, for the following matrix ($m):
$m = [[-1.85294,0.36417,1.34865,0.14012],
[0.13385,-0.70885,0.16502,0.40998],
[0.48588,0.16174,-0.77471,0.12709],
[0.13424,1.06859,0.33797,-1.54081]];
e^m ~=
0.25438971 0.2029723 0.4580481 0.08458940
0.07460393 0.6061030 0.1588883 0.16040370
0.16502112 0.1557330 0.6025270 0.07671839
0.08103971 0.4180838 0.2040153 0.29685570
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如 @JD 指出的,PDL 将处理这个问题。
结果:
double()
函数内的位是结果矩阵。PDL will handle this, as @J.D. points out.
Result:
The bit inside the
double()
function is the result matrix.