Convert a list of numbers to an array of doubles.

@param listOfNumbers A list of numbers.
@return A corresponding array of doubles executing <code>doubleValue()</code> on each element.
559676
private static RandomVariable[] numberListToDoubleArray(List<RandomVariable> listOfNumbers) {
		RandomVariable[] array	= new RandomVariable[listOfNumbers.size()];
		for(int i=0; i<array.length; i++) {
			array[i] = listOfNumbers.get(i);
		}
		return array;
	}
1025331
@Override
    public Double reduce(List<Double> values) {
        double min = Double.MAX_VALUE;
        double max = Double.MIN_VALUE;

        for (Double value : values) {
            if (value == null) {
                value = 0.0;
            }

            double candidate = (value);

            if (candidate < min) {
                min = candidate;
            }
            if (candidate > max) {
                max = candidate;
            }
        }
        return max - min;
    }
337315
public double[][] getS() {
    double[][] S = new double[n][n];
    for(int i = 0; i < n; i++) {
      S[i][i] = this.s[i];
    }
    return S;
  }
672338
public static DoubleStreamEx of(Double[] array) {
        return seq(Arrays.stream(array).mapToDouble(Double::doubleValue));
    }
1127242
public static int[] toInt(double[] array) {
        int[] n = new int[array.length];
        for (int i = 0; i < array.length; i++) {
            n[i] = (int) array[i];
        }
        return n;
    }
538310
public static void sortDescending(double[] doubleArray) {
        int index = 0;
        double value = 0;
        
        for(int i = 1; i < doubleArray.length; i++) {
            index = i;
            value = doubleArray[index];
            
            while(index > 0 && value > doubleArray[index - 1]) {
                doubleArray[index] = doubleArray[index - 1];
                
                index--;
            }
            
            doubleArray[index] = value;
        }
    }
344018
public ArrayList castToNumberList(ArrayList childNodeList) // was NumericValue
  {
    if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.entry(cclass, "castToNumberList", childNodeList);
 
    ArrayList numberList = new ArrayList();
    
    if(childNodeList != null)
    {
      Iterator iterNode = childNodeList.iterator();
      
      while(iterNode.hasNext())
      {
        String strValue = getStringFromNode(iterNode.next());
        
        // Cast the string to a Number
        Number num = EvaluatorImpl.castToNumber(strValue);
        if (tc.isAnyTracingEnabled() && tc.isDebugEnabled())
          tc.debug(cclass, "Add number to list: ", num);  
        numberList.add(num);
      }              
    }
    
    if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
      tc.exit(cclass, "castToNumberList", numberList);    
    return numberList;
  }
616943
public double[][] copyValues2D()
    {
        double v[][] = new double[nRows][nCols];

        for (int r = 0; r < nRows; ++r) {
            for (int c = 0; c < nCols; ++c) {
                v[r][c] = values[r][c];
            }
        }

        return v;
    }
177054
private static <S extends Solution<?>> double[] getIdealValues(List<S> solutionsList) {
    ArrayFront front = new ArrayFront(solutionsList);
    FrontExtremeValues extremeValues = new FrontExtremeValues();
    List<Double> list = extremeValues.findLowestValues(front);
    return toArray(list);
  }
981439
private static int[] toIntArray(List<Integer> list) {
    if (list == null || list.isEmpty()) {
      return NO_BINDS;
    }
    int[] res = new int[list.size()];
    for (int i = 0; i < list.size(); i++) {
      res[i] = list.get(i); // must not be null
    }
    return res;
  }
758337
public double[] getRangeForBin(int binIndex) {
		if (binIndex >=0 && binIndex < ranges.length) 
			return new double[] { ranges[binIndex], ranges[binIndex + 1] };
		return null;
	}
1326027
public double[] getDoubles(int rowId, int count) {
    double[] res = new double[count];
    for (int i = 0; i < count; i++) {
      res[i] = getDouble(rowId + i);
    }
    return res;
  }
1344874
public static Double[] boxDoubles(Object src, int srcPos, int len) {
        return boxDoubles(array(src), srcPos, len);
    }
293425
public void add(DoubleArrayList values) {
        ensureCapacity(size + values.size);
        for (int i=0; i<values.size; i++) {
            this.add(values.elements[i]);
        }
    }
1126548
public static double[] copyOf(double[] doubleArray) {

    	double[] copy = new double[doubleArray.length];
        System.arraycopy(doubleArray, 0, copy, 0, doubleArray.length);
        return copy;
    }
918466
public static double[] convertToDoubleArray(Matrix4d transformationMatrix) {
		// Initialise the output array
		double[] outArray = new double[16];
		// Iterate over the matrix
		for(int i=0; i<4; i++){
			for(int j=0; j<4; j++){
				// Now set this element
				outArray[i*4+j] = transformationMatrix.getElement(i,j);
			}
		}
		return outArray;
	}
574428
private static List<Integer> convertList(List<String> list) {
        if (list == null) {
            return null;
        }
        List<Integer> ret = new ArrayList<Integer>(list.size());
        for (String v : list) {
            ret.add(StringUtils.toInt(v));
        }

        return ret;
    }