@@ -45,7 +45,7 @@ import DomainSets: Domain, indomain, UnionDomain, Point, Interval,
4545
4646import Base: convert, getindex, * , + , - , == , / , eltype,
4747 show, sum, conj, issubset, first, last, rand, setdiff,
48- union, angle, isempty, one, promote_rule, real, imag
48+ angle, isempty, one, promote_rule, real, imag
4949
5050import LinearAlgebra: norm, mul!, isdiag
5151
@@ -567,13 +567,15 @@ function domainsscaled(A::Domain, B::Domain)
567567 return nothing
568568end
569569domainsscaled (A:: Space , B:: Space ) = domainsscaled (map (domain, (A,B))... )
570- function union (A:: Fourier , B:: Fourier )
571- dA, dB = map (domain, (A,B))
572- AB = domainsmultiple (dA, dB)
573- isnothing (AB) || return Fourier (max (dA, dB))
574- scale = domainsscaled (dA, dB)
575- isnothing (scale) || return Fourier (max (dA, dB) * denominator (scale))
576- SumSpace (A, B)
570+ for S in [:CosSpace , :SinSpace , :Fourier , :Laurent ]
571+ @eval function union_rule (A:: $S{<:PeriodicSegment} , B:: $S{<:PeriodicSegment} )
572+ dA, dB = map (domain, (A,B))
573+ AB = domainsmultiple (dA, dB)
574+ isnothing (AB) || return $ S (max (dA, dB))
575+ scale = domainsscaled (dA, dB)
576+ isnothing (scale) || return $ S (max (dA, dB) * denominator (scale))
577+ SumSpace (A, B)
578+ end
577579end
578580_ind (i, n) = 2 n * div (i, 2 ) + isodd (i)
579581_invind (i, n) = 2 div (i - isodd (i), 2 n) + isodd (i)
0 commit comments