Skip to content

Commit a91b499

Browse files
committed
Increase coverage
1 parent 4ad29b4 commit a91b499

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ContinuumArrays"
22
uuid = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
3-
version = "0.8"
3+
version = "0.8.0"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/operators.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ function getindex(δ::DiracDelta{T}, x::Number) where T
8484
end
8585

8686

87-
@simplify *(A::QuasiAdjoint{<:Any,<:DiracDelta}, B::AbstractQuasiVector) = B[parent(A).x]
8887
@simplify *(A::QuasiAdjoint{<:Any,<:DiracDelta}, B::AbstractQuasiMatrix) = B[parent(A).x,:]
88+
dot::DiracDelta, B::AbstractQuasiVector) = B[δ.x]
89+
@simplify *(A::QuasiAdjoint{<:Any,<:DiracDelta}, B::AbstractQuasiVector) = dot(parent(A),B)
8990

9091
show(io::IO, δ::DiracDelta) = print(io, "δ at $(δ.x) over $(axes(δ,1))")
9192
show(io::IO, ::MIME"text/plain", δ::DiracDelta) = show(io, δ)
@@ -99,7 +100,7 @@ struct Derivative{T,D} <: LazyQuasiMatrix{T}
99100
axis::Inclusion{T,D}
100101
end
101102

102-
Derivative{T}(axis::A) where {T,A<:Inclusion} = Derivative{T,A}(axis)
103+
Derivative{T}(axis::Inclusion{<:Any,D}) where {T,D} = Derivative{T,D}(axis)
103104
Derivative{T}(domain) where T = Derivative{T}(Inclusion(domain))
104105

105106
axes(D::Derivative) = (D.axis, D.axis)

test/runtests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using ContinuumArrays, QuasiArrays, LazyArrays, IntervalSets, FillArrays, LinearAlgebra, BandedMatrices, FastTransforms, InfiniteArrays, Test, Base64, RecipesBase
22
import ContinuumArrays: ℵ₁, materialize, AffineQuasiVector, BasisLayout, AdjointBasisLayout, SubBasisLayout, ℵ₁,
33
MappedBasisLayout, AdjointMappedBasisLayout, MappedWeightedBasisLayout, TransformFactorization, Weight, WeightedBasisLayout, SubWeightedBasisLayout, WeightLayout,
4-
Expansion, basis, invmap, Map, checkpoints, _plotgrid
4+
Expansion, basis, invmap, Map, checkpoints, _plotgrid, mul
55
import QuasiArrays: SubQuasiArray, MulQuasiMatrix, Vec, Inclusion, QuasiDiagonal, LazyQuasiArrayApplyStyle, LazyQuasiArrayStyle
66
import LazyArrays: MemoryLayout, ApplyStyle, Applied, colsupport, arguments, ApplyLayout, LdivStyle, MulStyle
77

@@ -34,6 +34,7 @@ import LazyArrays: MemoryLayout, ApplyStyle, Applied, colsupport, arguments, App
3434
@testset "Derivative" begin
3535
x = Inclusion(-1..1)
3636
D = Derivative(x)
37+
@test D == Derivative{Float64}(x) == Derivative{Float64}(-1..1)
3738
@test D*x QuasiOnes(x)
3839
@test D^2 * x QuasiZeros(x)
3940
@test D*[x D*x] == [D*x D^2*x]
@@ -137,6 +138,7 @@ end
137138
δ = DiracDelta(1.2,1..3)
138139
L = LinearSpline([1,2,3])
139140
@test @inferred'L) [0.8, 0.2, 0.0]
141+
@test δ'f == mul',f) == dot(δ,f) == f[1.2]
140142

141143
@test @inferred(L'L) == SymTridiagonal([1/3,2/3,1/3], [1/6,1/6])
142144

0 commit comments

Comments
 (0)