code: public static double sum(final double[] v1) {
      double acc = 0.;
      for(int row = 0; row < v1.length; row++) {
        acc += v1[row];
      }
      return acc;
    }
docs: Sum of the vector components.
  
  @param v1 vector
  @return sum of this vector