Skip to content

accept tuples in promote range/domain spaces #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Operators/spacepromotion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ rangespace(S::SpaceOperator) = S.rangespace


##TODO: Do we need both max and min?
function findmindomainspace(ops::AbstractVector)
function findmindomainspace(ops)
mapreduce(domainspace, union, ops, init = UnsetSpace())
end

function findmaxrangespace(ops::AbstractVector)
function findmaxrangespace(ops)
mapreduce(rangespace, maxspace, ops, init = UnsetSpace())
end

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



function promoterangespace(ops::AbstractVector{O}) where O<:Operator
function promoterangespace(ops::Union{AbstractVector{O}, Tuple{O,Vararg{O}}}) where O<:Operator
isempty(ops) && return strictconvert(Vector{Operator{eltype(O)}}, ops)
k=findmaxrangespace(ops)
#TODO: T might be incorrect
T=mapreduce(eltype,promote_type,ops)
Operator{T}[promoterangespace(op,k) for op in ops]
end
function promotedomainspace(ops::AbstractVector{O}) where O<:Operator
function promotedomainspace(ops::Union{AbstractVector{O}, Tuple{O,Vararg{O}}}) where O<:Operator
isempty(ops) && return strictconvert(Vector{Operator{eltype(O)}}, ops)
k=findmindomainspace(ops)
#TODO: T might be incorrect
T=mapreduce(eltype,promote_type,ops)
Operator{T}[promotedomainspace(op,k) for op in ops]
end
function promotedomainspace(ops::AbstractVector{O},S::Space) where O<:Operator
function promotedomainspace(ops::Union{AbstractVector{O}, Tuple{O,Vararg{O}}},S::Space) where O<:Operator
isempty(ops) && return strictconvert(Vector{Operator{eltype(O)}}, ops)
k=conversion_type(findmindomainspace(ops),S)
#TODO: T might be incorrect
Expand Down