changeset 25224:1f1aef87e136

issymmetric.m: Fix calculation of skew matrices (bug in 0f98040552de). * issymmetric.m: Reshape comparison matrix into column vector before using any().
author Rik <rik@octave.org>
date Wed, 11 Apr 2018 21:50:38 -0700
parents 0f98040552de
children 114ad8f22ee6
files scripts/linear-algebra/issymmetric.m
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/linear-algebra/issymmetric.m	Wed Apr 04 13:28:12 2018 +0200
+++ b/scripts/linear-algebra/issymmetric.m	Wed Apr 11 21:50:38 2018 -0700
@@ -81,7 +81,7 @@
   if (strcmp (skewopt, "nonskew"))
     if (tol == 0)
       ## check for exact symmetry
-      retval = ! any (A != A.');
+      retval = ! any ((A != A.')(:));
     else
       norm_x = norm (A, Inf);
       retval = norm_x == 0 || norm (A - A.', Inf) / norm_x <= tol;
@@ -89,7 +89,7 @@
   else
     ## skew symmetry
     if (tol == 0)
-      retval = ! any (A != -A.');
+      retval = ! any ((A != -A.')(:));
     else
       norm_x = norm (A, Inf);
       retval = norm_x == 0 || norm (A + A.', Inf) / norm_x <= tol;