lib/matrix.rb in matrix-0.4.0 vs lib/matrix.rb in matrix-0.4.1

- old
+ new

@@ -1014,11 +1014,11 @@ #-- # OBJECT METHODS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #++ # - # Returns +true+ if and only if the two matrices contain equal elements. + # Returns whether the two matrices contain equal elements. # def ==(other) return false unless Matrix === other && column_count == other.column_count # necessary for empty matrices rows == other.rows @@ -1237,11 +1237,11 @@ def **(exp) case exp when Integer case when exp == 0 - _make_sure_it_is_invertible = inverse + raise ErrDimensionMismatch unless square? self.class.identity(column_count) when exp < 0 inverse.power_int(-exp) else power_int(exp) @@ -2132,11 +2132,11 @@ #-- # PROPERTIES -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #++ # - # Returns +true+ iff all of vectors are linearly independent. + # Returns whether all of vectors are linearly independent. # # Vector.independent?(Vector[1,0], Vector[0,1]) # # => true # # Vector.independent?(Vector[1,2], Vector[2,4]) @@ -2150,11 +2150,11 @@ return false if vs.count > vs.first.size Matrix[*vs].rank.eql?(vs.count) end # - # Returns +true+ iff all of vectors are linearly independent. + # Returns whether all of vectors are linearly independent. # # Vector[1,0].independent?(Vector[0,1]) # # => true # # Vector[1,2].independent?(Vector[2,4]) @@ -2163,11 +2163,11 @@ def independent?(*vs) self.class.independent?(self, *vs) end # - # Returns +true+ iff all elements are zero. + # Returns whether all elements are zero. # def zero? all?(&:zero?) end @@ -2191,10 +2191,10 @@ #-- # COMPARING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #++ # - # Returns +true+ iff the two vectors have the same elements in the same order. + # Returns whether the two vectors have the same elements in the same order. # def ==(other) return false unless Vector === other @elements == other.elements end