public static void divide(int n,ArrayList<ArrayList<Double>>allMatrix,ArrayList<ArrayList<Double>>testSample,ArrayList<ArrayList<Double>>trainSample){
		HashMap<Double,ArrayList<ArrayList<Double>>>allMap=new HashMap<Double,ArrayList<ArrayList<Double>>>();
		int size=allMatrix.size();
		int vector_size=allMatrix.get(0).size();
		for(int i=0;i<size;i++){
			Double classify=allMatrix.get(i).get(vector_size-1);
			if(!allMap.containsKey(classify)){
				ArrayList<ArrayList<Double>>vectors=new ArrayList<ArrayList<Double>>();
				vectors.add(allMatrix.get(i));
				allMap.put(classify, vectors);
			}
			else{
				allMap.get(classify).add(allMatrix.get(i));
			}
		}
		
		Set<Double>classifys=allMap.keySet();
		for(Double classify:classifys){
			ArrayList<ArrayList<Double>>vectors=allMap.get(classify);
			for(int i=0;i<vectors.size();i++){
				if(i>=10*n&&i<(n+1)*10){
					testSample.add(vectors.get(i));
				}
				else{
					trainSample.add(vectors.get(i));
				}
			}
		}
	}