Skip to content

Commit b110ff2

Browse files
authored
Fix evaluation for arrayspace (#287)
* Fix `Evaluation` for `ArraySpace` * Version bump to v0.7.39
1 parent 45a7d48 commit b110ff2

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.7.38"
3+
version = "0.7.39"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Operators/functionals/Evaluation.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ end
5858

5959
## default getindex
6060
function getindex(D::ConcreteEvaluation,k::Integer)
61-
f = Fun(D.space, [zeros(eltype(D),k-1); one(eltype(D))])
61+
T = prectype(domainspace(D))
62+
f = Fun(D.space, [zeros(T,k-1); one(T)])
6263
df = differentiate(f,D.order)
6364
v = df(D.x)
6465
strictconvert(eltype(D), v)

src/show.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ function show(io::IO, f::Fun)
1010
print(io,")")
1111
end
1212

13-
show(io::IO,f::Fun{<:ConstantSpace{AnyDomain}}) =
14-
print(io, convert(Number,f), " anywhere")
15-
16-
show(io::IO,f::Fun{<:ConstantSpace}) =
17-
print(io, convert(Number,f), " on ", domain(f))
13+
function show(io::IO,f::Fun{<:ConstantSpace})
14+
print(io, only(coefficients(f)))
15+
d = domain(f)
16+
if d isa AnyDomain
17+
print(io, " anywhere")
18+
else
19+
print(io, " on ", d)
20+
end
21+
end
1822

1923
## MultivariateFun
2024

0 commit comments

Comments
 (0)