@@ -210,7 +210,7 @@ In-place version of [`chop`](@ref)
210
210
function chop! (p:: AbstractPolynomial{T} ;
211
211
rtol:: Real = Base. rtoldefault (real (T)),
212
212
atol:: Real = 0 ,) where {T}
213
- isempty (p . coeffs ) && return p
213
+ isempty (values (p) ) && return p
214
214
tol = norm (p) * rtol + atol
215
215
for i = lastindex (p): - 1 : 0
216
216
val = p[i]
264
264
265
265
Returns the complex conjugate of the polynomial
266
266
"""
267
- LinearAlgebra. conj (p:: P ) where {P <: AbstractPolynomial } = _convert (p, conj ( coeffs (p)) )
267
+ LinearAlgebra. conj (p:: P ) where {P <: AbstractPolynomial } = map (conj, p )
268
268
LinearAlgebra. adjoint (p:: P ) where {P <: AbstractPolynomial } = map (adjoint, p)
269
269
LinearAlgebra. transpose (p:: AbstractPolynomial ) = p
270
270
LinearAlgebra. transpose! (p:: AbstractPolynomial ) = p
@@ -319,7 +319,7 @@ Base.any(pred, p::AbstractPolynomial) = any(pred, values(p))
319
319
320
320
321
321
"""
322
- map(fn, p::AbstractPolynomial, args...v )
322
+ map(fn, p::AbstractPolynomial, args...)
323
323
324
324
Transform coefficients of `p` by applying a function (or other callables) `fn` to each of them.
325
325
@@ -430,7 +430,8 @@ Base.firstindex(p::AbstractPolynomial) = 0
430
430
Base. lastindex (p:: AbstractPolynomial ) = length (p) - 1
431
431
Base. eachindex (p:: AbstractPolynomial ) = 0 : length (p) - 1
432
432
Base. broadcastable (p:: AbstractPolynomial ) = Ref (p)
433
- Base. values (p:: AbstractPolynomial ) = coeffs (p)
433
+ # like coeffs, though possibly only non-zero values (e.g. SparsePolynomial)
434
+ Base. values (p:: AbstractPolynomial ) = coeffs (p)
434
435
435
436
# iteration
436
437
# iteration occurs over the basis polynomials
0 commit comments