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);
}

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 ) ; }
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 .
