Tue May 20 21:19:11 2025 bvec_test(): python version: 3.10.12 numpy version: 1.26.4 Test bvec(). bvec_add_test(): bvec_add() adds binary vectors representing integers; I J K = I + J Kb = Ib + Jb 90 -79 11 11 -94 39 -55 -55 97 8 105 105 -43 92 49 49 -73 35 -38 -38 -76 14 -62 -62 86 -26 60 60 8 98 106 106 -94 -5 -99 -99 98 -3 95 95 bvec_complement2_test(): bvec_complement2() returns the twos complement of a (signed) binary vector; 1110100100 0001011100 0001011011 1110100101 0000000101 1111111011 0000001110 1111110010 0001010100 1110101100 bvec_mul_test(): bvec_mul() multiplies binary vectors representing integers; I J I * J bvec_mul -88 -41 3608 3608 93 34 3162 3162 -86 37 -3182 -3182 -18 -31 558 558 -69 84 -5796 -5796 0 1 0 0 95 65 6175 6175 100 90 9000 9000 49 72 3528 3528 -49 -23 1127 1127 bvec_next_test(): bvec_next() computes the "next" BVEC. 0000 1000 0100 1100 0010 1010 0110 1110 0001 1001 0101 1101 0011 1011 0111 1111 0000 bvec_next_grlex_test(): bvec_next_grlex() computes binary vectors in GRLEX order. 0: 0000 1: 0001 2: 0010 3: 0100 4: 1000 5: 0011 6: 0101 7: 0110 8: 1001 9: 1010 10: 1100 11: 0111 12: 1011 13: 1101 14: 1110 15: 1111 16: 0000 bvec_print_test(): bvec_print() prints a binary vector. BVEC: 0011101001 bvec_sub_test(): bvec_sub() subtracts binary vectors representing integers; I J K = I - J Kb = Ib - Jb -44 61 -105 -105 -39 30 -69 -69 82 7 75 75 -2 85 -87 -87 13 8 5 5 -51 -61 10 10 83 37 46 46 83 -96 179 179 26 68 -42 -42 97 68 29 29 bvec_to_i4_test(): bvec_to_i4() converts a signed binary vector to an integer; I --> BVEC --> I -3 1111111101 -3 -2 1111111110 -2 -1 1111111111 -1 0 0000000000 0 1 0000000001 1 2 0000000010 2 3 0000000011 3 4 0000000100 4 5 0000000101 5 6 0000000110 6 7 0000000111 7 8 0000001000 8 9 0000001001 9 10 0000001010 10 bvec_uniform_test(): bvec_uniform() computes a random BVEC. 0101111101 1010011011 1100000001 1100000011 1000111101 0111000010 1011110111 0110101100 1110100000 1101100011 i4_bclr_test(): i4_bclr() sets a given bit to 0. Working on I4 = 101 Pos i4_bclr(I4,Pos) 0 100 1 101 2 97 3 101 4 101 5 69 6 37 7 101 8 101 9 101 10 101 11 101 12 101 13 101 14 101 15 101 16 101 17 101 18 101 19 101 20 101 21 101 22 101 23 101 24 101 25 101 26 101 27 101 28 101 29 101 30 101 31 101 Working on I4 = -31 Pos i4_bclr(I4,Pos) 0 -32 1 -31 2 -31 3 -31 4 -31 5 -63 6 -95 7 -159 8 -287 9 -543 10 -1055 11 -2079 12 -4127 13 -8223 14 -16415 15 -32799 16 -65567 17 -131103 18 -262175 19 -524319 20 -1048607 21 -2097183 22 -4194335 23 -8388639 24 -16777247 25 -33554463 26 -67108895 27 -134217759 28 -268435487 29 -536870943 30 -1073741855 31 2147483617 i4_bset_test(): i4_bset() sets a given bit to 1. Working on I4 = 101 Pos i4_bset(I4,Pos) 0 101 1 103 2 101 3 109 4 117 5 101 6 101 7 229 8 357 9 613 10 1125 11 2149 12 4197 13 8293 14 16485 15 32869 16 65637 17 131173 18 262245 19 524389 20 1048677 21 2097253 22 4194405 23 8388709 24 16777317 25 33554533 26 67108965 27 134217829 28 268435557 29 536871013 30 1073741925 31 -2147483547 Working on I4 = -31 Pos i4_bset(I4,Pos) 0 -31 1 -29 2 -27 3 -23 4 -15 5 -31 6 -31 7 -31 8 -31 9 -31 10 -31 11 -31 12 -31 13 -31 14 -31 15 -31 16 -31 17 -31 18 -31 19 -31 20 -31 21 -31 22 -31 23 -31 24 -31 25 -31 26 -31 27 -31 28 -31 29 -31 30 -31 31 -31 i4_btest_test(): i4_btest() reports whether a given bit is 0 or 1. Analyze the integer I4 = 101 Pos i4_btest(I4,POS) 0 True 1 False 2 True 3 False 4 False 5 True 6 True 7 False 8 False 9 False 10 False 11 False 12 False 13 False 14 False 15 False 16 False 17 False 18 False 19 False 20 False 21 False 22 False 23 False 24 False 25 False 26 False 27 False 28 False 29 False 30 False 31 False Analyze the integer I4 = -31 Pos i4_btest(I4,POS) 0 True 1 False 2 False 3 False 4 False 5 True 6 True 7 True 8 True 9 True 10 True 11 True 12 True 13 True 14 True 15 True 16 True 17 True 18 True 19 True 20 True 21 True 22 True 23 True 24 True 25 True 26 True 27 True 28 True 29 True 30 True 31 True i4_to_bvec_test(): i4_to_bvec() converts an integer to a signed binary vector. I --> BVEC --> I -3 1111111101 -3 -2 1111111110 -2 -1 1111111111 -1 0 0000000000 0 1 0000000001 1 2 0000000010 2 3 0000000011 3 4 0000000100 4 5 0000000101 5 6 0000000110 6 7 0000000111 7 8 0000001000 8 9 0000001001 9 10 0000001010 10 bvec_test(): Normal end of execution. Tue May 20 21:19:11 2025