Skip to content

Commit 25e4543

Browse files
authored
Move to Infinities.jl (#78)
* Move to Infinities.jl * test on 1.6, support old versions * remove old tests
1 parent 4c17de6 commit 25e4543

File tree

4 files changed

+7
-67
lines changed

4 files changed

+7
-67
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
matrix:
1212
version:
1313
- '1.5'
14+
- '^1.6.0-0'
1415
os:
1516
- ubuntu-latest
1617
- macOS-latest

Project.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
name = "ContinuumArrays"
22
uuid = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
3-
version = "0.5.1"
3+
version = "0.6.0"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
77
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
88
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
99
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
1010
InfiniteArrays = "4858937d-0d70-526a-a4dd-2d5cb5dd786c"
11+
Infinities = "e1ba4f0e-776d-440f-acd9-e1d2e9742647"
1112
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
1213
LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
1314
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1415
QuasiArrays = "c4ea9172-b204-11e9-377d-29865faadc5c"
1516
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1617

1718
[compat]
18-
ArrayLayouts = "0.5"
19+
ArrayLayouts = "0.5, 0.6"
1920
BandedMatrices = "0.16"
2021
BlockArrays = "0.14"
2122
FillArrays = "0.11"
22-
InfiniteArrays = "0.9"
23+
InfiniteArrays = "0.9, 0.10"
24+
Infinities = "0.0.1, 0.0.2"
2325
IntervalSets = "0.5"
2426
LazyArrays = "0.20"
2527
QuasiArrays = "0.4.1"

src/ContinuumArrays.jl

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module ContinuumArrays
2-
using IntervalSets, LinearAlgebra, LazyArrays, FillArrays, BandedMatrices, QuasiArrays, InfiniteArrays, StaticArrays, BlockArrays
2+
using IntervalSets, LinearAlgebra, LazyArrays, FillArrays, BandedMatrices, QuasiArrays, Infinities, InfiniteArrays, StaticArrays, BlockArrays
33
import Base: @_inline_meta, @_propagate_inbounds_meta, axes, getindex, convert, prod, *, /, \, +, -, ==, ^,
44
IndexStyle, IndexLinear, ==, OneTo, _maybetail, tail, similar, copyto!, copy, diff,
55
first, last, show, isempty, findfirst, findlast, findall, Slice, union, minimum, maximum, sum, _sum,
@@ -22,59 +22,12 @@ import InfiniteArrays: Infinity, InfAxes
2222

2323
export Spline, LinearSpline, HeavisideSpline, DiracDelta, Derivative, ℵ₁, Inclusion, Basis, WeightedBasis, grid, transform, affine, ..
2424

25-
####
26-
# Interval indexing support
27-
####
28-
struct AlephInfinity{N} <: Integer end
29-
30-
isone(::AlephInfinity) = false
31-
iszero(::AlephInfinity) = false
32-
33-
==(::AlephInfinity, ::Int) = false
34-
==(::Int, ::AlephInfinity) = false
35-
36-
*(::AlephInfinity{N}, ::AlephInfinity{N}) where N = AlephInfinity{N}()
37-
*(::AlephInfinity{N}, ::Infinity) where N = AlephInfinity{N}()
38-
*(::Infinity, ::AlephInfinity{N}) where N = AlephInfinity{N}()
39-
function *(a::Integer, b::AlephInfinity)
40-
a > 0 || throw(ArgumentError("$a is negative"))
41-
b
42-
end
43-
44-
*(a::AlephInfinity, b::Integer) = b*a
45-
46-
47-
abs(a::AlephInfinity) = a
48-
zero(::AlephInfinity) = 0
49-
50-
for OP in (:<, :)
51-
@eval begin
52-
$OP(::Real, ::AlephInfinity) = true
53-
$OP(::AlephInfinity, ::Real) = false
54-
end
55-
end
56-
57-
for OP in (:>, :)
58-
@eval begin
59-
$OP(::Real, ::AlephInfinity) = false
60-
$OP(::AlephInfinity, ::Real) = true
61-
end
62-
end
63-
64-
65-
const ℵ₁ = AlephInfinity{1}()
66-
67-
string(::AlephInfinity{1}) = "ℵ₁"
68-
69-
show(io::IO, F::AlephInfinity{1}) where N =
70-
print(io, "ℵ₁")
7125

7226

7327
const QMul2{A,B} = Mul{<:Any, <:Any, <:A,<:B}
7428
const QMul3{A,B,C} = Mul{<:AbstractQuasiArrayApplyStyle, <:Tuple{A,B,C}}
7529

7630
cardinality(::AbstractInterval) = ℵ₁
77-
*(ℵ::AlephInfinity) =
7831

7932
Inclusion(d::AbstractInterval{T}) where T = Inclusion{float(T)}(d)
8033
first(S::Inclusion{<:Any,<:AbstractInterval}) = leftendpoint(S.domain)

test/runtests.jl

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,6 @@ import ContinuumArrays: ℵ₁, materialize, AffineQuasiVector, BasisLayout, Adj
55
import QuasiArrays: SubQuasiArray, MulQuasiMatrix, Vec, Inclusion, QuasiDiagonal, LazyQuasiArrayApplyStyle, LazyQuasiArrayStyle
66
import LazyArrays: MemoryLayout, ApplyStyle, Applied, colsupport, arguments, ApplyLayout, LdivStyle, MulStyle
77

8-
@testset "AlephInfinity" begin
9-
@test !isone(ℵ₁)
10-
@test !iszero(ℵ₁)
11-
@test ℵ₁  4
12-
@test ℵ₁ *==* ℵ₁ == ℵ₁
13-
@test 2 * ℵ₁ == ℵ₁ * 2 == ℵ₁
14-
@test abs(ℵ₁) == ℵ₁
15-
@test zero(ℵ₁) == 0
16-
@test 5 < ℵ₁
17-
@test 5  ℵ₁
18-
@test !(ℵ₁  5)
19-
@test ℵ₁ > 5
20-
@test !(5 > ℵ₁)
21-
22-
@test string(ℵ₁) == "ℵ₁"
23-
end
248

259
@testset "Inclusion" begin
2610
x = Inclusion(-1..1)

0 commit comments

Comments
 (0)