We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1718c0b commit eeb33d4Copy full SHA for eeb33d4
Project.toml
@@ -1,6 +1,6 @@
1
name = "ApproxFunBase"
2
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3
-version = "0.5.8"
+version = "0.5.9"
4
5
[deps]
6
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
src/ApproxFunBase.jl
@@ -23,7 +23,7 @@ import Base: values, convert, getindex, setindex!, *, +, -, ==, <, <=, >, |, !,
23
isless, union, angle, join, isnan, isapprox, isempty, sort, merge, promote_rule,
24
minimum, maximum, extrema, argmax, argmin, findmax, findmin, isfinite,
25
zeros, zero, one, promote_rule, repeat, length, resize!, isinf,
26
- getproperty, findfirst, unsafe_getindex, fld, cld, div, real, imag,
+ getproperty, findfirst, unsafe_getindex, fld, cld, div, imag,
27
@_inline_meta, eachindex, firstindex, lastindex, keys, isreal, OneTo,
28
Array, Vector, Matrix, view, ones, @propagate_inbounds, print_array,
29
split, iszero, permutedims
src/Fun.jl
@@ -430,8 +430,8 @@ end
430
431
transpose(f::Fun) = f # default no-op
432
433
-for op = (:(real),:(imag),:(conj))
434
- @eval ($op)(f::Fun{S}) where {S<:RealSpace} = Fun(f.space,($op)(f.coefficients))
+for op = (:real, :imag, :conj)
+ @eval Base.$op(f::Fun{S}) where {S<:RealSpace} = Fun(f.space, ($op)(f.coefficients))
435
end
436
437
conj(f::Fun) = error("Override conj for $(typeof(f))")
test/SpacesTest.jl
@@ -12,6 +12,16 @@ import ApproxFunBase: PointSpace, HeavisideSpace, PiecewiseSegment, dimension, V
12
@test f/a == Fun(x->(x-0.1)*exp(-x),space(f))
13
14
f = Fun(space(f),[1.,2.,3.])
15
+
16
+ @testset "real/complex coefficients" begin
17
+ c = [1:4;]
18
+ for c2 in Any[c, c*im]
19
+ g = Fun(PointSpace(1:4), c2)
20
+ for fn in [real, imag, conj]
21
+ @test coefficients(fn(g)) == fn(c2)
22
+ end
@testset "Derivative operator for HeavisideSpace" begin
test/runtests.jl
@@ -25,6 +25,11 @@ import ApproxFunBase: ∞
[(1,1),(1,2),(2,1),(2,2),(3,1),(3,2)]
+ @testset "issue #94" begin
+ @test ApproxFunBase.real !== Base.real
30
+ @test_throws MethodError ApproxFunBase.real(1,2)
31
32
33
# TODO: Tensorizer tests
34
35
0 commit comments