Skip to content

Commit 6cf64e7

Browse files
authored
plus for a single Fun (#144)
1 parent 0f98432 commit 6cf64e7

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/Fun.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ iterate(A::ArrayFun, i=1) = (@_inline_meta; (i % UInt) - 1 < length(A) ? (@inbou
167167

168168
in(x::ScalarFun, y::ScalarFun) = x == y
169169

170-
171-
172-
173-
174170
setspace(v::AbstractVector,s::Space) = Fun(s,v)
175171
setspace(f::Fun,s::Space) = Fun(s,f.coefficients)
176172

@@ -341,7 +337,7 @@ function axpy!(a,xcfs::AbstractVector,Y::Fun)
341337
end
342338

343339

344-
340+
+(a::Fun) = copy(a)
345341
-(f::Fun) = Fun(f.space,-f.coefficients)
346342
-(c::Number,f::Fun) = -(f-c)
347343

test/SpacesTest.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ using ApproxFunOrthogonalPolynomials
1414

1515
f = Fun(space(f),[1.,2.,3.])
1616

17+
@test (+f) == f
18+
1719
@testset "conversions" begin
1820
@testset for S in Any[typeof(space(f)), Any]
1921
T = Fun{S, Any, Any}

0 commit comments

Comments
 (0)