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 ; }
Compute the distance into the one dimensional factorTable array that corresponds to a setting of all the neighbors of the factor .