Here you can find the source of convertIntDouble(int[][] in)
Parameter | Description |
---|---|
in | the integer array to convert |
public static double[][] convertIntDouble(int[][] in)
//package com.java2s; /** Implement various functionality for working with arrays and Lists * * @package SciTK/*from w w w. j av a2 s . c o m*/ * @class ArrayUtil * @brief Convert arrays * @author Alex Zylstra * @date 2013/04/15 * @copyright Alex Zylstra * @license SciTK / MIT License */ public class Main { /** Convert an integer 2-D array to a double array. * @param in the integer array to convert * @return the input array converted to double type */ public static double[][] convertIntDouble(int[][] in) { double[][] ret = new double[in.length][in[0].length]; for (int i = 0; i < in.length; i++) { for (int j = 0; j < in.length; j++) ret[i][j] = (double) in[i][j]; } return ret; } }