Skip to content

Commit 9a4a12f

Browse files
authored
backports for v0.5 (#238)
* remove unnecessary conversion to Any (#138) * Simplify union for spaces (#139) * Simplify union for spaces * Add ambiguous union tests * ambiguity in empty/any domain unions * export inplace transform (#140) * plus for a single Fun (#144) * coefficient conversion bugfix (#146) * backport #157 use libblastrampoline instead of libblas/liblapack * backport reduce Meta.parse calls (#158) * version bump to v0.5.18 Co-authored-by: Jishnu Bhattacharya <[email protected]>
1 parent 18bdc2d commit 9a4a12f

21 files changed

+158
-79
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
name: CI
2+
3+
concurrency:
4+
group: build-${{ github.event.pull_request.number || github.ref }}
5+
cancel-in-progress: true
6+
27
on:
38
create:
49
tags:
@@ -25,7 +30,6 @@ jobs:
2530
version:
2631
- '1.5'
2732
- '1'
28-
- '^1.8.0-0'
2933
os:
3034
- ubuntu-latest
3135
- macOS-latest

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.5.17"
3+
version = "0.5.18"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Domain.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
export Domain, SegmentDomain, tocanonical, fromcanonical, fromcanonicalD, ∂
42
export chebyshevpoints, fourierpoints, isambiguous, arclength
53
export components, component, ncomponents
@@ -21,6 +19,8 @@ struct EmptyDomain <: Domain{Nothing} end
2119
==(::AnyDomain, ::AnyDomain) = true
2220
==(::EmptyDomain, ::EmptyDomain) = true
2321

22+
const AnyOrEmptyDomain = Union{AnyDomain, EmptyDomain}
23+
2424
isambiguous(::AnyDomain) = true
2525
dimension(::AnyDomain) = 1
2626
dimension(::EmptyDomain) = 0
@@ -32,21 +32,21 @@ arclength(::DomainSets.EmptySpace) = false
3232

3333
isempty(::AnyDomain) = false
3434

35-
reverseorientation(a::Union{AnyDomain,EmptyDomain}) = a
35+
reverseorientation(a::AnyOrEmptyDomain) = a
3636

37-
canonicaldomain(a::Union{AnyDomain,EmptyDomain}) = a
37+
canonicaldomain(a::AnyOrEmptyDomain) = a
3838

3939
indomain(x::Domain,::EmptyDomain) = false
4040

4141
convert(::Type{Domain{T}}, ::AnyDomain) where T = Domain(T)
4242

43+
# empty domain should have priority over over any domain
44+
_promoteanyemptydomain(::AnyDomain, ::AnyDomain) = AnyDomain()
45+
_promoteanyemptydomain(::AnyOrEmptyDomain, ::AnyOrEmptyDomain) = EmptyDomain()
4346

44-
union(::AnyDomain, d::Domain) = d
45-
union(d::Domain, ::AnyDomain) = d
46-
47-
union(::EmptyDomain, ::EmptyDomain) = EmptyDomain()
48-
union(::EmptyDomain, a::Domain) = a
49-
union(a::Domain, ::EmptyDomain) = a
47+
union(a::AnyOrEmptyDomain, b::AnyOrEmptyDomain) = _promoteanyemptydomain(a, b)
48+
union(::AnyOrEmptyDomain, a::Domain) = a
49+
union(a::Domain, ::AnyOrEmptyDomain) = a
5050

5151
##General routines
5252
isempty(::EmptyDomain) = true

src/Fun.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ end
2020
const VFun{S,T} = Fun{S,T,Vector{T}}
2121

2222
Fun(sp::Space,coeff::AbstractVector) = Fun{typeof(sp),eltype(coeff),typeof(coeff)}(sp,coeff)
23-
Fun() = Fun(identity)
23+
Fun() = Fun(identity, ChebyshevInterval())
2424
Fun(d::Domain) = Fun(identity,d)
2525
Fun(d::Space) = Fun(identity,d)
2626

@@ -167,10 +167,6 @@ iterate(A::ArrayFun, i=1) = (@_inline_meta; (i % UInt) - 1 < length(A) ? (@inbou
167167

168168
in(x::ScalarFun, y::ScalarFun) = x == y
169169

170-
171-
172-
173-
174170
setspace(v::AbstractVector,s::Space) = Fun(s,v)
175171
setspace(f::Fun,s::Space) = Fun(s,f.coefficients)
176172

@@ -341,7 +337,7 @@ function axpy!(a,xcfs::AbstractVector,Y::Fun)
341337
end
342338

343339

344-
340+
+(a::Fun) = copy(a)
345341
-(f::Fun) = Fun(f.space,-f.coefficients)
346342
-(c::Number,f::Fun) = -(f-c)
347343

src/LinearAlgebra/blas.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import LinearAlgebra.BLAS: @blasfunc, libblas
2-
import LinearAlgebra.LAPACK: liblapack
1+
import LinearAlgebra.BLAS: @blasfunc
2+
const libblas = VERSION < v"1.8" ? LinearAlgebra.BLAS.libblas : "libblastrampoline"
3+
const liblapack = VERSION < v"1.8" ? LinearAlgebra.LAPACK.liblapack : "libblastrampoline"
4+
35
# Level 2
46
## mv
57
### gemv

src/LinearAlgebra/hesseneigs.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ for (hseqr,elty) in ((:zhseqr_,:ComplexF64),)
2222

2323
Ec='E'
2424
Nc='N'
25-
ccall((@blasfunc($hseqr),LAPACK.liblapack),
25+
ccall((@blasfunc($hseqr),liblapack),
2626
Nothing,
2727
(Ref{UInt8}, Ref{UInt8},
2828
Ref{BlasInt}, Ref{BlasInt}, Ref{BlasInt}, Ptr{$elty}, #A
@@ -59,7 +59,7 @@ for (hseqr,elty) in ((:dhseqr_,:Float64),)
5959
Ec='E'
6060
Nc='N'
6161
for i=1:2
62-
ccall((@blasfunc($hseqr),LAPACK.liblapack),
62+
ccall((@blasfunc($hseqr),liblapack),
6363
Nothing,
6464
(Ref{UInt8},Ref{UInt8},
6565
Ref{BlasInt},Ref{BlasInt},Ref{BlasInt},Ptr{$elty}, #A

src/Operators/Operator.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ end
371371

372372

373373
for OP in (:colstart,:colstop,:rowstart,:rowstop)
374-
defOP = Meta.parse("default_"*string(OP))
374+
defOP = Symbol(:default_, OP)
375375
@eval begin
376376
$OP(A::Operator, i::Integer) = $defOP(A,i)
377377
$OP(A::Operator, i::PosInfinity) = ℵ₀

src/Operators/banded/CalculusOperator.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ abstract type CalculusOperator{S,OT,T}<:Operator{T} end
77
## Note that all functions called in calculus_operator must be exported
88

99
macro calculus_operator(Op)
10-
ConcOp=Meta.parse("Concrete"*string(Op))
11-
WrappOp=Meta.parse(string(Op)*"Wrapper")
12-
DefaultOp=Meta.parse("Default"*string(Op))
10+
ConcOp = Symbol(:Concrete, Op)
11+
WrappOp = Symbol(Op, :Wrapper)
12+
DefaultOp = Symbol(:Default, Op)
1313
return esc(quote
1414
# The SSS, TTT are to work around #9312
1515
abstract type $Op{SSS,OT,TTT} <: CalculusOperator{SSS,OT,TTT} end

src/Operators/banded/Conversion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rangespace(C::ConcreteConversion)=C.rangespace
2626

2727

2828

29-
function defaultConversion(a::Space,b::Space)::Any
29+
function defaultConversion(a::Space,b::Space)
3030
if a==b
3131
Conversion(a)
3232
elseif conversion_type(a,b)==NoSpace()

src/Operators/banded/Reverse.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33
for TYP in (:ReverseOrientation,:Reverse)
4-
WRAP = Meta.parse(string(TYP)*"Wrapper")
4+
WRAP = Symbol(TYP, :Wrapper)
55
@eval begin
66
abstract type $TYP{T} <: Operator{T} end
77

0 commit comments

Comments
 (0)