public int LocationOf(int[] perm){
		int index = 0;//row index of permutation. 
		for(int j = 1; j < perm.length; j++){
			while(AllPerms[index][j] != perm[j]){
				index++;
			}
		}
		return index;
	}