Here you can find the source of toFloatArray(double[][] array)
public static float[][] toFloatArray(double[][] array)
//package com.java2s; //License from project: Open Source License public class Main { public static float[][] toFloatArray(double[][] array) { int nr = array.length; int nc = array[0].length; float[][] ret = new float[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { ret[i][j] = (float) array[i][j]; }/* www . j a v a2s. c o m*/ } return ret; } public static float[][] toFloatArray(int[][] array) { int nr = array.length; int nc = array[0].length; float[][] ret = new float[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { ret[i][j] = (float) array[i][j]; } } return ret; } public static float[][] toFloatArray(long[][] array) { int nr = array.length; int nc = array[0].length; float[][] ret = new float[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { ret[i][j] = (float) array[i][j]; } } return ret; } public static float[][] toFloatArray(short[][] array) { int nr = array.length; int nc = array[0].length; float[][] ret = new float[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { ret[i][j] = (float) array[i][j]; } } return ret; } public static float[][] toFloatArray(byte[][] array) { int nr = array.length; int nc = array[0].length; float[][] ret = new float[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { ret[i][j] = (float) array[i][j]; } } return ret; } public static float[][] toFloatArray(String[][] array) { int nr = array.length; int nc = array[0].length; float[][] ret = new float[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { ret[i][j] = Float.parseFloat(array[i][j]); } } return ret; } }