Skip to content

Commit 95d33ab

Browse files
authored
homogenize first/last definitions (#238)
1 parent 8bafeff commit 95d33ab

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Spaces/Chebyshev/Chebyshev.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ setdomain(S::Chebyshev, d::Domain) = Chebyshev(d)
5757
ones(::Type{T}, S::Chebyshev) where {T<:Number} = Fun(S,fill(one(T),1))
5858
ones(S::Chebyshev) = Fun(S,fill(1.0,1))
5959

60-
function Base.first(f::Fun{<:Chebyshev})
60+
function first(f::Fun{<:Chebyshev})
6161
n = ncoefficients(f)
6262
n == 0 && return zero(cfstype(f))
6363
n == 1 && return f.coefficients[1]
6464
foldr(-,coefficients(f))
6565
end
6666

67-
Base.last(f::Fun{<:Chebyshev}) = reduce(+,coefficients(f))
67+
last(f::Fun{<:Chebyshev}) = reduce(+,coefficients(f))
6868

6969
spacescompatible(a::Chebyshev,b::Chebyshev) = domainscompatible(a,b)
7070
hasfasttransform(::Chebyshev) = true

src/Spaces/Ultraspherical/Ultraspherical.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,17 @@ ones(S::Ultraspherical) = ones(Float64, S)
103103

104104
## Fast evaluation
105105

106-
function Base.first(f::Fun{<:Ultraspherical{Int}})
106+
function first(f::Fun{<:Ultraspherical{Int}})
107107
n = length(f.coefficients)
108108
n == 0 && return zero(cfstype(f))
109109
n == 1 && return first(f.coefficients)
110110
foldr(-,coefficients(f,Chebyshev))
111111
end
112112

113-
Base.last(f::Fun{<:Ultraspherical{Int}}) = reduce(+,coefficients(f,Chebyshev))
113+
last(f::Fun{<:Ultraspherical{Int}}) = reduce(+,coefficients(f,Chebyshev))
114114

115-
Base.first(f::Fun{<:Ultraspherical}) = f(leftendpoint(domain(f)))
116-
Base.last(f::Fun{<:Ultraspherical}) = f(rightendpoint(domain(f)))
115+
first(f::Fun{<:Ultraspherical}) = f(leftendpoint(domain(f)))
116+
last(f::Fun{<:Ultraspherical}) = f(rightendpoint(domain(f)))
117117

118118
function Fun(::typeof(identity), s::Ultraspherical)
119119
d = domain(s)

0 commit comments

Comments
 (0)