Skip to content

Commit e3c8815

Browse files
committed
Implement all, any & map
See discussion #259 (comment)
1 parent 3be0f76 commit e3c8815

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/common.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,9 @@ function Base.iszero(p::AbstractPolynomial)
301301
end
302302

303303
# See discussions in https://github.com/JuliaMath/Polynomials.jl/issues/258
304-
is_(fn, p::AbstractPolynomial) = all(fn, coeffs(p)) # Do not export
305-
as_(fn, p::P) where {P<:AbstractPolynomial} = (P)(fn.(coeffs(p)), p.var) # Do not export
304+
Base.all(pred, poly::AbstractPolynomial) = all(pred, poly[:])
305+
Base.any(pred, poly::AbstractPolynomial) = any(pred, poly[:])
306+
Base.map(fn, p::P) where {P<:AbstractPolynomial} = (P)(map(fn, coeffs(p)), p.var)
306307

307308
"""
308309
isreal(p::AbstractPolynomial)

0 commit comments

Comments
 (0)