public static int cardinality(final IteratingRLW32 i) {
        int answer = 0;
        while (true) {
            if (i.getRunningBit())
                answer += i.getRunningLength()
                        * EWAHCompressedBitmap32.WORD_IN_BITS;
            int il = i.getNumberOfLiteralWords();
            for (int k = 0; k < il; ++k)
                answer += Integer.bitCount(i.getLiteralWordAt(k));
            if (!i.next())
                break;
        }
        return answer;
    }
public static int cardinality ( final IteratingRLW32 i ) { int answer = 0 ; while ( true ) { if ( i . getRunningBit ( ) ) answer += i . getRunningLength ( ) * EWAHCompressedBitmap32 . WORD_IN_BITS ; int il = i . getNumberOfLiteralWords ( ) ; for ( int k = 0 ; k < il ; ++ k ) answer += Integer . bitCount ( i . getLiteralWordAt ( k ) ) ; if ( ! i . next ( ) ) break ; } return answer ; }
@param i iterator we wish to iterate over
@return the cardinality (number of set bits) corresponding to the
iterator