@@ -1333,12 +1333,12 @@ function (|)(B::BitArray, x::Bool)
13331333end
13341334(| )(x:: Bool , B:: BitArray ) = B | x
13351335
1336- function ( $ ) (B:: BitArray , x:: Bool )
1336+ function xor (B:: BitArray , x:: Bool )
13371337 x ? ~ B : copy (B)
13381338end
1339- ( $ )( x:: Bool , B:: BitArray ) = B $ x
1339+ xor ( x:: Bool , B:: BitArray ) = xor (B, x)
13401340
1341- for f in (:& , :| , :$ )
1341+ for f in (:& , :| , :xor )
13421342 @eval begin
13431343 function ($ f)(A:: BitArray , B:: BitArray )
13441344 F = BitArray (promote_shape (size (A),size (B))... )
@@ -2007,10 +2007,10 @@ end
20072007
20082008map! (f:: Union{typeof(*), typeof(min)} , dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (& , dest, A, B)
20092009map! (f:: typeof (max), dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (| , dest, A, B)
2010- map! (f:: typeof (!= ), dest:: BitArray , A:: BitArray , B:: BitArray ) = map! ($ , dest, A, B)
2010+ map! (f:: typeof (!= ), dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (xor , dest, A, B)
20112011map! (f:: Union{typeof(>=), typeof(^)} , dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (BitChunkFunctor ((p, q) -> p | ~ q), dest, A, B)
20122012map! (f:: typeof (<= ), dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (BitChunkFunctor ((p, q) -> ~ p | q), dest, A, B)
2013- map! (f:: typeof (== ), dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (BitChunkFunctor ((p, q) -> ~ (p $ q)), dest, A, B)
2013+ map! (f:: typeof (== ), dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (BitChunkFunctor ((p, q) -> ~ xor (p, q)), dest, A, B)
20142014map! (f:: typeof (< ), dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (BitChunkFunctor ((p, q) -> ~ p & q), dest, A, B)
20152015map! (f:: typeof (> ), dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (BitChunkFunctor ((p, q) -> p & ~ q), dest, A, B)
20162016
@@ -2028,7 +2028,7 @@ function map!(f::Union{typeof(identity), typeof(~)}, dest::BitArray, A::BitArray
20282028 destc[end ] = f (Ac[end ]) & _msk_end (A)
20292029 dest
20302030end
2031- function map! (f:: Union{BitChunkFunctor, typeof(&), typeof(|), typeof($ )} , dest:: BitArray , A:: BitArray , B:: BitArray )
2031+ function map! (f:: Union{BitChunkFunctor, typeof(&), typeof(|), typeof(xor )} , dest:: BitArray , A:: BitArray , B:: BitArray )
20322032 size (A) == size (B) == size (dest) || throw (DimensionMismatch (" sizes of dest, A, and B must all match" ))
20332033 isempty (A) && return dest
20342034 destc = dest. chunks
@@ -2056,12 +2056,12 @@ transpose(B::BitVector) = reshape(copy(B), 1, length(B))
20562056# http://www.hackersdelight.org/hdcodetxt/transpose8.c.txt
20572057function transpose8x8 (x:: UInt64 )
20582058 y = x
2059- t = (y $ ( y >>> 7 ) ) & 0x00aa00aa00aa00aa
2060- y = y $ t $ ( t << 7 )
2061- t = (y $ ( y >>> 14 ) ) & 0x0000cccc0000cccc
2062- y = y $ t $ ( t << 14 )
2063- t = (y $ ( y >>> 28 ) ) & 0x00000000f0f0f0f0
2064- return y $ t $ ( t << 28 )
2059+ t = xor (y, y >>> 7 ) & 0x00aa00aa00aa00aa
2060+ y = xor (y, t, t << 7 )
2061+ t = xor (y, y >>> 14 ) & 0x0000cccc0000cccc
2062+ y = xor (y, t, t << 14 )
2063+ t = xor (y, y >>> 28 ) & 0x00000000f0f0f0f0
2064+ return xor (y, t, t << 28 )
20652065end
20662066
20672067function form_8x8_chunk (Bc:: Vector{UInt64} , i1:: Int , i2:: Int , m:: Int , cgap:: Int , cinc:: Int , nc:: Int , msk8:: UInt64 )
0 commit comments