code: public static double[] toDoubles(String x, double alternative) throws NumberFormatException {
          String[] tokens = x.split("\\s+");
          double[] result = new double[tokens.length];
          for (int i = 0; i < tokens.length; ++i) {
              result[i] = Op.toDouble(tokens[i], alternative);
          }
          return result;
      }
docs: Parses the given string into a vector of scalar values
  
  @param x is the string containing space-separated values to parse
  @param alternative is the value to use if an invalid value is found
  @return the vector of scalar values