Java Double to doubleToFloatMatrix(double[][] matrix)

Here you can find the source of doubleToFloatMatrix(double[][] matrix)

Description

double To Float Matrix

License

Mozilla Public License

Declaration

public static float[][] doubleToFloatMatrix(double[][] matrix) 

Method Source Code

//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;
    }
}

Related

  1. doubleToBits(double num)
  2. doubleToChar(double d, char defaultValue)
  3. doubleToDoubleArray(double... a)
  4. doubleToFloatArray(double[] dArray)
  5. doubleToFloatArray(double[] doubles)
  6. doubleToFractionStr(final Double d)
  7. doubleToHashString(double value)
  8. doubleToHexString(double val)
  9. doubleToI18nString(double d)