ruby-changes:13192
From: marcandre <ko1@a...>
Date: Wed, 16 Sep 2009 13:39:46 +0900 (JST)
Subject: [ruby-changes:13192] Ruby:r24948 (trunk): * lib/matrix.rb: Fix typos in doc and indent
marcandre 2009-09-16 13:39:37 +0900 (Wed, 16 Sep 2009) New Revision: 24948 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24948 Log: * lib/matrix.rb: Fix typos in doc and indent Modified files: trunk/lib/matrix.rb Index: lib/matrix.rb =================================================================== --- lib/matrix.rb (revision 24947) +++ lib/matrix.rb (revision 24948) @@ -50,7 +50,6 @@ # * <tt> Matrix.columns(columns) </tt> # * <tt> Matrix.diagonal(*values) </tt> # * <tt> Matrix.scalar(n, value) </tt> -# * <tt> Matrix.scalar(n, value) </tt> # * <tt> Matrix.identity(n) </tt> # * <tt> Matrix.unit(n) </tt> # * <tt> Matrix.I(n) </tt> @@ -122,11 +121,12 @@ # # Creates a matrix where +rows+ is an array of arrays, each of which is a row - # to the matrix. If the optional argument +copy+ is false, use the given + # of the matrix. If the optional argument +copy+ is false, use the given # arrays as the internal structure of the matrix without copying. # Matrix.rows([[25, 93], [-1, 66]]) # => 25 93 # -1 66 + # def Matrix.rows(rows, copy = true) new(:init_rows, rows, copy) end @@ -137,7 +137,6 @@ # => 25 -1 # 93 66 # - # def Matrix.columns(columns) rows = (0 ... columns[0].size).collect {|i| (0 ... columns.size).collect {|j| @@ -651,13 +650,13 @@ # # Returns the determinant of the matrix. If the matrix is not square, the - # result is 0. This method's algorism is Gaussian elimination method + # result is 0. This method's algorithm is Gaussian elimination method # and using Numeric#quo(). Beware that using Float values, with their # usual lack of precision, can affect the value returned by this method. Use # Rational values or Matrix#det_e instead if this is important to you. # # Matrix[[7,6], [3,9]].determinant - # => 63.0 + # => 45.0 # def determinant return 0 unless square? @@ -692,8 +691,8 @@ # # Returns the determinant of the matrix. If the matrix is not square, the - # result is 0. This method's algorism is Gaussian elimination method. - # This method uses Euclidean algorism. If all elements are integer, + # result is 0. This method's algorithm is Gaussian elimination method. + # This method uses Euclidean algorithm. If all elements are integer, # really exact value. But, if an element is a float, can't return # exact value. # @@ -802,7 +801,7 @@ # # Returns the rank of the matrix. This method uses Euclidean - # algorism. If all elements are integer, really exact value. But, if + # algorithm. If all elements are integer, really exact value. But, if # an element is a float, can't return exact value. # # Matrix[[7,6], [3,9]].rank @@ -994,7 +993,7 @@ when Vector Scalar.Raise WrongArgType, other.class, "Numeric or Scalar or Matrix" when Matrix - self * other.inverse + self * other.inverse else x, y = other.coerce(self) x.quo(y) @@ -1349,6 +1348,5 @@ end end - # Documentation comments: # - Matrix#coerce and Vector#coerce need to be documented -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/