Given a front, converts it to an array of double values

@param front
@return A front as double[][] array
2877
public static double[][] convertFrontToArray(Front front) {
    if (front == null) {
      throw new NullFrontException();
    }

    double[][] arrayFront = new double[front.getNumberOfPoints()][] ;

    for (int i = 0; i < front.getNumberOfPoints(); i++) {
      arrayFront[i] = new double[front.getPoint(i).getDimension()] ;
      for (int j = 0 ; j < front.getPoint(i).getDimension(); j++) {
        arrayFront[i][j] = front.getPoint(i).getValue(j) ;
      }
    }

    return arrayFront ;
  }
955976
private double epsilon(Front front, Front referenceFront) throws JMetalException {

    double eps, epsJ = 0.0, epsK = 0.0, epsTemp;

    int numberOfObjectives = front.getPointDimensions() ;

    eps = Double.MIN_VALUE;

    for (int i = 0; i < referenceFront.getNumberOfPoints(); i++) {
      for (int j = 0; j < front.getNumberOfPoints(); j++) {
        for (int k = 0; k < numberOfObjectives; k++) {
          epsTemp = front.getPoint(j).getValue(k)
              - referenceFront.getPoint(i).getValue(k);
          if (k == 0) {
            epsK = epsTemp;
          } else if (epsK < epsTemp) {
            epsK = epsTemp;
          }
        }
        if (j == 0) {
          epsJ = epsK;
        } else if (epsJ > epsK) {
          epsJ = epsK;
        }
      }
      if (i == 0) {
        eps = epsJ;
      } else if (eps < epsJ) {
        eps = epsJ;
      }
    }
    return eps;
  }
567113
@Override
    public double[] toDoubleArray() {
        double[] array = new double[numAttributes()];
        for (int i = 0; i < numValues(); i++) {
            array[index(i)] = valueSparse(i);
        }
        return array;
    }
543462
static double[] incremental(final double[] values) {
		final DoubleAdder adder = new DoubleAdder(values[0]);
		for (int i = 1; i < values.length; ++i) {
			values[i] = adder.add(values[i]).doubleValue();
		}
		return values;
	}
1035783
public static double[] getDoubleData(DataBuffer buf) {
        if (buf.allocationMode() == DataBuffer.AllocationMode.HEAP)
            return buf.asDouble();
        else {
            double[] ret = new double[(int) buf.length()];
            for (int i = 0; i < buf.length(); i++)
                ret[i] = buf.getDouble(i);
            return ret;

        }
    }
1183572
public static final double[] toArray(Point... points)
    {
        double[] res = new double[2*points.length];
        int idx = 0;
        for (Point pp : points)
        {
            res[idx++] = pp.getX();
            res[idx++] = pp.getY();
        }
        return res;
    }
149280
public float[] toFloatArray() {
        if (isParallel())
            return collect(DoubleCollector.toFloatArray());
        java.util.Spliterator.OfDouble spliterator = spliterator();
        long size = spliterator.getExactSizeIfKnown();
        FloatBuffer buf;
        if (size >= 0 && size <= Integer.MAX_VALUE) {
            buf = new FloatBuffer((int) size);
            spliterator.forEachRemaining((DoubleConsumer) buf::addUnsafe);
        } else {
            buf = new FloatBuffer();
            spliterator.forEachRemaining((DoubleConsumer) buf::add);
        }
        return buf.toArray();
    }
193414
public static <A> double[] toPrimitiveDoubleArray(A array, NumberArrayAdapter<?, ? super A> adapter) {
    if (adapter == DOUBLEARRAYADAPTER) {
      return ((double[]) array).clone();
    }
    double[] ret = new double[adapter.size(array)];
    for (int i = 0; i < ret.length; i++) {
      ret[i] = adapter.getDouble(array, i);
    }
    return ret;
  }
1099460
@Override
    public double[] get(double[] target) {
        if ((target == null) || (target.length != 16)) {
            target = new double[16];
        }
        target[0] = m00;
        target[1] = m01;
        target[2] = m02;
        target[3] = m03;

        target[4] = m10;
        target[5] = m11;
        target[6] = m12;
        target[7] = m13;

        target[8] = m20;
        target[9] = m21;
        target[10] = m22;
        target[11] = m23;

        target[12] = m30;
        target[13] = m31;
        target[14] = m32;
        target[15] = m33;

        return target;
    }
648255
private T[] convert(final List source) throws FrameworkException {

		final ArrayList<T> result = new ArrayList<>();

		for (final Object o : source) {

			if (componentType.isInstance(o)) {

				result.add((T)o);

			} else if (componentType.equals(Integer.class) && o instanceof Double) {

				result.add((T)(Integer)((Double)o).intValue());

			} else if (o != null) {

				final T value = fromString(o.toString());

				if (value == null) {
					throw new FrameworkException(422, "Invalid input", new NumberToken(this.getDeclaringClass().getSimpleName(), this));
				}

				result.add(value);

			} else {

				// dont know
				throw new IllegalStateException("Conversion of array type failed.");
			}
		}

		return (T[])result.toArray((Object[])Array.newInstance(componentType, 0));
	}
992825
public double spread(Front front, Front referenceFront) {
    PointDistance distance = new EuclideanDistance() ;

    // STEP 1. Sort normalizedFront and normalizedParetoFront;
    front.sort(new LexicographicalPointComparator());
    referenceFront.sort(new LexicographicalPointComparator());

    // STEP 2. Compute df and dl (See specifications in Deb's description of the metric)
    double df = distance.compute(front.getPoint(0), referenceFront.getPoint(0)) ;
    double dl = distance.compute(front.getPoint(front.getNumberOfPoints() - 1),
        referenceFront.getPoint(referenceFront.getNumberOfPoints() - 1)) ;

    double mean = 0.0;
    double diversitySum = df + dl;

    int numberOfPoints = front.getNumberOfPoints() ;

    // STEP 3. Calculate the mean of distances between points i and (i - 1).
    // (the points are in lexicografical order)
    for (int i = 0; i < (numberOfPoints - 1); i++) {
      mean += distance.compute(front.getPoint(i), front.getPoint(i + 1));
    }

    mean = mean / (double) (numberOfPoints - 1);

    // STEP 4. If there are more than a single point, continue computing the
    // metric. In other case, return the worse value (1.0, see metric's description).
    if (numberOfPoints > 1) {
      for (int i = 0; i < (numberOfPoints - 1); i++) {
        diversitySum += Math.abs(distance.compute(front.getPoint(i),
            front.getPoint(i + 1)) - mean);
      }
      return diversitySum / (df + dl + (numberOfPoints - 1) * mean);
    } else {
      return 1.0;
    }
  }
233207
public double[] toNativeArray() {
        final double[] arr = new double[getNumImplicitEntries()];
        iterate(new FnIntDoubleToVoid() {
            @Override
            public void call(int idx, double val) {
                arr[idx] = val;
            }
        });
        return arr;
    }
1085485
public static Double[] wrap(double... values) {
		if (null == values) {
			return null;
		}
		final int length = values.length;
		if (0 == length) {
			return new Double[0];
		}

		final Double[] array = new Double[length];
		for (int i = 0; i < length; i++) {
			array[i] = Double.valueOf(values[i]);
		}
		return array;
	}
1115487
public double[][] getArray()
    {
        double[][] result = new double[getM()][];
        
        for ( int m = 0; m < getM(); m++ )
        {
           result[m] = new double[ getN() ];

           for ( int n = 0; n < getN(); n++ )
           {               
               result[m][n] = getReal(m,n);
           }
        }
        return result;
    }
345142
@SafeVarargs
    public static Float[] box(final float... a) {
        if (a == null) {
            return null;
        }

        return box(a, 0, a.length);
    }
1224483
def front(self, *fields):
        ''''''
        v, f = tuple(self.irange(0, 0, fields=fields))
        if v:
            return (v[0], dict(((field, f[field][0]) for field in f)))
226911
@SuppressWarnings("unchecked")
    public static List<Double> getAt(double[] array, Range range) {
        return primitiveArrayGet(array, range);
    }