Here you can find the source of invertRelabeling(int[] relabeling, int[] uniqueVars, int maxVarNum)
private static int[] invertRelabeling(int[] relabeling, int[] uniqueVars, int maxVarNum)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { private static int[] invertRelabeling(int[] relabeling, int[] uniqueVars, int maxVarNum) { int[] inverseRelabeling = new int[maxVarNum + 1]; Arrays.fill(inverseRelabeling, -1); for (int i = 0; i < relabeling.length; i++) { if (relabeling[i] != -1) { inverseRelabeling[relabeling[i]] = uniqueVars[i]; }//w w w.j a v a 2 s . co m } return inverseRelabeling; } }