Skip to content

Commit 65e0c7e

Browse files
authored
Changes for InfintieArrays v0.10 (#68)
* Changes for InfintieArrays v0.10 * tests pass * v0.4, add CI
1 parent e4f647d commit 65e0c7e

File tree

11 files changed

+31
-31
lines changed

11 files changed

+31
-31
lines changed

Project.toml

Lines changed: 10 additions & 10 deletions
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.3.14"
3+
version = "0.4"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
@@ -27,25 +27,25 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2727
ToeplitzMatrices = "c751599d-da0a-543b-9d20-d0a503d91d24"
2828

2929
[compat]
30-
AbstractFFTs = "0.4, 0.5, 1"
31-
BandedMatrices = "0.14, 0.15, 0.16"
32-
BlockArrays = "0.12.11, 0.13, 0.14"
33-
BlockBandedMatrices = "0.7, 0.8, 0.9, 0.10"
30+
AbstractFFTs = "0.5, 1"
31+
BandedMatrices = "0.16"
32+
BlockArrays = "0.14"
33+
BlockBandedMatrices = "0.10"
3434
Calculus = "0.5"
3535
DSP = "0.6"
3636
DomainSets = "0.4"
3737
DualNumbers = "0.6.2"
3838
FFTW = "0.3, 1"
3939
FastGaussQuadrature = "0.4"
40-
FillArrays = "0.8, 0.9, 0.10, 0.11"
41-
InfiniteArrays = "0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.10"
40+
FillArrays = "0.11"
41+
InfiniteArrays = "0.10"
4242
IntervalSets = "0.5"
43-
LazyArrays = "0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20"
43+
LazyArrays = "0.20"
4444
LowRankApprox = "0.2, 0.3, 0.4"
45-
SpecialFunctions = "0.8, 0.9, 0.10, 1.0"
45+
SpecialFunctions = "0.10, 1.0"
4646
StaticArrays = "0.12, 1.0"
4747
ToeplitzMatrices = "0.6"
48-
julia = "1.3"
48+
julia = "1.5"
4949

5050
[extras]
5151
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

src/ApproxFunBase.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ import BlockBandedMatrices: blockbandwidth, blockbandwidths, blockcolstop, block
7272

7373
import FillArrays: AbstractFill, getindex_value
7474
import LazyArrays: cache
75-
import InfiniteArrays: Infinity, InfRanges, AbstractInfUnitRange, OneToInf
75+
import InfiniteArrays: PosInfinity, InfRanges, AbstractInfUnitRange, OneToInf, InfiniteCardinal
7676

7777

7878
# convenience for 1-d block ranges

src/LinearAlgebra/helper.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,15 @@ pad(A::AbstractMatrix,::Colon,m::Integer) = pad(A,size(A,1),m)
286286
pad(A::AbstractMatrix,n::Integer,::Colon) = pad(A,n,size(A,2))
287287

288288

289-
function pad(v, ::Infinity)
289+
function pad(v, ::PosInfinity)
290290
if isinf(length(v))
291291
v
292292
else
293293
Vcat(v, Zeros{Int}(∞))
294294
end
295295
end
296296

297-
function pad(v::AbstractVector{T}, ::Infinity) where T
297+
function pad(v::AbstractVector{T}, ::PosInfinity) where T
298298
if isinf(length(v))
299299
v
300300
else
@@ -530,8 +530,8 @@ slnorm(m::AbstractMatrix,::Colon,j::Integer) = slnorm(m,1:size(m,1),j)
530530

531531

532532

533-
Base.isless(x::Block{1}, y::Infinity) = isless(Int(x), y)
534-
Base.isless(x::Infinity, y::Block{1}) = isless(x, Int(y))
533+
Base.isless(x::Block{1}, y::PosInfinity) = isless(Int(x), y)
534+
Base.isless(x::PosInfinity, y::Block{1}) = isless(x, Int(y))
535535

536536

537537
## BandedMatrix

src/Multivariate/TensorSpace.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ end
142142

143143

144144
blockstart(it,K)::Int = K==1 ? 1 : sum(blocklengths(it)[1:K-1])+1
145-
blockstop(it,::Infinity) =
145+
blockstop(it,::PosInfinity) = ℵ₀
146146
_K_sum(bl::AbstractVector, K) = sum(bl[1:K])
147147
_K_sum(bl::Integer, K) = bl
148148
blockstop(it, K)::Int = _K_sum(blocklengths(it), K)
@@ -453,7 +453,7 @@ end
453453

454454
for OP in (:block,:blockstart,:blockstop)
455455
@eval begin
456-
$OP(s::TensorSpace, ::Infinity) =
456+
$OP(s::TensorSpace, ::PosInfinity) = ℵ₀
457457
$OP(s::TensorSpace, M::Block) = $OP(tensorizer(s),M)
458458
$OP(s::TensorSpace, M) = $OP(tensorizer(s),M)
459459
end

src/Operators/Operator.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ macro functional(FF)
5656
Base.size(A::$FF,k::Integer) = k==1 ? 1 : dimension(domainspace(A))
5757
ApproxFunBase.rangespace(F::$FF) = ConstantSpace(eltype(F))
5858
ApproxFunBase.isafunctional(::$FF) = true
59-
ApproxFunBase.blockbandwidths(A::$FF) = 0,hastrivialblocks(domainspace(A)) ? bandwidth(A,2) :
59+
ApproxFunBase.blockbandwidths(A::$FF) = 0,hastrivialblocks(domainspace(A)) ? bandwidth(A,2) : ℵ₀
6060
function ApproxFunBase.defaultgetindex(f::$FF,k::Integer,j::Integer)
6161
@assert k==1
6262
f[j]::eltype(f)
@@ -101,7 +101,7 @@ function lastindex(A::Operator, n::Integer)
101101
elseif n==2
102102
size(A,2)
103103
elseif isinf(size(A,2)) || isinf(size(A,1))
104-
104+
ℵ₀
105105
else
106106
size(A,1)
107107
end
@@ -371,8 +371,8 @@ end
371371
for OP in (:colstart,:colstop,:rowstart,:rowstop)
372372
defOP = Meta.parse("default_"*string(OP))
373373
@eval begin
374-
$OP(A::Operator,i::Integer) = $defOP(A,i)
375-
$OP(A::Operator,i::Infinity) =
374+
$OP(A::Operator, i::Integer) = $defOP(A,i)
375+
$OP(A::Operator, i::PosInfinity) = ℵ₀
376376
end
377377
end
378378

@@ -461,7 +461,7 @@ macro wrapperstructure(Wrap)
461461
$ret
462462

463463
$func(D::$Wrap,k::Integer) = $func(D.op,k)
464-
$func(A::$Wrap,i::ApproxFunBase.Infinity) = # $func(A.op,i) | see PR #42
464+
$func(A::$Wrap,i::ApproxFunBase.PosInfinity) = ℵ₀ # $func(A.op,i) | see PR #42
465465
end
466466
end
467467

src/Operators/SubOperator.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function view(A::Operator,kr::InfRanges,jr::InfRanges)
7777
jr1=first(jr)
7878
l,u=(bandwidth(A,1)+jr1-kr1)÷st,(bandwidth(A,2)+kr1-jr1)÷st
7979
else
80-
l,u=∞,∞
80+
l,u=ℵ₀,ℵ₀
8181
end
8282
SubOperator(A,(kr,jr),size(A),(l,u))
8383
end

src/Operators/general/algebra.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ for TYP in (:Matrix, :BandedMatrix, :RaggedMatrix)
410410

411411
# find optimal truncations for each operator
412412
# by finding the non-zero entries
413-
krlin = Matrix{Union{Int,Infinity}}(undef,length(P.ops),2)
413+
krlin = Matrix{Union{Int,InfiniteCardinal{0}}}(undef,length(P.ops),2)
414414

415415
krlin[1,1],krlin[1,2]=kr[1],kr[end]
416416
for m=1:length(P.ops)-1
@@ -465,7 +465,7 @@ for TYP in (:BlockBandedMatrix, :BandedBlockBandedMatrix)
465465

466466
# find optimal truncations for each operator
467467
# by finding the non-zero entries
468-
KRlin = Matrix{Union{Block,Infinity}}(undef,length(P.ops),2)
468+
KRlin = Matrix{Union{Block,InfiniteCardinal{0}}}(undef,length(P.ops),2)
469469

470470
KRlin[1,1],KRlin[1,2] = first(KR),last(KR)
471471
for m=1:length(P.ops)-1

src/PDE/KroneckerOperator.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function rowstop(A::KroneckerOperator,k::Integer)
102102
end
103103

104104

105-
bandwidths(K::KroneckerOperator) = (∞,∞)
105+
bandwidths(K::KroneckerOperator) = (ℵ₀,ℵ₀)
106106

107107
isblockbanded(K::KroneckerOperator) = all(isblockbanded,K.ops)
108108
isbandedblockbanded(K::KroneckerOperator) =
@@ -123,7 +123,7 @@ subblock_blockbandwidths(K::KroneckerOperator) =
123123

124124
# If each block were in turn BandedMatrix, these are the bandwidths
125125
function subblockbandwidths(K::KroneckerOperator)
126-
isbandedblockbanded(K) || return (∞,∞)
126+
isbandedblockbanded(K) || return (ℵ₀,ℵ₀)
127127

128128
if all(hastrivialblocks,domainspace(K).spaces) &&
129129
all(hastrivialblocks,rangespace(K).spaces)

src/Spaces/ConstantSpace.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ getindex(f::Fun{SequenceSpace}, k::Integer) =
99
getindex(f::Fun{SequenceSpace},K::CartesianIndex{0}) = f[1]
1010
getindex(f::Fun{SequenceSpace},K) = cfstype(f)[f[k] for k in K]
1111

12-
length(f::Fun{SequenceSpace}) =
12+
length(f::Fun{SequenceSpace}) = ℵ₀
1313

1414

1515
dotu(f::Fun{SequenceSpace},g::Fun{SequenceSpace}) =
@@ -171,7 +171,7 @@ rangespace(D::ConcreteMultiplication{CS1,CS2,T}) where {CS1<:ConstantSpace,CS2<:
171171
rangespace(D::ConcreteMultiplication{F,UnsetSpace,T}) where {F<:ConstantSpace,T} =
172172
UnsetSpace()
173173
bandwidths(D::ConcreteMultiplication{F,UnsetSpace,T}) where {F<:ConstantSpace,T} =
174-
(∞,∞)
174+
(ℵ₀,ℵ₀)
175175
getindex(D::ConcreteMultiplication{F,UnsetSpace,T},k::Integer,j::Integer) where {F<:ConstantSpace,T} =
176176
error("No range space attached to Multiplication")
177177

src/Spaces/SubSpace.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dimension(sp::SubSpace) = length(sp.indexes)
1717

1818

1919
function |(f::Fun,kr::AbstractInfUnitRange)
20-
@assert dimension(space(f)) ==
20+
@assert dimension(space(f)) ℵ₀
2121
Fun(space(f)|kr,f.coefficients[kr[1]:end])
2222
end
2323

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using ApproxFunBase, LinearAlgebra, Random, Test
2-
import ApproxFunBase: Infinity,
2+
import ApproxFunBase:
33

44
@testset "Helper" begin
55
@testset "interlace" begin

0 commit comments

Comments
 (0)