Here you can find the source of toLongArray(double[][] array)
public static long[][] toLongArray(double[][] array)
//package com.java2s; //License from project: Open Source License public class Main { public static long[][] toLongArray(double[][] array) { int nr = array.length; int nc = array[0].length; long[][] ret = new long[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { ret[i][j] = (long) array[i][j]; }/*from w w w .j av a 2 s .c o m*/ } return ret; } public static long[][] toLongArray(float[][] array) { int nr = array.length; int nc = array[0].length; long[][] ret = new long[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { ret[i][j] = (long) array[i][j]; } } return ret; } public static long[][] toLongArray(int[][] array) { int nr = array.length; int nc = array[0].length; long[][] ret = new long[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { ret[i][j] = (long) array[i][j]; } } return ret; } public static long[][] toLongArray(byte[][] array) { int nr = array.length; int nc = array[0].length; long[][] ret = new long[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { ret[i][j] = (long) array[i][j]; } } return ret; } public static long[][] toLongArray(char[][] array) { int nr = array.length; int nc = array[0].length; long[][] ret = new long[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { ret[i][j] = (long) array[i][j]; } } return ret; } public static long[][] toLongArray(String[][] array) { int nr = array.length; int nc = array[0].length; long[][] ret = new long[nr][nc]; for (int i = 0; i < nr; i++) { for (int j = 0; j < nc; j++) { ret[i][j] = Long.parseLong(array[i][j]); } } return ret; } }