stdlib/matrix.rb
#
# Returns column vector number +j+ of the matrix as a Vector (starting at 0
# like an array).  When a block is given, the elements of that vector are
# iterated.
#
Returns column vector number +j+ of the matrix as a Vector (starting at 0
like an array).  When a block is given, the elements of that vector are
iterated.
Returns column vector number + j + of the matrix as a Vector ( starting at 0 like an array ) . When a block is given the elements of that vector are iterated .
def column(j) 
    if block_given?
      return self if j >= column_count || j < -column_count
      row_count.times do |i|
        yield @rows[i][j]
      end
      self
    else
      return nil if j >= column_count || j < -column_count
      col = Array.new(row_count) {|i|
        @rows[i][j]
      }
      Vector.elements(col, false)
    end
  end
def column ( j ) if block_given? return self if j >= column_count || j < - column_count row_count . times do | i | yield @rows [ i ] [ j ] end self else return nil if j >= column_count || j < - column_count col = Array . new ( row_count ) { | i | @rows [ i ] [ j ] } Vector . elements ( col , false ) end end
Returns column vector number +j+ of the matrix as a Vector (starting at 0
like an array).
Returns column vector number + j + of the matrix as a Vector ( starting at 0 like an array ) .
# :yield: e
j
<not_specific>