column(j)
public
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.
Show source
def column(j)
if block_given?
0.upto(row_size - 1) do
|i|
yield @rows[i][j]
end
else
col = (0 .. row_size - 1).collect {
|i|
@rows[i][j]
}
Vector.elements(col, false)
end
end