Here you can find the source of doubleToFloatMatrix(double[][] matrix)
public static float[][] doubleToFloatMatrix(double[][] matrix)
//package com.java2s; /**//from w w w . j av a 2s. co m * Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ public class Main { public static float[][] doubleToFloatMatrix(double[][] matrix) { float retMatrix[][] = new float[matrix.length][matrix[0].length]; for (int i = 0; i < matrix.length; i++) { for (int j = 0; j < matrix[0].length; j++) { retMatrix[i][j] = (float) matrix[i][j]; } } return retMatrix; } }