Here you can find the source of toArrayList(int[] p)
public static ArrayList<Integer> toArrayList(int[] p)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static ArrayList<Integer> toArrayList(int[] p) { ArrayList<Integer> ret = new ArrayList<>(); for (int i = 0; i < p.length; i++) { ret.add(i);//from w w w . ja va2s .c o m } return ret; } public static double[][] add(double[][] a, double[][] b) { double[][] d = new double[a.length][a[0].length]; if (isIdenticalMatrix(a, b)) { for (int i = 0; i < a.length; i++) { for (int j = 0; j < a[0].length; j++) { d[i][j] = a[i][j] + b[i][j]; } } } else { } return d; } private static boolean isIdenticalMatrix(double[][] a, double[][] b) { if (a.length == b.length && a[0].length == b[0].length) { return true; } else { return false; } } }