Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,6 @@ function Base.map(fn, p::P, args...) where {P<:AbstractPolynomial}
return ⟒(P){R,X}(xs)
end


"""
isreal(p::AbstractPolynomial)

Expand Down
17 changes: 17 additions & 0 deletions test/StandardBasis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,23 @@ end
end
end

@testset "map/any/all" begin
# map over a polynomial and return a polynomial
p = Polynomial([1,2,3])
pp = map(float,p)
@test !(eltype(p) <: AbstractFloat)
@test eltype(pp) <: AbstractFloat
@test pp ≈ p
@test all(isinteger, p)
@test any(>=(2), p)

p = Polynomial([im, 2, 3])
q = Polynomial([0,2,3])
@test map(real, p) == q

v = [1,2,3]
@test map(sin, Polynomial(v)) == Polynomial(sin.(v))
end

@testset "As matrix elements" begin

Expand Down
Loading