Skip to content

Commit 7f36cf3

Browse files
committed
cleanup
1 parent 593b4a6 commit 7f36cf3

File tree

4 files changed

+3
-17
lines changed

4 files changed

+3
-17
lines changed

src/common.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,6 @@ In-place version of [`truncate`](@ref)
173173
function truncate!(p::AbstractPolynomial{T};
174174
rtol::Real = Base.rtoldefault(real(T)),
175175
atol::Real = 0,) where {T}
176-
177-
#
178-
179-
180176
max_coeff = maximum(abs, coeffs(p))
181177
thresh = max_coeff * rtol + atol
182178
map!(c->abs(c) <= thresh ? zero(T) : c, coeffs(p), coeffs(p))
@@ -362,10 +358,6 @@ Base.lastindex(p::AbstractPolynomial) = length(p) - 1
362358
Base.eachindex(p::AbstractPolynomial) = 0:length(p) - 1
363359
Base.broadcastable(p::AbstractPolynomial) = Ref(p)
364360

365-
366-
367-
368-
369361
# iteration
370362
# iteration occurs over the basis polynomials
371363
Base.iterate(p::AbstractPolynomial) = (p[0] * one(typeof(p)), 1)
@@ -566,7 +558,6 @@ Base.:(==)(p1::AbstractPolynomial, p2::AbstractPolynomial) =
566558
Base.:(==)(p::AbstractPolynomial, n::Number) = degree(p) <= 0 && p[0] == n
567559
Base.:(==)(n::Number, p::AbstractPolynomial) = p == n
568560

569-
570561
function Base.isapprox(p1::AbstractPolynomial{T},
571562
p2::AbstractPolynomial{S};
572563
rtol::Real = (Base.rtoldefault(T, S, 0)),
@@ -592,7 +583,6 @@ function Base.isapprox(p1::AbstractPolynomial{T},
592583
isapprox(coeffs(p1t), [n], rtol = rtol, atol = atol)
593584
end
594585

595-
596586
Base.isapprox(n::S,
597587
p1::AbstractPolynomial{T};
598588
rtol::Real = (Base.rtoldefault(T, S, 0)),

src/contrib.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ function evalpoly(x::S, p::Tuple) where {S}
3737
if @generated
3838
N = length(p.parameters)
3939
ex = :(p[end]*_one(S))
40-
if N > 0
41-
for i in N-1:-1:1
42-
ex = :(_muladd(x, $ex, p[$i]))
43-
end
40+
for i in N-1:-1:1
41+
ex = :(_muladd(x, $ex, p[$i]))
4442
end
4543
ex
4644
else

src/polynomials/standard-basis.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ abstract type StandardBasisPolynomial{T} <: AbstractPolynomial{T} end
22

33

44

5-
65
function showterm(io::IO, ::Type{<:StandardBasisPolynomial}, pj::T, var, j, first::Bool, mimetype) where {T}
76
if iszero(pj) return false end
87
pj = printsign(io, pj, first, mimetype)
@@ -14,7 +13,6 @@ function showterm(io::IO, ::Type{<:StandardBasisPolynomial}, pj::T, var, j, firs
1413
return true
1514
end
1615

17-
1816
# allows broadcast issue #209
1917
evalpoly(x, p::StandardBasisPolynomial) = p(x)
2018

src/show.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function unicode_exponent(io, j)
247247
end
248248

249249
function unicode_subscript(io, j)
250-
a = ("","","","","","","","","","","","","")
250+
a = ("","","","","","","","","","","","","")
251251
for i in string(j)
252252
print(io, a[Int(i)-44])
253253
end

0 commit comments

Comments
 (0)