code: public static double vectorLength(double[] vector) {
          double ret = 0;
          if (vector == null)
              return ret;
          else {
              for (int i = 0; i < vector.length; i++) {
                  ret += Math.pow(vector[i], 2);
              }
  
          }
          return ret;
      }
docs: Returns the vector length (sqrt(sum(x_i))
  @param vector the vector to return the vector length for
  @return the vector length of the passed in array