Here you can find the source of toFloatArrays(double[][] arrays)
public static float[][] toFloatArrays(double[][] arrays)
//package com.java2s; /* MOD_V2.0//from w w w .j a v a 2 s . c o m * Copyright (c) 2012 OpenDA Association * All rights reserved. * * This file is part of OpenDA. * * OpenDA is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * OpenDA is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with OpenDA. If not, see <http://www.gnu.org/licenses/>. */ public class Main { public static float[][] toFloatArrays(double[][] arrays) { float[][] res = new float[arrays.length][]; for (int i = 0; i < arrays.length; i++) { res[i] = toFloatArray(arrays[i]); } return res; } public static float[] toFloatArray(double[] array) { float[] res = new float[array.length]; for (int i = 0; i < res.length; i++) { res[i] = (float) array[i]; } return res; } }