Skip to content

Commit 120d573

Browse files
authored
Fix wrong type casting in ProductFun evaluation (#89)
* Do not cast g(x) to eltype T of user-provided coefficients * Do not cast setdomain() to eltype T of user-provided coefficients
1 parent 327cdb8 commit 120d573

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Multivariate/ProductFun.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ canonicaldomain(f::ProductFun) = canonicaldomain(space(f))
198198
function canonicalevaluate(f::ProductFun{S,V,SS,T},x::Number,::Colon) where {S,V,SS,T}
199199
cd = canonicaldomain(f)
200200
Fun(setdomain(factor(space(f),2),factor(cd,2)),
201-
T[setdomain(fc,factor(cd,1))(x) for fc in f.coefficients])
201+
[setdomain(fc,factor(cd,1))(x) for fc in f.coefficients])
202202
end
203203
canonicalevaluate(f::ProductFun,x::Number,y::Number) = canonicalevaluate(f,x,:)(y)
204204
canonicalevaluate(f::ProductFun{S,V,SS},x::Colon,y::Number) where {S,V,SS<:TensorSpace} =
@@ -213,7 +213,7 @@ evaluate(f::ProductFun,x,y,z) = canonicalevaluate(f,tocanonical(f,x,y,z)...)
213213

214214
# TensorSpace does not use map
215215
evaluate(f::ProductFun{S,V,SS,T},x::Number,::Colon) where {S<:UnivariateSpace,V<:UnivariateSpace,SS<:TensorSpace,T} =
216-
Fun(factor(space(f),2),T[g(x) for g in f.coefficients])
216+
Fun(factor(space(f),2),[g(x) for g in f.coefficients])
217217

218218
evaluate(f::ProductFun{S,V,SS,T},x::Number,y::Number) where {S<:UnivariateSpace,V<:UnivariateSpace,SS<:TensorSpace,T} =
219219
evaluate(f,x,:)(y)

0 commit comments

Comments
 (0)