@@ -1333,12 +1333,12 @@ function (|)(B::BitArray, x::Bool)
1333
1333
end
1334
1334
(| )(x:: Bool , B:: BitArray ) = B | x
1335
1335
1336
- function ( $ ) (B:: BitArray , x:: Bool )
1336
+ function xor (B:: BitArray , x:: Bool )
1337
1337
x ? ~ B : copy (B)
1338
1338
end
1339
- ( $ )( x:: Bool , B:: BitArray ) = B $ x
1339
+ xor ( x:: Bool , B:: BitArray ) = xor (B, x)
1340
1340
1341
- for f in (:& , :| , :$ )
1341
+ for f in (:& , :| , :xor )
1342
1342
@eval begin
1343
1343
function ($ f)(A:: BitArray , B:: BitArray )
1344
1344
F = BitArray (promote_shape (size (A),size (B))... )
@@ -2007,10 +2007,10 @@ end
2007
2007
2008
2008
map! (f:: Union{typeof(*), typeof(min)} , dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (& , dest, A, B)
2009
2009
map! (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)
2011
2011
map! (f:: Union{typeof(>=), typeof(^)} , dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (BitChunkFunctor ((p, q) -> p | ~ q), dest, A, B)
2012
2012
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) -> ~ (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)
2014
2014
map! (f:: typeof (< ), dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (BitChunkFunctor ((p, q) -> ~ p & q), dest, A, B)
2015
2015
map! (f:: typeof (> ), dest:: BitArray , A:: BitArray , B:: BitArray ) = map! (BitChunkFunctor ((p, q) -> p & ~ q), dest, A, B)
2016
2016
@@ -2028,7 +2028,7 @@ function map!(f::Union{typeof(identity), typeof(~)}, dest::BitArray, A::BitArray
2028
2028
destc[end ] = f (Ac[end ]) & _msk_end (A)
2029
2029
dest
2030
2030
end
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 )
2032
2032
size (A) == size (B) == size (dest) || throw (DimensionMismatch (" sizes of dest, A, and B must all match" ))
2033
2033
isempty (A) && return dest
2034
2034
destc = dest. chunks
@@ -2056,12 +2056,12 @@ transpose(B::BitVector) = reshape(copy(B), 1, length(B))
2056
2056
# http://www.hackersdelight.org/hdcodetxt/transpose8.c.txt
2057
2057
function transpose8x8 (x:: UInt64 )
2058
2058
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 )
2065
2065
end
2066
2066
2067
2067
function form_8x8_chunk (Bc:: Vector{UInt64} , i1:: Int , i2:: Int , m:: Int , cgap:: Int , cinc:: Int , nc:: Int , msk8:: UInt64 )
0 commit comments