test_class.file: src/com/aestel/chemistry/openEye/fp/LongFingerprintTest.java
test_class.identifier: LongFingerprintTest
test_case.body: @Test()
     public void testTanimoto()
     {  assert new LongFingerprint("7F8")
           .tanimoto(new LongFingerprint("7F8"))
           == 1D;
  
        assert new LongFingerprint("FFA")        //11111111 11
           .tanimoto(new LongFingerprint("7FA")) //01111111 11
           == 9D/10D;
  
        assert new LongFingerprint("FFA")         //1111 1111 1010
           .mtanimoto(new LongFingerprint("7FA")) //0111 1111 1010
           == 9D/11D;
  
        assert new LongFingerprint("FFA1")       //1111 1111 1010 0001
           .tanimoto(new LongFingerprint("7FA")) //0111 1111 1010 0000
           == 9D/(11+9-9);
  
        // ed80000040000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
        // edc000004000000080
        assert new LongFingerprint(
              new SparseFingerprint(new int[] {0,1,2,33,4,5,64,7,8,999}).getHexString())
           .tanimoto(new LongFingerprint(
                 new SparseFingerprint(new int[] { 0,1,2,33,4,5,64,7,8,9}).getHexString()))
           == 9D/11D;
     }
test_case.class_method_signature: LongFingerprintTest.testTanimoto()
test_case.full_signature: @Test() public void testTanimoto()
test_case.identifier: testTanimoto
test_case.invocations: tanimoto tanimoto mtanimoto tanimoto tanimoto getHexString getHexString
test_case.modifiers: @Test() public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testTanimoto()
focal_class.declarator: longs
focal_class.modifier: private final
focal_class.original_string: private final long[] longs;
focal_class.type: long[]
focal_class.var_name: longs
focal_class.declarator: nBits
focal_class.modifier: private final
focal_class.original_string: private final int nBits;
focal_class.type: int
focal_class.var_name: nBits
focal_class.file: src/com/aestel/chemistry/openEye/fp/LongFingerprint.java
focal_class.identifier: LongFingerprint
focal_class.interfaces: implements Fingerprint
focal_class.class_method_signature: LongFingerprint.LongFingerprint(String hex)
focal_class.full_signature: public  LongFingerprint(String hex)
focal_class.identifier: LongFingerprint
focal_class.modifiers: public
focal_class.parameters: (String hex)
focal_class.signature:  LongFingerprint(String hex)
focal_class.class_method_signature: LongFingerprint.myParseLong(String hexStr)
focal_class.full_signature: private static long myParseLong(String hexStr)
focal_class.identifier: myParseLong
focal_class.modifiers: private static
focal_class.parameters: (String hexStr)
focal_class.return: long
focal_class.signature: long myParseLong(String hexStr)
focal_class.class_method_signature: LongFingerprint.LongFingerprint(long[] longs)
focal_class.full_signature: public  LongFingerprint(long[] longs)
focal_class.identifier: LongFingerprint
focal_class.modifiers: public
focal_class.parameters: (long[] longs)
focal_class.signature:  LongFingerprint(long[] longs)
focal_class.class_method_signature: LongFingerprint.tanimoto(Fingerprint other)
focal_class.full_signature: @Override public double tanimoto(Fingerprint other)
focal_class.identifier: tanimoto
focal_class.modifiers: @Override public
focal_class.parameters: (Fingerprint other)
focal_class.return: double
focal_class.signature: double tanimoto(Fingerprint other)
focal_class.class_method_signature: LongFingerprint.mtanimoto(Fingerprint other)
focal_class.full_signature: public double mtanimoto(Fingerprint other)
focal_class.identifier: mtanimoto
focal_class.modifiers: public
focal_class.parameters: (Fingerprint other)
focal_class.return: double
focal_class.signature: double mtanimoto(Fingerprint other)
focal_class.class_method_signature: LongFingerprint.fold(int size)
focal_class.full_signature: @Override public Fingerprint fold(int size)
focal_class.identifier: fold
focal_class.modifiers: @Override public
focal_class.parameters: (int size)
focal_class.return: Fingerprint
focal_class.signature: Fingerprint fold(int size)
focal_class.class_method_signature: LongFingerprint.getBinString()
focal_class.full_signature: @Override public String getBinString()
focal_class.identifier: getBinString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getBinString()
focal_class.class_method_signature: LongFingerprint.getBits()
focal_class.full_signature: @Override public int[] getBits()
focal_class.identifier: getBits
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int[]
focal_class.signature: int[] getBits()
focal_class.class_method_signature: LongFingerprint.getHexString()
focal_class.full_signature: @Override public String getHexString()
focal_class.identifier: getHexString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getHexString()
focal_class.class_method_signature: LongFingerprint.getNBits()
focal_class.full_signature: @Override public int getNBits()
focal_class.identifier: getNBits
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getNBits()
focal_class.class_method_signature: LongFingerprint.main(String ... args)
focal_class.full_signature: public static void main(String ... args)
focal_class.identifier: main
focal_class.modifiers: public static
focal_class.parameters: (String ... args)
focal_class.return: void
focal_class.signature: void main(String ... args)
focal_method.body: @Override
     public double tanimoto(Fingerprint other)
     {  if( ! (other instanceof LongFingerprint) )
           throw new Error("Not supported yet needs ByteFingerprint");
  
        if( this.nBits == 0 && other.getNBits() == 0) return 1;
  
        long[] fp_1 = this.longs;
        long[] fp_2 = ((LongFingerprint) other).longs;
  
        int andBitCount = 0;  // number of bits present in both
  
        int i=0;
        int len;
        len = Math.min(fp_1.length, fp_2.length);
  
        // we could possibly convert to long in 16 ops and then do the and/or
        // and count on the long values more efficiently but I am not sure
        for( ; i<len; i++)
        {  andBitCount += Long.bitCount(fp_1[i] & fp_2[i]);
        }
  
        return ( (double) andBitCount )/(this.nBits+other.getNBits()-andBitCount);
     }
focal_method.class_method_signature: LongFingerprint.tanimoto(Fingerprint other)
focal_method.full_signature: @Override public double tanimoto(Fingerprint other)
focal_method.identifier: tanimoto
focal_method.invocations: getNBits min bitCount getNBits
focal_method.modifiers: @Override public
focal_method.parameters: (Fingerprint other)
focal_method.return: double
focal_method.signature: double tanimoto(Fingerprint other)