code: public static DenseVector rand(final int size, final Random random) {
      final DenseVector vec = new DenseVector(size);
      for (int i = 0; i < size; ++i) {
        vec.values[i] = random.nextDouble();
      }
      return vec;
    }
docs: Creates a random Vector of size 'size' where each element is individually.
  drawn from Math.random()
  
  @param random the random number generator to use.
  @return a random Vector of the given size where each element is
  individually drawn from Math.random()