@@ -8,7 +8,7 @@ Base.map!(f::F, m::AMSA, A0, As...) where {F} =
8
8
9
9
Base. BroadcastStyle (:: Type{<:AMSA} ) = Broadcast. ArrayStyle {AMSA} ()
10
10
Base. BroadcastStyle (:: Type{<:AbstractMultiScaleArrayLeaf} ) = Broadcast. ArrayStyle {AbstractMultiScaleArrayLeaf} ()
11
-
11
+ Base . BroadcastStyle (a :: Broadcast.ArrayStyle{AMSA} , b :: Base.Broadcast.DefaultArrayStyle ) = b
12
12
#=
13
13
AMSAStyle(::S) where {S} = AMSAStyle{S}()
14
14
AMSAStyle(::S, ::Val{N}) where {S,N} = AMSAStyle(S(Val(N)))
35
35
36
36
@inline function Base. copy (bc:: Broadcast.Broadcasted{Broadcast.ArrayStyle{AMSA}} )
37
37
first_amsa = find_amsa (bc)
38
- out = deepcopy (first_amsa)
38
+ out = similar (first_amsa)
39
39
copyto! (out,bc)
40
40
out
41
- #=
42
- N = nnodes(bc)
43
- @inline function f(i)
44
- copy(unpack(bc, i))
45
- end
46
- first_amsa = find_amsa(bc)
47
- if length(fieldnames(typeof(first_amsa))) == 1
48
- construct(parameterless_type(first_amsa), map(f,N), f(nothing))
49
- else
50
- out = deepcopy(first_amsa)
51
- copyto!(out,bc)
52
- return out
53
- end
54
- =#
55
41
end
56
42
57
43
@inline function Base. copy (bc:: Broadcast.Broadcasted{Broadcast.ArrayStyle{AbstractMultiScaleArrayLeaf}} )
58
44
first_amsa = find_amsa (bc)
59
- out = deepcopy (first_amsa)
45
+ out = similar (first_amsa)
60
46
copyto! (out,bc)
61
47
out
62
- #=
63
- @inline function f(i)
64
- copy(unpack(bc, i))
65
- end
66
-
67
- if length(fieldnames(typeof(first_amsa))) == 1
68
- return construct(parameterless_type(first_amsa), f(nothing))
69
- else
70
-
71
- return out
72
- end
73
- =#
74
48
end
75
49
76
50
@inline function Base. copyto! (dest:: AMSA , bc:: Broadcast.Broadcasted{Nothing} )
0 commit comments