APIdock / Ruby
/
method

row

ruby latest stable - Class: Matrix
row(i)
public

Returns row vector number i of the matrix as a Vector (starting at 0 like an array). When a block is given, the elements of that vector are iterated.

# File lib/matrix.rb, line 330
 def row(i, &block) # :yield: e
 if block_given?
 @rows.fetch(i){return self}.each(&block)
 self
 else
 Vector.elements(@rows.fetch(i){return nil})
 end
 end

AltStyle によって変換されたページ (->オリジナル) /