frobeniusNorm function Null safety

double frobeniusNorm(
  1. AMatrix mat
)

Implementation

double frobeniusNorm(AMatrix mat) {
  double result = 0;
  for (int r = 0; r < mat.rows; r++) {
    for (int c = 0; c < mat.columns; c++) {
      final v = mat.getF(r, c);
      result += v * v;
    }
  }
  return sqrt(result);
}