@@ -264,7 +264,7 @@ function Base.similar(bc::Broadcasted{GroupedVariableStyle}, ::Type{ElType}) wh
264
264
return A
265
265
end
266
266
267
- function Base. broadcasted (f:: Function ,A:: GroupedVariable{TV,TF,TGM,TM,TG} ) where {TV,TF,TGM,TM,TG}
267
+ function Base. broadcasted (:: GroupedVariableStyle , f:: Function ,A:: GroupedVariable{TV,TF,TGM,TM,TG} ) where {TV,TF,TGM,TM,TG}
268
268
# TODO change output TG
269
269
270
270
map_fun = ∘ (f,A. map_fun)
@@ -457,7 +457,10 @@ defAttrib(gr::ReducedGroupedVariable,attribname::SymbolOrString,value) =
457
457
gr. _attrib[attribname] = value
458
458
459
459
struct ReducedGroupedVariableStyle <: BroadcastStyle end
460
+
460
461
Base. BroadcastStyle (:: Type{<:ReducedGroupedVariable} ) = ReducedGroupedVariableStyle ()
462
+ Base. BroadcastStyle (:: DefaultArrayStyle ,:: ReducedGroupedVariableStyle ) = ReducedGroupedVariableStyle ()
463
+ Base. BroadcastStyle (:: ReducedGroupedVariableStyle ,:: DefaultArrayStyle ) = ReducedGroupedVariableStyle ()
461
464
462
465
function Base. similar (bc:: Broadcasted{ReducedGroupedVariableStyle} , :: Type{ElType} ) where ElType
463
466
# Scan the inputs for the ReducedGroupedVariable:
@@ -503,12 +506,12 @@ function broadcasted_gvr!(C,f,A,B)
503
506
end
504
507
505
508
506
- Base. broadcasted (f:: Function ,A,B:: ReducedGroupedVariable ) =
509
+ Base. broadcasted (:: ReducedGroupedVariableStyle , f:: Function ,A,B:: ReducedGroupedVariable ) =
507
510
broadcasted_gvr! (similar (A),f,A,B)
508
- Base. broadcasted (f:: Function ,A:: ReducedGroupedVariable ,B) =
511
+ Base. broadcasted (:: ReducedGroupedVariableStyle , f:: Function ,A:: ReducedGroupedVariable ,B) =
509
512
broadcasted_gvr! (similar (B),f,A,B)
510
513
511
- function Base. broadcasted (f:: Function ,A:: ReducedGroupedVariable ,B:: ReducedGroupedVariable )
514
+ function Base. broadcasted (:: ReducedGroupedVariableStyle , f:: Function ,A:: ReducedGroupedVariable ,B:: ReducedGroupedVariable )
512
515
# undecided what to do
513
516
# method needs to be there to avoid ambiguities
514
517
error (" unimplemented" );
0 commit comments