code: public double[] toDoubleArray() {
      double[] copy = new double[size];
      for (int i = 0; i < size; i++) {
        copy[i] = elements[i];
      }
      return copy;
    }
docs: Converts this <code>DoubleArray</code> to an array of doubles.
  
  @return An array of doubles containing the same elements as this array.