aboutsummaryrefslogtreecommitdiffstats
path: root/lib/matrix.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/matrix.rb')
-rw-r--r--lib/matrix.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb
index 6227c435bf..f9c379509d 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -241,7 +241,8 @@ class Matrix
# => Matrix[[0, 0, 0], [0, 0, 0]]
#
def Matrix.empty(row_size = 0, column_size = 0)
- Matrix.Raise ErrDimensionMismatch if column_size != 0 && row_size != 0
+ Matrix.Raise ArgumentError, "One size must be 0" if column_size != 0 && row_size != 0
+ Matrix.Raise ArgumentError, "Negative size" if column_size < 0 || row_size < 0
new([[]]*row_size, column_size)
end