Skip to content

Commit c54d5a0

Browse files
authored
accept tuples in promote range/domain spaces (#213)
* accept tuples in promote range/domain spaces * require at least one element in tuples
1 parent be70ac0 commit c54d5a0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Operators/spacepromotion.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ rangespace(S::SpaceOperator) = S.rangespace
4747

4848

4949
##TODO: Do we need both max and min?
50-
function findmindomainspace(ops::AbstractVector)
50+
function findmindomainspace(ops)
5151
mapreduce(domainspace, union, ops, init = UnsetSpace())
5252
end
5353

54-
function findmaxrangespace(ops::AbstractVector)
54+
function findmaxrangespace(ops)
5555
mapreduce(rangespace, maxspace, ops, init = UnsetSpace())
5656
end
5757

@@ -77,21 +77,21 @@ promotedomainspace(P::Operator,sp::Space,cursp::Space) =
7777

7878

7979

80-
function promoterangespace(ops::AbstractVector{O}) where O<:Operator
80+
function promoterangespace(ops::Union{AbstractVector{O}, Tuple{O,Vararg{O}}}) where O<:Operator
8181
isempty(ops) && return strictconvert(Vector{Operator{eltype(O)}}, ops)
8282
k=findmaxrangespace(ops)
8383
#TODO: T might be incorrect
8484
T=mapreduce(eltype,promote_type,ops)
8585
Operator{T}[promoterangespace(op,k) for op in ops]
8686
end
87-
function promotedomainspace(ops::AbstractVector{O}) where O<:Operator
87+
function promotedomainspace(ops::Union{AbstractVector{O}, Tuple{O,Vararg{O}}}) where O<:Operator
8888
isempty(ops) && return strictconvert(Vector{Operator{eltype(O)}}, ops)
8989
k=findmindomainspace(ops)
9090
#TODO: T might be incorrect
9191
T=mapreduce(eltype,promote_type,ops)
9292
Operator{T}[promotedomainspace(op,k) for op in ops]
9393
end
94-
function promotedomainspace(ops::AbstractVector{O},S::Space) where O<:Operator
94+
function promotedomainspace(ops::Union{AbstractVector{O}, Tuple{O,Vararg{O}}},S::Space) where O<:Operator
9595
isempty(ops) && return strictconvert(Vector{Operator{eltype(O)}}, ops)
9696
k=conversion_type(findmindomainspace(ops),S)
9797
#TODO: T might be incorrect

0 commit comments

Comments
 (0)