Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/test_continuouspolynomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,7 @@ using ContinuumArrays: plan_grid_transform

f = expand(C,exp)
@test diff(diff(f))[0.1] ≈ exp(0.1)

@test diff(C)[0.1,1:5] ≈ [0,-1.5,1.5,0,0]
end
end
10 changes: 10 additions & 0 deletions test/test_dirichlet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,14 @@ using PiecewiseOrthogonalPolynomials: ArrowheadMatrix, plan_grid_transform
@test sprint(show, C) == "ContinuousPolynomial{1}(-1:1)"
@test sprint(show, P) == "ContinuousPolynomial{0}(-1:1)"
end

@testset "diff" begin
Q = DirichletPolynomial(range(-1,1; length=4))
@test diff(Q)[0.1,1:5] ≈ [-1,0,1.6,0,-0.92]
u = expand(Q, x -> (1-x^2)*exp(x))
let x = 0.1
@test diff(u)[x] ≈ (1-2x-x^2)*exp(x)
@test diff(diff(u))[x] ≈ (-1-4x-x^2)*exp(x)
end
end
end