Skip to content

Commit

Permalink
Test that diff(T[:,1:5]) * randn(5) returns an Expansion instead of a… (
Browse files Browse the repository at this point in the history
#200)

* Test that diff(T[:,1:5]) * randn(5) returns an Expansion instead of a lazy multiplication

* Update Project.toml

* Update test_chebyshev.jl
  • Loading branch information
dlfivefifty authored Aug 8, 2024
1 parent 3dbb5db commit 51c42b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ HypergeometricFunctions = "0.3.4"
InfiniteArrays = " 0.14"
InfiniteLinearAlgebra = "0.8"
IntervalSets = "0.7"
LazyArrays = "2.0.3"
LazyArrays = "2.2"
LazyBandedMatrices = "0.10"
QuasiArrays = "0.11"
SpecialFunctions = "1.0, 2"
Expand Down
6 changes: 5 additions & 1 deletion test/test_chebyshev.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ClassicalOrthogonalPolynomials: Clenshaw, recurrencecoefficients, clensha
import LazyArrays: ApplyStyle
import QuasiArrays: MulQuasiMatrix
import Base: OneTo
import ContinuumArrays: MappedWeightedBasisLayout, Map, WeightedBasisLayout
import ContinuumArrays: MappedWeightedBasisLayout, Map, WeightedBasisLayout, ExpansionLayout
import BandedMatrices: isbanded

@testset "Chebyshev" begin
Expand Down Expand Up @@ -578,6 +578,10 @@ import BandedMatrices: isbanded
@test T \ exp.(im*x) transform(T, x -> exp(im*x))
@test expand(T, x -> exp(im*x))[0.1] exp(im*0.1)
end

@testset "diff of truncation" begin
MemoryLayout(diff(ChebyshevT()[:,1:5]) * randn(5)) isa ExpansionLayout
end
end

struct QuadraticMap{T} <: Map{T} end
Expand Down

0 comments on commit 51c42b3

Please sign in to comment.