Here you can find the source of toInt(double[] v)
public static int[] toInt(double[] v)
//package com.java2s; //License from project: Open Source License public class Main { public static int[] toInt(double[] v) { final int[] ans = new int[v.length]; for (int k = 0; k < v.length; k++) ans[k] = (int) v[k]; return (ans); }/*w ww .j a va2 s . c o m*/ public static int[] toInt(float[] v) { final int[] ans = new int[v.length]; for (int k = 0; k < v.length; k++) ans[k] = (int) v[k]; return (ans); } public static int[] toInt(long[] v) { final int[] ans = new int[v.length]; for (int k = 0; k < v.length; k++) ans[k] = (int) v[k]; return (ans); } public static int[][] toInt(float[][] v) { final int[][] ans = new int[v.length][]; for (int k = 0; k < v.length; k++) ans[k] = toInt(v[k]); return (ans); } public static int[][] toInt(double[][] v) { final int[][] ans = new int[v.length][]; for (int k = 0; k < v.length; k++) ans[k] = toInt(v[k]); return (ans); } public static int[][] toInt(long[][] v) { final int[][] ans = new int[v.length][]; for (int k = 0; k < v.length; k++) ans[k] = toInt(v[k]); return (ans); } }