1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/matrix.rb: Fix docs. Patched by Ben Woodall. [GH-726]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ayumin 2014-09-24 22:54:10 +00:00
parent ba63472a2f
commit 1ddf81134b
2 changed files with 16 additions and 12 deletions

View file

@ -1,3 +1,7 @@
Thu Sep 25 07:51:07 2014 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
* lib/matrix.rb: Fix docs. Patched by Ben Woodall. [GH-726]
Wed Sep 24 19:04:04 2014 Martin Duerst <duerst@it.aoyama.ac.jp> Wed Sep 24 19:04:04 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
* enc/unicode/data: New directory for downloaded Unicode * enc/unicode/data: New directory for downloaded Unicode

View file

@ -641,7 +641,7 @@ class Matrix
#++ #++
# #
# Returns +true+ is this is a diagonal matrix. # Returns +true+ if this is a diagonal matrix.
# Raises an error if matrix is not square. # Raises an error if matrix is not square.
# #
def diagonal? def diagonal?
@ -658,7 +658,7 @@ class Matrix
end end
# #
# Returns +true+ is this is an hermitian matrix. # Returns +true+ if this is an hermitian matrix.
# Raises an error if matrix is not square. # Raises an error if matrix is not square.
# #
def hermitian? def hermitian?
@ -669,14 +669,14 @@ class Matrix
end end
# #
# Returns +true+ is this is a lower triangular matrix. # Returns +true+ if this is a lower triangular matrix.
# #
def lower_triangular? def lower_triangular?
each(:strict_upper).all?(&:zero?) each(:strict_upper).all?(&:zero?)
end end
# #
# Returns +true+ is this is a normal matrix. # Returns +true+ if this is a normal matrix.
# Raises an error if matrix is not square. # Raises an error if matrix is not square.
# #
def normal? def normal?
@ -694,7 +694,7 @@ class Matrix
end end
# #
# Returns +true+ is this is an orthogonal matrix # Returns +true+ if this is an orthogonal matrix
# Raises an error if matrix is not square. # Raises an error if matrix is not square.
# #
def orthogonal? def orthogonal?
@ -712,7 +712,7 @@ class Matrix
end end
# #
# Returns +true+ is this is a permutation matrix # Returns +true+ if this is a permutation matrix
# Raises an error if matrix is not square. # Raises an error if matrix is not square.
# #
def permutation? def permutation?
@ -748,21 +748,21 @@ class Matrix
end end
# #
# Returns +true+ is this is a singular matrix. # Returns +true+ if this is a singular matrix.
# #
def singular? def singular?
determinant == 0 determinant == 0
end end
# #
# Returns +true+ is this is a square matrix. # Returns +true+ if this is a square matrix.
# #
def square? def square?
column_count == row_count column_count == row_count
end end
# #
# Returns +true+ is this is a symmetric matrix. # Returns +true+ if this is a symmetric matrix.
# Raises an error if matrix is not square. # Raises an error if matrix is not square.
# #
def symmetric? def symmetric?
@ -774,7 +774,7 @@ class Matrix
end end
# #
# Returns +true+ is this is a unitary matrix # Returns +true+ if this is a unitary matrix
# Raises an error if matrix is not square. # Raises an error if matrix is not square.
# #
def unitary? def unitary?
@ -792,14 +792,14 @@ class Matrix
end end
# #
# Returns +true+ is this is an upper triangular matrix. # Returns +true+ if this is an upper triangular matrix.
# #
def upper_triangular? def upper_triangular?
each(:strict_lower).all?(&:zero?) each(:strict_lower).all?(&:zero?)
end end
# #
# Returns +true+ is this is a matrix with only zero elements # Returns +true+ if this is a matrix with only zero elements
# #
def zero? def zero?
all?(&:zero?) all?(&:zero?)