Skip to content

Commit 8b52556

Browse files
committed
split default coeffs to separate function
1 parent a6bf472 commit 8b52556

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Spaces/Jacobi/Jacobi.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,16 @@ one(S::Jacobi) = Fun(S,fill(one(Float64),1))
134134
zeros(::Type{T},S::Jacobi) where {T<:Number} = Fun(S,zeros(T,1))
135135
zeros(S::Jacobi) = Fun(S,zeros(prectype(S),1))
136136

137-
_Fun(J::Jacobi, ::ChebyshevInterval) = Fun(J, [(J.b-J.a)/(2+J.a+J.b), 2.0/(2+J.a+J.b)])
137+
_chebyintervalcoeff(J) = [(J.b-J.a)/(2+J.a+J.b), 2.0/(2+J.a+J.b)]
138+
_Fun(J::Jacobi, ::ChebyshevInterval) = Fun(J, _chebyintervalcoeff(J))
138139
function _Fun(J::Jacobi, d::ClosedInterval)
139140
scale = complexlength(d)/2
140-
coeffs = [2.0*(J.b + 1)/(2+J.a+J.b), 2.0/(2+J.a+J.b)] .* scale
141+
coeffs = _chebyintervalcoeff(J) .* scale
141142
coeffs[1] += leftendpoint(d)
142143
Fun(J, coeffs)
143144
end
144145
function _Fun(J::Jacobi, d)
145-
complexlength(d)/2*(Fun(J,[2.0*(J.b + 1)/(2+J.a+J.b),2.0/(2+J.a+J.b)]))+leftendpoint(d)
146+
complexlength(d)/2*(Fun(J,_chebyintervalcoeff(J)))+leftendpoint(d)
146147
end
147148

148149
function Fun(::typeof(identity), J::Jacobi)

0 commit comments

Comments
 (0)