dotCM method

List<List<double>> dotCM (double c, List<List<double>> matr)

Returns new matrix, the pointwise multiplication of matr with c.

Implementation

List<List<double>> dotCM(double c, List<List<double>> matr) {
  List<List<double>> result = List(matr.length);
  for (int i = 0; i < matr.length; i++) {
    result[i] = List(matr[0].length);
    for (int k = 0; k < matr[0].length; k++) {
      result[i][k] = matr[i][k] * c;
    }
  }
  return result;
}