Exemplo n.º 1
0
    def test_3_hamming(self):
        '''distance::hamming 2..............................................'''
        a = np.random.randint(2,size=1769472) > 0
        b = np.random.randint(2,size=1769472) > 0
        
        bin_hamming = pv.hamming(a,b)

        a = pv.boolToUbyte(a)
        b = pv.boolToUbyte(b)
        
        byte_hamming = pv.hamming(a,b)
        
        self.assertEqual(bin_hamming,byte_hamming)
Exemplo n.º 2
0
    def test_3_hamming(self):
        '''distance::hamming 2..............................................'''
        a = np.random.randint(2, size=1769472) > 0
        b = np.random.randint(2, size=1769472) > 0

        bin_hamming = pv.hamming(a, b)

        a = pv.boolToUbyte(a)
        b = pv.boolToUbyte(b)

        byte_hamming = pv.hamming(a, b)

        self.assertEqual(bin_hamming, byte_hamming)