Java Utililty Methods Double Array Convert

List of utility methods to do Double Array Convert

Description

The list of methods to do Double Array Convert are organized into topic(s).

Method

byte[]doubleArrayToBytes(double[] d)
double Array To Bytes
byte[] r = new byte[d.length * 8];
for (int i = 0; i < d.length; i++) {
    byte[] s = doubleToBytes(d[i]);
    for (int j = 0; j < 8; j++)
        r[8 * i + j] = s[j];
return r;
StringdoubleArrayToClassNames(int[] labels, String[] classNames, Character separatorChar)
Converts a bipartition array into a list of class names.
StringBuffer buffer = new StringBuffer();
for (int y = 0; y < labels.length; y++) {
    if (labels[y] == 1) {
        buffer.append(classNames[y] + separatorChar);
String classString;
try {
...
float[]doubleArrayToFloatArray(double[] doubleArray)
double Array To Float Array
if (doubleArray == null)
    return null;
float[] floatArray;
floatArray = new float[doubleArray.length];
for (int i = 0; i < doubleArray.length; i++) {
    floatArray[i] = (float) doubleArray[i];
return floatArray;
...
int[]doubleArrayToIntArray(double[] doubles)
double Array To Int Array
int[] ret = new int[doubles.length * 2];
for (int i = 0; i < doubles.length; i++) {
    long l = Double.doubleToLongBits(doubles[i]);
    ret[i] = (int) (l >>> 32);
    ret[i + 1] = (int) l;
return ret;