question: protected synchronized void superposeBitSet ( FixedBitSet incomingBitSet , double weight ) { weight = ( int ) Math . round ( weight * Math . pow ( 10 , BINARY_VECTOR_DECIMAL_PLACES ) ) ; if ( weight == 0 ) return ; totalNumberOfVotes . set ( totalNumberOfVotes . get ( ) + ( int ) weight ) ; int logFloorOfWeight = ( int ) ( Math . floor ( Math . log ( weight ) / Math . log ( 2 ) ) ) ; if ( logFloorOfWeight < votingRecord . size ( ) - 1 ) { while ( logFloorOfWeight > 0 ) { superposeBitSetFromRowFloor ( incomingBitSet , logFloorOfWeight ) ; weight = weight - ( int ) Math . pow ( 2 , logFloorOfWeight ) ; logFloorOfWeight = ( int ) ( Math . floor ( Math . log ( weight ) / Math . log ( 2 ) ) ) ; } } for ( int x = 0 ; x < weight ; x ++ ) superposeBitSetFromRowFloor ( incomingBitSet , 0 ) ; }
target:  This method is the first of two required to facilitate superposition. The underlying representation (i.e. the voting record) is an ArrayList of FixedBitSet, each with dimension "dimension", which can be thought of as an expanding 2D array of bits. Each column keeps count (in binary) for the respective dimension, and columns are incremented in parallel by sweeping a bitset across the rows. In any dimension in which the BitSet to be added contains a "1", the effect will be that 1's are changed to 0's until a new 1 is added (e.g. the column '110' would become '001' and so forth). The first method deals with floating point issues, and accelerates superposition by decomposing the task into segments.