From bdc60b03ffabb1a0d6578855ad7697b387c7452d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 13 Jul 2024 20:47:10 +0200 Subject: [PATCH] Fix format --- docs/src/index.md | 1 + src/chebyshev.jl | 13 +++++++++++-- src/trigonometric.jl | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index 9200511..bcc9504 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -38,4 +38,5 @@ AbstractGegenbauer Legendre ChebyshevFirstKind ChebyshevSecondKind +Trigonometric ``` diff --git a/src/chebyshev.jl b/src/chebyshev.jl index 46b57cc..aeb35d4 100644 --- a/src/chebyshev.jl +++ b/src/chebyshev.jl @@ -36,7 +36,10 @@ function univariate_mul!(::Mul{Chebyshev}, terms, var, a, b) return end -function (mul::Mul{B})(a::MP.AbstractMonomial, b::MP.AbstractMonomial) where {B<:AbstractMonomialIndexed} +function (mul::Mul{B})( + a::MP.AbstractMonomial, + b::MP.AbstractMonomial, +) where {B<:AbstractMonomialIndexed} terms = [MP.term(1 // 1, MP.constant_monomial(a * b))] vars_a = MP.effective_variables(a) var_state_a = iterate(vars_a) @@ -60,7 +63,13 @@ function (mul::Mul{B})(a::MP.AbstractMonomial, b::MP.AbstractMonomial) where {B< else var_a, state_a = var_state_a var_b, state_b = var_state_b - univariate_mul!(mul, terms, var_a, MP.degree(a, var_a), MP.degree(b, var_b)) + univariate_mul!( + mul, + terms, + var_a, + MP.degree(a, var_a), + MP.degree(b, var_b), + ) var_state_a = iterate(vars_a, state_a) var_state_b = iterate(vars_b, state_b) end diff --git a/src/trigonometric.jl b/src/trigonometric.jl index 2f5305a..e8f026b 100644 --- a/src/trigonometric.jl +++ b/src/trigonometric.jl @@ -85,7 +85,8 @@ function recurrence_eval( d = _id(degree) if _is_cos(degree) # Chebyshev first order - return 2 * value * previous[_cos_id(d - 1) + 1] - previous[_cos_id(d - 2) + 1] + return 2 * value * previous[_cos_id(d - 1)+1] - + previous[_cos_id(d - 2)+1] else return sqrt(1 - previous[degree]^2) end