manhattanNorm method

double manhattanNorm()

Returns the Manhattan norm of the vector.

Vector v = Vector([1.0, 1.0, 1.0]);
print(v.manhattanNorm());

will print 3.0

Implementation

double manhattanNorm() {
  double v = 0.0;
  for (int i = 0; i < elements; i++) {
    v += this[i].abs();
  }
  return v;
}