public static float[] arrayF4ToF1(float[][][][] floats) {
float[] result = new float[floats.length * floats[0].length * floats[0][0].length * floats[0][0][0].length];
for (int i = 0; i < floats.length; i++) {
for (int j = 0; j < floats[0].length; j++) {
for (int k = 0; k < floats[0][0].length; k++) {
for (int z = 0; z < floats[0][0][0].length; z++) {
result[i * floats[0].length * floats[0][0].length * floats[0][0][0].length +
j * floats[0][0].length * floats[0][0][0].length +
k * floats[0][0][0].length +
z] = floats[i][j][k][z];
}
}
}
}
return result;
}
public static float[] arrayF3ToF1(float[][][] floats) {
float[] result = new float[floats.length * floats[0].length * floats[0][0].length];
for (int i = 0; i < floats.length; i++) {
for (int j = 0; j < floats[0].length; j++) {
for (int k = 0; k < floats[0][0].length; k++) {
result[i * floats[0].length * floats[0][0].length +
j * floats[0][0].length +
k] = floats[i][j][k];
}
}
}
return result;
}
public static double[][][][] arrayF4ToD4(float[][][][] floats) {
double[][][][] result = new double[floats.length][floats[0].length][floats[0][0].length][floats[0][0][0].length];
for (int i = 0; i < floats.length; i++) {
for (int j = 0; j < floats[0].length; j++) {
for (int k = 0; k < floats[0][0].length; k++) {
for (int z = 0; z < floats[0][0][0].length; z++) {
result[i][j][k][z] = floats[i][j][k][z];
}
}
}
}
return result;
}
public static double[][][] arrayF3ToD3(float[][][] floats) {
double[][][] result = new double[floats.length][floats[0].length][floats[0][0].length];
for (int i = 0; i < floats.length; i++) {
for (int j = 0; j < floats[0].length; j++) {
for (int k = 0; k < floats[0][0].length; k++) {
result[i][j][k] = floats[i][j][k];
}
}
}
return result;
}