join method

Float64List join (List<Float64List> matrix)

Returns a one-dimensional array from a two-dimensional matrix by appending their rows in sequence. See also getSubmatrixAs1D.

Implementation

static Float64List join(List<Float64List> matrix) {
  int size = 0;
  for (int i = 0; i < matrix.length; i++) {
    size += matrix[i].length;
  }

  Float64List result = new Float64List(size);
  int count = 0;
  for (int i = 0; i < matrix.length; i++) {
    for (int j = 0; j < matrix[i].length; j++) {
      result[count++] = matrix[i][j];
    }
  }
  return result;
}