* lib/matrix.rb (empty): Improved rdoc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
80a756bbc9
commit
439a1e64d1
@ -229,8 +229,15 @@ class Matrix
|
|||||||
#
|
#
|
||||||
# Creates a empty matrix of +row_size+ x +column_size+.
|
# Creates a empty matrix of +row_size+ x +column_size+.
|
||||||
# +row_size+ or +column_size+ must be 0.
|
# +row_size+ or +column_size+ must be 0.
|
||||||
# Matrix.empty(4,0).inspect_org
|
#
|
||||||
# => "#<Matrix:*** @column_size=0, @rows=[[], [], [], []]>"
|
# m = Matrix.empty(2, 0)
|
||||||
|
# m == Matrix[ [], [] ]
|
||||||
|
# => true
|
||||||
|
# n = Matrix.empty(0, 3)
|
||||||
|
# n == Matrix.columns([ [], [], [] ])
|
||||||
|
# => true
|
||||||
|
# m * n
|
||||||
|
# => Matrix[[0, 0, 0], [0, 0, 0]]
|
||||||
#
|
#
|
||||||
def Matrix.empty(row_size = 0, column_size = 0)
|
def Matrix.empty(row_size = 0, column_size = 0)
|
||||||
Matrix.Raise ErrDimensionMismatch if column_size != 0 && row_size != 0
|
Matrix.Raise ErrDimensionMismatch if column_size != 0 && row_size != 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user