@@ -4,7 +4,7 @@ export mindegree, maxdegree, extdegree
4
4
export leadingterm, leadingcoefficient, leadingmonomial
5
5
export removeleadingterm, removemonomials, monic
6
6
7
- Compat . LinearAlgebra. norm (p:: AbstractPolynomialLike , r:: Int = 2 ) = norm (coefficients (p), r)
7
+ LinearAlgebra. norm (p:: AbstractPolynomialLike , r:: Int = 2 ) = LinearAlgebra . norm (coefficients (p), r)
8
8
9
9
changecoefficienttype (:: Type{TT} , :: Type{T} ) where {TT<: AbstractTermLike , T} = termtype (TT, T)
10
10
changecoefficienttype (:: Type{PT} , :: Type{T} ) where {PT<: AbstractPolynomial , T} = polynomialtype (PT, T)
@@ -54,7 +54,7 @@ polynomial(ts::AbstractVector{<:AbstractTerm}, s::SortedUniqState) = polynomial(
54
54
polynomial (a:: AbstractVector , x:: AbstractVector , s:: ListState = MessyState ()) = polynomial ([α * m for (α, m) in zip (a, x)], s)
55
55
polynomial (f:: Function , mv:: AbstractVector{<:AbstractMonomialLike} ) = polynomial ([f (i) * mv[i] for i in 1 : length (mv)])
56
56
function polynomial (Q:: AbstractMatrix , mv:: AbstractVector )
57
- dot (mv, Q * mv)
57
+ LinearAlgebra . dot (mv, Q * mv)
58
58
end
59
59
function polynomial (Q:: AbstractMatrix , mv:: AbstractVector , :: Type{T} ) where T
60
60
polynomial (polynomial (Q, mv), T)
@@ -368,8 +368,10 @@ function mapcoefficientsnz(f::Function, p::AbstractPolynomialLike)
368
368
end
369
369
mapcoefficientsnz (f:: Function , t:: AbstractTermLike ) = f (coefficient (t)) * monomial (t)
370
370
371
- Base. round (t:: AbstractTermLike , args... ) = round (coefficient (t), args... ) * monomial (t)
372
- function Base. round (p:: AbstractPolynomialLike , args... )
371
+ Base. round (t:: AbstractTermLike ; args... ) = round (coefficient (t); args... ) * monomial (t)
372
+ function Base. round (p:: AbstractPolynomialLike ; args... )
373
373
# round(0.1) is zero so we cannot use SortedUniqState
374
- polynomial (round .(terms (p), args... ), SortedState ())
374
+ polynomial (round .(terms (p); args... ), SortedState ())
375
375
end
376
+
377
+ Base. broadcastable (p:: AbstractPolynomialLike ) = Ref (p)
0 commit comments