@@ -13,7 +13,7 @@ tc(r1,r2) = false
13
13
bitcheck (b:: BitArray ) = Base. _check_bitarray_consistency (b)
14
14
bitcheck (x) = true
15
15
16
- function check_bitop (ret_type, func, args... )
16
+ function check_bitop_call (ret_type, func, args... )
17
17
r1 = func (args... )
18
18
r2 = func (map (x-> (isa (x, BitArray) ? Array (x) : x), args)... )
19
19
ret_type ≢ nothing && ! isa (r1, ret_type) && @show ret_type, r1
@@ -22,15 +22,13 @@ function check_bitop(ret_type, func, args...)
22
22
@test isequal (r1, ret_type ≡ nothing ? r2 : convert (ret_type, r2))
23
23
@test bitcheck (r1)
24
24
end
25
-
26
25
macro check_bit_operation (ex, ret_type)
27
26
@assert Meta. isexpr (ex, :call )
28
- Expr (:call , :check_bitop , esc (ret_type), map (esc,ex. args)... )
27
+ Expr (:call , :check_bitop_call , esc (ret_type), map (esc, ex. args)... )
29
28
end
30
-
31
29
macro check_bit_operation (ex)
32
30
@assert Meta. isexpr (ex, :call )
33
- Expr (:call , :check_bitop , nothing , map (esc,ex. args)... )
31
+ Expr (:call , :check_bitop_call , nothing , map (esc,ex. args)... )
34
32
end
35
33
36
34
let t0 = time ()
@@ -794,11 +792,11 @@ let b1 = bitrand(n1, n2)
794
792
795
793
b2 = trues (n1, n2)
796
794
@check_bit_operation div (b1, b2) BitMatrix
797
- @check_bit_operation mod ( b1, b2) BitMatrix
795
+ @check_bit_operation broadcast (mod, b1, b2) BitMatrix
798
796
@check_bit_operation div (b1,Array (b2)) BitMatrix
799
- @check_bit_operation mod ( b1,Array (b2)) BitMatrix
797
+ @check_bit_operation broadcast (mod, b1, Array (b2)) BitMatrix
800
798
@check_bit_operation div (Array (b1),b2) BitMatrix
801
- @check_bit_operation mod ( Array (b1),b2) BitMatrix
799
+ @check_bit_operation broadcast (mod, Array (b1), b2) BitMatrix
802
800
end
803
801
804
802
let b1 = bitrand (n1, n1)
@@ -833,7 +831,7 @@ let b1 = bitrand(n1, n2)
833
831
@check_bit_operation broadcast (/ , b1, i2) Matrix{Float64}
834
832
@check_bit_operation broadcast (^ , b1, i2) BitMatrix
835
833
@check_bit_operation div (b1, i2) Matrix{Int}
836
- @check_bit_operation mod ( b1, i2) Matrix{Int}
834
+ @check_bit_operation broadcast (mod, b1, i2) Matrix{Int}
837
835
end
838
836
839
837
# Matrix{Bool}/Matrix{Float64}
@@ -844,7 +842,7 @@ let b1 = bitrand(n1, n2)
844
842
@check_bit_operation broadcast (/ , b1, f2) Matrix{Float64}
845
843
@check_bit_operation broadcast (^ , b1, f2) Matrix{Float64}
846
844
@check_bit_operation div (b1, f2) Matrix{Float64}
847
- @check_bit_operation mod ( b1, f2) Matrix{Float64}
845
+ @check_bit_operation broadcast (mod, b1, f2) Matrix{Float64}
848
846
end
849
847
850
848
# Number/Matrix
@@ -883,22 +881,22 @@ let b2 = bitrand(n1, n2)
883
881
b2 = trues (n1, n2)
884
882
@check_bit_operation broadcast (/ , true , b2) Matrix{Float64}
885
883
@check_bit_operation div (true , b2) BitMatrix
886
- @check_bit_operation mod ( true , b2) BitMatrix
884
+ @check_bit_operation broadcast (mod, true , b2) BitMatrix
887
885
@check_bit_operation broadcast (/ , false , b2) Matrix{Float64}
888
886
@check_bit_operation div (false , b2) BitMatrix
889
- @check_bit_operation mod ( false , b2) BitMatrix
887
+ @check_bit_operation broadcast (mod, false , b2) BitMatrix
890
888
891
889
@check_bit_operation broadcast (/ , i1, b2) Matrix{Float64}
892
890
@check_bit_operation div (i1, b2) Matrix{Int}
893
- @check_bit_operation mod ( i1, b2) Matrix{Int}
891
+ @check_bit_operation broadcast (mod, i1, b2) Matrix{Int}
894
892
895
893
@check_bit_operation broadcast (/ , u1, b2) Matrix{Float64}
896
894
@check_bit_operation div (u1, b2) Matrix{UInt8}
897
- @check_bit_operation mod ( u1, b2) Matrix{UInt8}
895
+ @check_bit_operation broadcast (mod, u1, b2) Matrix{UInt8}
898
896
899
897
@check_bit_operation broadcast (/ , f1, b2) Matrix{Float64}
900
898
@check_bit_operation div (f1, b2) Matrix{Float64}
901
- @check_bit_operation mod ( f1, b2) Matrix{Float64}
899
+ @check_bit_operation broadcast (mod, f1, b2) Matrix{Float64}
902
900
903
901
@check_bit_operation broadcast (/ , ci1, b2) Matrix{Complex128}
904
902
@check_bit_operation broadcast (/ , cu1, b2) Matrix{Complex128}
@@ -956,7 +954,7 @@ let b1 = bitrand(n1, n2)
956
954
@check_bit_operation broadcast (/ , b1, true ) Matrix{Float64}
957
955
@check_bit_operation broadcast (/ , b1, false ) Matrix{Float64}
958
956
@check_bit_operation div (b1, true ) BitMatrix
959
- @check_bit_operation mod ( b1, true ) BitMatrix
957
+ @check_bit_operation broadcast (mod, b1, true ) BitMatrix
960
958
961
959
@check_bit_operation (& )(b1, b2) BitMatrix
962
960
@check_bit_operation (| )(b1, b2) BitMatrix
@@ -972,7 +970,7 @@ let b1 = bitrand(n1, n2)
972
970
@check_bit_operation broadcast (* , b1, i2) Matrix{Int}
973
971
@check_bit_operation broadcast (/ , b1, i2) Matrix{Float64}
974
972
@check_bit_operation div (b1, i2) Matrix{Int}
975
- @check_bit_operation mod ( b1, i2) Matrix{Int}
973
+ @check_bit_operation broadcast (mod, b1, i2) Matrix{Int}
976
974
977
975
@check_bit_operation (& )(b1, u2) Matrix{UInt8}
978
976
@check_bit_operation (| )(b1, u2) Matrix{UInt8}
@@ -982,14 +980,14 @@ let b1 = bitrand(n1, n2)
982
980
@check_bit_operation broadcast (* , b1, u2) Matrix{UInt8}
983
981
@check_bit_operation broadcast (/ , b1, u2) Matrix{Float64}
984
982
@check_bit_operation div (b1, u2) Matrix{UInt8}
985
- @check_bit_operation mod ( b1, u2) Matrix{UInt8}
983
+ @check_bit_operation broadcast (mod, b1, u2) Matrix{UInt8}
986
984
987
985
@check_bit_operation broadcast (+ , b1, f2) Matrix{Float64}
988
986
@check_bit_operation broadcast (- , b1, f2) Matrix{Float64}
989
987
@check_bit_operation broadcast (* , b1, f2) Matrix{Float64}
990
988
@check_bit_operation broadcast (/ , b1, f2) Matrix{Float64}
991
989
@check_bit_operation div (b1, f2) Matrix{Float64}
992
- @check_bit_operation mod ( b1, f2) Matrix{Float64}
990
+ @check_bit_operation broadcast (mod, b1, f2) Matrix{Float64}
993
991
994
992
@check_bit_operation broadcast (+ , b1, ci2) Matrix{Complex{Int}}
995
993
@check_bit_operation broadcast (- , b1, ci2) Matrix{Complex{Int}}
0 commit comments