Skip to content

Commit a100a5e

Browse files
committed
restore Clenshaw for AbstractQuasiVector
1 parent d442a80 commit a100a5e

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/ClassicalOrthogonalPolynomials.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ import ContinuumArrays: Basis, Weight, basis_axes, @simplify, Identity, Abstract
3939
AffineQuasiVector, AffineMap, AbstractWeightLayout, AbstractWeightedBasisLayout, WeightedBasisLayout, WeightedBasisLayouts, demap, AbstractBasisLayout, BasisLayout,
4040
checkpoints, weight, unweighted, MappedBasisLayouts, sum_layout, invmap, plan_ldiv, layout_broadcasted, MappedBasisLayout, SubBasisLayout, broadcastbasis_layout,
4141
plan_grid_transform, plan_transform, MAX_PLOT_POINTS, MulPlan, grammatrix, AdjointBasisLayout, grammatrix_layout, plan_transform_layout, _cumsum
42-
import FastTransforms: Λ, forwardrecurrence, forwardrecurrence!, _forwardrecurrence!, clenshaw, clenshaw!,
43-
_forwardrecurrence_next, _clenshaw_next, check_clenshaw_recurrences, ChebyshevGrid, chebyshevpoints, Plan, ScaledPlan, th_cheb2leg
42+
import FastTransforms: Λ, ChebyshevGrid, chebyshevpoints, Plan, ScaledPlan, th_cheb2leg
43+
import RecurrenceRelatioships: forwardrecurrence, forwardrecurrence!, _forwardrecurrence!, clenshaw, clenshaw!,
44+
_forwardrecurrence_next, _clenshaw_next, check_clenshaw_recurrences
4445

4546
import FastGaussQuadrature: jacobimoment
4647

src/clenshaw.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
3+
24
# Assume 1 normalization
35
_p0(A) = one(eltype(A))
46

@@ -123,4 +125,10 @@ function _broadcasted_layout_broadcasted_mul(::Tuple{AbstractWeightLayout,Polyno
123125
Q = OrthogonalPolynomial(w)
124126
a = (w .* Q) * (Q \ v)
125127
a .* P
128+
end
129+
130+
# constructor for Clenshaw
131+
function Clenshaw(a::AbstractQuasiVector, X::AbstractQuasiMatrix)
132+
P,c = arguments(a)
133+
Clenshaw(paddeddata(c), recurrencecoefficients(P)..., jacobimatrix(X), _p0(P))
126134
end

0 commit comments

Comments
 (0)