code: public static int configIdToLibDaiIx(int configId, VarSet vs) {
          int[] indices = vs.getVarConfigAsArray(configId);
          int[] dims = vs.getDims();
          return Tensor.ravelIndexMatlab(indices, dims);
      }
docs: converts the internal pacaya index of a config on the varset into the
  libdai index corresponding to the same configuration