Subject: | [PATCH] msyminv() returns only half of the result |
msyminv takes in one triangle of a symmetric matrix, and returns the
inverse ONLY IN THAT TRIANGLE. Thus if $m is a symmetric matrix
$m x $m->msyminv
does NOT equal the identity. The attached patch extends the triangle to
the whole matrix to make msyminv() a drop-in-replacement for minv() for
symmetric matrices. This issue and patch apply to both the Real and
Complex versions of msyminv()
Subject: | msyminv.patch |
--- LinearAlgebra.pm 2007-10-08 14:59:11.000000000 -0700
+++ LinearAlgebra.pm 2011-05-15 17:00:22.000000000 -0700
@@ -1287,6 +1287,7 @@
}
else{
$m->sytri($upper,$ipiv,$info);
+ $m = $m->t->tritosym($upper);
}
return wantarray ? ($m, $info) : $m;
}
@@ -1315,6 +1316,7 @@
}
else{
$m->csytri($upper,$ipiv,$info);
+ $m = $m->xchg(1,2)->tritosym($upper, 0);
}
return wantarray ? ($m, $info) : $m;
}