summaryrefslogtreecommitdiff
path: root/lib/matrix/lup_decomposition.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-11-29 17:29:21 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2019-11-30 08:00:40 +0900
commit0c59bfae0a3a9f5a3420a1eac42753480d8d95f7 (patch)
treeab94b945b5b3e7612b539e3884cc2ee283dc102d /lib/matrix/lup_decomposition.rb
parent0950ef9a9a8e14dce44c36cf1ecaad187716a059 (diff)
Also replace E2MM to standard exception class
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2699
Diffstat (limited to 'lib/matrix/lup_decomposition.rb')
-rw-r--r--lib/matrix/lup_decomposition.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/matrix/lup_decomposition.rb b/lib/matrix/lup_decomposition.rb
index c001770a12..e37def75f6 100644
--- a/lib/matrix/lup_decomposition.rb
+++ b/lib/matrix/lup_decomposition.rb
@@ -78,7 +78,7 @@ class Matrix
def det
if (@row_count != @column_count)
- Matrix.Raise Matrix::ErrDimensionMismatch
+ raise Matrix::ErrDimensionMismatch
end
d = @pivot_sign
@column_count.times do |j|
@@ -94,11 +94,11 @@ class Matrix
def solve b
if (singular?)
- Matrix.Raise Matrix::ErrNotRegular, "Matrix is singular."
+ raise Matrix::ErrNotRegular, "Matrix is singular."
end
if b.is_a? Matrix
if (b.row_count != @row_count)
- Matrix.Raise Matrix::ErrDimensionMismatch
+ raise Matrix::ErrDimensionMismatch
end
# Copy right hand side with pivoting
@@ -128,7 +128,7 @@ class Matrix
else # same algorithm, specialized for simpler case of a vector
b = convert_to_array(b)
if (b.size != @row_count)
- Matrix.Raise Matrix::ErrDimensionMismatch
+ raise Matrix::ErrDimensionMismatch
end
# Copy right hand side with pivoting