getColumn method

Float64List getColumn (List<Float64List> matrix, int col)

Returns the column col >= 0 of matrix. Returns null if col is outside range. The result is a new Float64List! Modifying the col will therefore NOT modify the matrix!

Implementation

static Float64List getColumn(List<Float64List> matrix, int col) {
  if (col < 0 || col >= matrix[0].length) return null;
  int nrows = matrix.length; // col length
  Float64List result = new Float64List(nrows);
  for (int i = 0; i < nrows; i++) {
    result[i] = matrix[i][col];
  }
  return result;
}