code: private int getTableAccessOffset(int[] assignment) {
          assert(assignment.length == dimensions.length);
          int offset = 0;
          for (int i = 0; i < assignment.length; i++) {
              assert(assignment[i] < dimensions[i]);
              offset = (offset*dimensions[i]) + assignment[i];
          }
          return offset;
      }
docs: Compute the distance into the one dimensional factorTable array that corresponds to a setting of all the
  neighbors of the factor.
  @param assignment assignment indices, in same order as neighbors array
  @return the offset index