public static double norm_1(double[] a) {
    double sum = 0;
    for (double anA : a) {
      sum += (anA < 0 ? -anA : anA);
    }
    return sum;
  }
public static double norm_1 ( double [ ] a ) { double sum = 0 ; for ( double anA : a ) { sum += ( anA < 0 ? - anA : anA ) ; } return sum ; }
Computes 1-norm of vector

@param a A vector of double
@return 1-norm of a