sumM method

double sumM (List<List<double>> matrix)

Returns the sum of all entries of matrix.

Implementation

double sumM(List<List<double>> matrix) {
  double sum = 0;
  for (int i = 0; i < matrix.length; i++) {
    for (int k = 0; k < matrix[0].length; k++) {
      sum += matrix[i][k];
    }
  }
  return sum;
}