Method: Stick::Matrix#row

Defined in:
lib/stick/matrix/core.rb

#row(i) ⇒ Object

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.



301
302
303
304
305
306
307
308
309
# File 'lib/stick/matrix/core.rb', line 301

def row(i) # :yield: e
  if block_given?
    for e in @rows[i]
      yield e
    end
  else
    Vector.elements(@rows[i])
  end
end