Skip to content

Commit

Permalink
Return only the value of evaluate when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHnt committed Aug 28, 2023
1 parent c9ccf79 commit 611b2fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sequence_spaces/special_operators/evaluation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,13 @@ function evaluate(a::Sequence, x)
CoefType = _coeftype(ℰ, space_a, eltype(a))
c = Sequence(new_space, Vector{CoefType}(undef, dimension(new_space)))
_apply!(c, ℰ, a)
return c
return _return_evaluate(c, x)
end

_return_evaluate(a::Sequence, ::Any) = a
_return_evaluate(a::Sequence{<:BaseSpace}, ::Number) = coefficients(a)[1]
_return_evaluate(a::Sequence{TensorSpace{T}}, ::NTuple{N,Number}) where {N,T<:NTuple{N,BaseSpace}} = coefficients(a)[1]

"""
evaluate!(c::Sequence, a::Sequence, x)
Expand Down

0 comments on commit 611b2fc

Please sign in to comment.