summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-20 19:01:31 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-20 19:01:31 +0000
commit7d176870a9ce126faaeb68e12fa0aaea999c8a2b (patch)
treed87c26121055e255e5ce283205bb07e8f4fd3b75 /lib
parent08005e045d1e0b26ef2a0875f2c6c568e9e3da6f (diff)
downloadruby-7d176870a9ce126faaeb68e12fa0aaea999c8a2b.tar.gz
ruby-7d176870a9ce126faaeb68e12fa0aaea999c8a2b.tar.xz
ruby-7d176870a9ce126faaeb68e12fa0aaea999c8a2b.zip
* lib/matrix.rb (empty): Improved rdoc
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/matrix.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb
index 2b50e40fa..7c546c3a7 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