test_class.file: ml/streaminer/src/test/java/org/streaminer/stream/cardinality/FlajoletMartinTest.java
test_class.identifier: FlajoletMartinTest
test_case.body: @Test
      public void testOffer() {
          System.out.println("offer");
          FlajoletMartin instance = new FlajoletMartin(32, 1024, 32);
          
          long cardinality = 500L;
          
          for (long i = 0; i < cardinality; i++) {
              instance.offer(Long.valueOf(i));
              if (i % 50 == 0) {
                  System.out.println("actual: " + i + ", estimated: " + instance.cardinality());
              }
          }
  
          System.out.println("actual: " + cardinality + ", estimated: " + instance.cardinality());
          
          assertEquals(cardinality, instance.cardinality(), 100);
      }
test_case.class_method_signature: FlajoletMartinTest.testOffer()
test_case.full_signature: @Test public void testOffer()
test_case.identifier: testOffer
test_case.invocations: println offer valueOf println cardinality println cardinality assertEquals cardinality
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testOffer()
focal_class.declarator: PHI = 0.77351D
focal_class.modifier: private static final
focal_class.original_string: private static final double PHI = 0.77351D;
focal_class.type: double
focal_class.var_name: PHI
focal_class.declarator: numHashGroups
focal_class.modifier: private
focal_class.original_string: private int numHashGroups;
focal_class.type: int
focal_class.var_name: numHashGroups
focal_class.declarator: numHashFunctionsInHashGroup
focal_class.modifier: private
focal_class.original_string: private int numHashFunctionsInHashGroup;
focal_class.type: int
focal_class.var_name: numHashFunctionsInHashGroup
focal_class.declarator: hashes
focal_class.modifier: private
focal_class.original_string: private HashFunction[][] hashes;
focal_class.type: HashFunction[][]
focal_class.var_name: hashes
focal_class.declarator: bitmapSize
focal_class.modifier: private
focal_class.original_string: private int bitmapSize;
focal_class.type: int
focal_class.var_name: bitmapSize
focal_class.declarator: bitmaps
focal_class.modifier: private
focal_class.original_string: private boolean[][][] bitmaps;
focal_class.type: boolean[][][]
focal_class.var_name: bitmaps
focal_class.declarator: numWords
focal_class.modifier: private
focal_class.original_string: private long numWords;
focal_class.type: long
focal_class.var_name: numWords
focal_class.file: ml/streaminer/src/main/java/org/streaminer/stream/cardinality/FlajoletMartin.java
focal_class.identifier: FlajoletMartin
focal_class.class_method_signature: FlajoletMartin.FlajoletMartin(int bitmapSize, int numHashGroups, int numHashFunctionsInEachGroup)
focal_class.full_signature: public  FlajoletMartin(int bitmapSize, int numHashGroups, int numHashFunctionsInEachGroup)
focal_class.identifier: FlajoletMartin
focal_class.modifiers: public
focal_class.parameters: (int bitmapSize, int numHashGroups, int numHashFunctionsInEachGroup)
focal_class.signature:  FlajoletMartin(int bitmapSize, int numHashGroups, int numHashFunctionsInEachGroup)
focal_class.class_method_signature: FlajoletMartin.generateHashFunctions()
focal_class.full_signature: private void generateHashFunctions()
focal_class.identifier: generateHashFunctions
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void generateHashFunctions()
focal_class.class_method_signature: FlajoletMartin.generateUniqueHashFunction(Map<Integer, Collection<Integer>> mnMap)
focal_class.full_signature: private HashFunction generateUniqueHashFunction(Map<Integer, Collection<Integer>> mnMap)
focal_class.identifier: generateUniqueHashFunction
focal_class.modifiers: private
focal_class.parameters: (Map<Integer, Collection<Integer>> mnMap)
focal_class.return: HashFunction
focal_class.signature: HashFunction generateUniqueHashFunction(Map<Integer, Collection<Integer>> mnMap)
focal_class.class_method_signature: FlajoletMartin.contains(Map<Integer, Collection<Integer>> map, int m, int n)
focal_class.full_signature: private static boolean contains(Map<Integer, Collection<Integer>> map, int m, int n)
focal_class.identifier: contains
focal_class.modifiers: private static
focal_class.parameters: (Map<Integer, Collection<Integer>> map, int m, int n)
focal_class.return: boolean
focal_class.signature: boolean contains(Map<Integer, Collection<Integer>> map, int m, int n)
focal_class.class_method_signature: FlajoletMartin.offer(Object o)
focal_class.full_signature: public boolean offer(Object o)
focal_class.identifier: offer
focal_class.modifiers: public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean offer(Object o)
focal_class.class_method_signature: FlajoletMartin.cardinality()
focal_class.full_signature: public long cardinality()
focal_class.identifier: cardinality
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long cardinality()
focal_class.class_method_signature: FlajoletMartin.rho(long v)
focal_class.full_signature: private int rho(long v)
focal_class.identifier: rho
focal_class.modifiers: private
focal_class.parameters: (long v)
focal_class.return: int
focal_class.signature: int rho(long v)
focal_class.class_method_signature: FlajoletMartin.getFirstZeroBit(boolean[] b)
focal_class.full_signature: private static int getFirstZeroBit(boolean[] b)
focal_class.identifier: getFirstZeroBit
focal_class.modifiers: private static
focal_class.parameters: (boolean[] b)
focal_class.return: int
focal_class.signature: int getFirstZeroBit(boolean[] b)
focal_method.body: public boolean offer(Object o) {
          boolean affected = false;
  
          for (int i=0; i<numHashGroups; i++) {
              for (int j=0; j<numHashFunctionsInHashGroup; j++) {
                  HashFunction f = hashes[i][j];
                  long v = f.hash(o);
                  int index = rho(v);
                  if (!bitmaps[i][j][index]) {
                      bitmaps[i][j][index] = true;
                      affected = true;
                  }
              }
          }
  
          return affected;
      }
focal_method.class_method_signature: FlajoletMartin.offer(Object o)
focal_method.full_signature: public boolean offer(Object o)
focal_method.identifier: offer
focal_method.invocations: hash rho
focal_method.modifiers: public
focal_method.parameters: (Object o)
focal_method.return: boolean
focal_method.signature: boolean offer(Object o)