PDL справится с этим, как @ J.D. указывает.
use strict;
use warnings;
use PDL;
use PDL::LinearAlgebra::Trans;
use PDL::IO::Dumper;
my $m = pdl [[-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]];
my $new = mexp $m;
print sdump $new;
Результат:
{my($VAR1);
my($PDL_140600590505856) = (double(0.254389714179579,0.202972289234997,0.458048094091295,0.08458940315894629,0.0746039289026906,0.606102994157082,0.158888283526803,0.160403695685552,0.165021120118487,0.155733015860466,0.602527027489139,0.07671838765811791,0.08103970821403091,0.418083774202018,0.204015347133539,0.296855703714981)->reshape(4,4));
$VAR1 = $PDL_140600590505856;
}
Бит внутри функции double()
является матрицей результата.