@@ -24,30 +24,32 @@ function Base.ones(A::ArrayPartition)
24
24
B
25
25
end
26
26
27
- Base.:+ (A:: ArrayPartition , B:: ArrayPartition ) = ArrayPartition ((x .+ y for (x,y) in zip (A. x,B. x)). .. )
27
+ Base.:+ (A:: ArrayPartition , B:: ArrayPartition ) =
28
+ ArrayPartition ((x .+ y for (x,y) in zip (A. x,B. x)). .. )
28
29
Base.:+ (A:: Number , B:: ArrayPartition ) = ArrayPartition ((A .+ x for x in B. x). .. )
29
30
Base.:+ (A:: ArrayPartition , B:: Number ) = ArrayPartition ((B .+ x for x in A. x). .. )
30
- Base.:- (A:: ArrayPartition , B:: ArrayPartition ) = ArrayPartition ((x .- y for (x,y) in zip (A. x,B. x)). .. )
31
+ Base.:- (A:: ArrayPartition , B:: ArrayPartition ) =
32
+ ArrayPartition ((x .- y for (x,y) in zip (A. x,B. x)). .. )
31
33
Base.:- (A:: Number , B:: ArrayPartition ) = ArrayPartition ((A .- x for x in B. x). .. )
32
34
Base.:- (A:: ArrayPartition , B:: Number ) = ArrayPartition ((x .- B for x in A. x). .. )
33
35
Base.:* (A:: Number , B:: ArrayPartition ) = ArrayPartition ((A .* x for x in B. x). .. )
34
36
Base.:* (A:: ArrayPartition , B:: Number ) = ArrayPartition ((x .* B for x in A. x). .. )
35
37
Base.:/ (A:: ArrayPartition , B:: Number ) = ArrayPartition ((x ./ B for x in A. x). .. )
36
38
Base.:\ (A:: Number , B:: ArrayPartition ) = ArrayPartition ((x ./ A for x in B. x). .. )
37
39
38
- if VERSION < v " 0.6- "
39
- Base.:.+ (A:: ArrayPartition , B:: ArrayPartition ) = ArrayPartition ((x .+ y for (x,y) in zip (A . x,B . x)) . .. )
40
- Base.:.+ (A:: Number , B:: ArrayPartition ) = ArrayPartition ((A .+ x for x in B . x) . .. )
41
- Base.:.+ (A:: ArrayPartition , B:: Number ) = ArrayPartition ((B .+ x for x in A . x) . .. )
42
- Base.:.- (A:: ArrayPartition , B:: ArrayPartition ) = ArrayPartition ((x .- y for (x,y) in zip (A . x,B . x)) . .. )
43
- Base.:.- (A:: Number , B:: ArrayPartition ) = ArrayPartition ((A .- x for x in B . x) . .. )
44
- Base.:.- (A:: ArrayPartition , B:: Number ) = ArrayPartition ((x .- B for x in A . x) . .. )
45
- Base.:.* (A:: ArrayPartition , B:: ArrayPartition ) = ArrayPartition ((x .* y for (x,y) in zip (A . x,B . x)) . .. )
46
- Base.:.* (A:: Number , B:: ArrayPartition ) = ArrayPartition ((A .* x for x in B . x) . .. )
47
- Base.:.* (A:: ArrayPartition , B:: Number ) = ArrayPartition ((x .* B for x in A . x) . .. )
48
- Base.:./ (A:: ArrayPartition , B:: ArrayPartition ) = ArrayPartition ((x ./ y for (x,y) in zip (A . x,B . x)) . .. )
49
- Base.:./ (A:: ArrayPartition , B:: Number ) = ArrayPartition ((x ./ B for x in A . x) . .. )
50
- Base.:.\ (A:: Number , B:: ArrayPartition ) = ArrayPartition ((x ./ A for x in B . x) . .. )
40
+ @static if VERSION < v " 0.6.0-dev.1614 "
41
+ Base.:.+ (A:: ArrayPartition , B:: ArrayPartition ) = A + B
42
+ Base.:.+ (A:: Number , B:: ArrayPartition ) = A + B
43
+ Base.:.+ (A:: ArrayPartition , B:: Number ) = A + B
44
+ Base.:.- (A:: ArrayPartition , B:: ArrayPartition ) = A - B
45
+ Base.:.- (A:: Number , B:: ArrayPartition ) = A - B
46
+ Base.:.- (A:: ArrayPartition , B:: Number ) = A - B
47
+ Base.:.* (A:: ArrayPartition , B:: ArrayPartition ) = A * B
48
+ Base.:.* (A:: Number , B:: ArrayPartition ) = A * B
49
+ Base.:.* (A:: ArrayPartition , B:: Number ) = A * B
50
+ Base.:./ (A:: ArrayPartition , B:: ArrayPartition ) = A / B
51
+ Base.:./ (A:: ArrayPartition , B:: Number ) = A / B
52
+ Base.:.\ (A:: Number , B:: ArrayPartition ) = A \ B
51
53
end
52
54
53
55
@inline function Base. getindex ( A:: ArrayPartition ,i:: Int )
0 commit comments