summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/matrix.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb
index 7a20fae520..7569d68607 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -718,9 +718,10 @@ class Matrix
#
def symmetric?
Matrix.Raise ErrDimensionMismatch unless square?
- each_with_index(:strict_upper).all? do |e, row, col|
- e == rows[col][row]
+ each_with_index(:strict_upper) do |e, row, col|
+ return false if e != rows[col][row]
end
+ true
end
#