[前][次][番号順一覧][スレッド一覧]

ruby-changes:13638

From: marcandre <ko1@a...>
Date: Wed, 21 Oct 2009 04:01:41 +0900 (JST)
Subject: [ruby-changes:13638] Ruby:r25422 (trunk): * lib/matrix.rb (empty): Improved rdoc

marcandre	2009-10-21 04:01:31 +0900 (Wed, 21 Oct 2009)

  New Revision: 25422

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25422

  Log:
    * lib/matrix.rb (empty): Improved rdoc

  Modified files:
    trunk/lib/matrix.rb

Index: lib/matrix.rb
===================================================================
--- lib/matrix.rb	(revision 25421)
+++ lib/matrix.rb	(revision 25422)
@@ -229,9 +229,16 @@
   #
   # 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
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]