Java Set Cardinality cardinality(final int from, final int to, final long[] words)

Here you can find the source of cardinality(final int from, final int to, final long[] words)

Description

cardinality

License

Apache License

Declaration

private static int cardinality(final int from, final int to, final long[] words) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static int cardinality(final int from, final int to, final long[] words) {
        int sum = 0;
        for (int i = from; i < to; i++) {
            sum += Long.bitCount(words[i]);
        }/*from   w ww . j a v  a 2 s  .  c o  m*/
        return sum;
    }
}

Related

  1. cardinality(byte b)
  2. cardinality(long v)
  3. cardinalityInBitmapRange(long[] bitmap, int start, int end)
  4. cardinalityInBitmapWordRange(long[] bitmap, int start, int end)