Here you can find the source of convertDoubleMatrixToFloat(double[][] input, int dimRows, int dimColoumns)
public static float[][] convertDoubleMatrixToFloat(double[][] input, int dimRows, int dimColoumns)
//package com.java2s; //License from project: Open Source License public class Main { public static float[][] convertDoubleMatrixToFloat(double[][] input, int dimRows, int dimColoumns) { if (input == null) { return null; // Or throw an exception - your choice }//w w w . j a v a2s . c om float[][] output = new float[dimRows][dimColoumns]; for (int i = 0; i < dimRows; i++) { for (int j = 0; j < dimColoumns; j++) { output[i][j] = (float) input[i][j]; } } return output; } }