-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate
gausschebyshev
and add gausschebyshevt
, ..., `gausscheb…
…yshevw` (#123) * deprecate gausschebyshev and add gausschebyshev1 to gausschebyshev4 * fix docs * fix error handling for gausschebyshev * update docstrings * rename gausschebyshev* function * rename `gausschebyshevT` to `gausschebyshev` etc. * bump version to v0.5.2
- Loading branch information
Showing
5 changed files
with
84 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,42 @@ | ||
@testset "Gauss–Chebyshev" begin | ||
|
||
@testset "Check error" begin | ||
@test_throws DomainError gausschebyshev(-1,1) | ||
@test_throws DomainError gausschebyshev(-1,2) | ||
@test_throws DomainError gausschebyshev(-1,3) | ||
@test_throws DomainError gausschebyshev(-1,4) | ||
@test_throws ArgumentError gausschebyshev(0,5) | ||
@test_throws DomainError gausschebyshevt(-1) | ||
@test_throws DomainError gausschebyshevu(-1) | ||
@test_throws DomainError gausschebyshevv(-1) | ||
@test_throws DomainError gausschebyshevw(-1) | ||
end | ||
|
||
n = 10 | ||
|
||
@testset "x.^2" begin | ||
x, w = gausschebyshev(n,1) | ||
x, w = gausschebyshevt(n) | ||
@test dot(x.^2,w) ≈ π/2 | ||
x, w = gausschebyshev(n,2) | ||
x, w = gausschebyshevu(n) | ||
@test dot(x.^2,w) ≈ π/8 | ||
x, w = gausschebyshev(n,3) | ||
x, w = gausschebyshevv(n) | ||
@test dot(x.^2,w) ≈ π/2 | ||
x, w = gausschebyshev(n,4) | ||
x, w = gausschebyshevw(n) | ||
@test dot(x.^2,w) ≈ π/2 | ||
end | ||
|
||
@testset "x^3" begin | ||
x, w = gausschebyshev(n,1) | ||
@test abs(dot(x.^3,w))<1e-15 | ||
x, w = gausschebyshev(n,2) | ||
@test abs(dot(x.^3,w))<1e-15 | ||
x, w = gausschebyshev(n,3) | ||
x, w = gausschebyshevt(n) | ||
@test abs(dot(x.^3,w)) < 1e-15 | ||
x, w = gausschebyshevu(n) | ||
@test abs(dot(x.^3,w)) < 1e-15 | ||
x, w = gausschebyshevv(n) | ||
@test dot(x.^3,w) ≈ 3*π/8 | ||
x, w = gausschebyshev(n,4) | ||
x, w = gausschebyshevw(n) | ||
@test dot(x.^3,w) ≈ -3*π/8 | ||
end | ||
end | ||
|
||
@testset "deprecated" begin | ||
n = 42 | ||
@test gausschebyshevt(n) == gausschebyshev(n, 1) | ||
@test gausschebyshevu(n) == gausschebyshev(n, 2) | ||
@test gausschebyshevv(n) == gausschebyshev(n, 3) | ||
@test gausschebyshevw(n) == gausschebyshev(n, 4) | ||
@test_throws ArgumentError gausschebyshev(0,5) | ||
end | ||
end |