diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-20 19:01:31 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-20 19:01:31 +0000 |
commit | 439a1e64d17d31ba53ed097a432ecc0df522a0fb (patch) | |
tree | d87c26121055e255e5ce283205bb07e8f4fd3b75 /lib | |
parent | 80a756bbc9f67a60c36f331e5a88ea7fb94ef524 (diff) | |
download | ruby-439a1e64d17d31ba53ed097a432ecc0df522a0fb.tar.gz |
* lib/matrix.rb (empty): Improved rdoc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/matrix.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb index 2b50e40fa5..7c546c3a7a 100644 --- a/lib/matrix.rb +++ b/lib/matrix.rb @@ -229,8 +229,15 @@ class Matrix # # Creates a empty matrix of +row_size+ x +column_size+. # +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) Matrix.Raise ErrDimensionMismatch if column_size != 0 && row_size != 0 |