public static int cardinality(long[] v){
  int sum=0;
  for (int i=0; i < v.length; i++) {
    sum+=Long.bitCount(v[i]);
  }
  return sum;
}

public static int cardinality ( long [ ] v ) { int sum = 0 ; for ( int i = 0 ; i < v . length ; i ++ ) { sum += Long . bitCount ( v [ i ] ) ; } return sum ; }
compute the cardinality ( number of set bits ) low - endian layout for the array .
