You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* make deprecations errors
* run doctests; fix bug in printpoly
* adjust one, zero and handling of var
* adjust documentation, move Pade tests to compatability file
* remove round function, caused issues (no deprecation phase). Close#201
The older `Poly` type that this package used prior to `v0.7` is implemented as an alternate basis to provide support for older code bases. As of `v1.0`, this type will be only available by executing `using Polynomials.PolyCompat`.
This will implement simple self-conversions like `convert(::Type{MyPoly}, p::MyPoly) = p` and creates two promote rules. The first allows promotion between two types (e.g. `promote(Polynomial, ChebyshevT)`) and the second allows promotion between parametrized types (e.g. `promote(Polynomial{T}, Polynomial{S})`).
31
31
32
-
For constructors, it implements the shortcut for `MyPoly(...) = MyPoly{T}(...)`, singleton constructor `MyPoly(x::Number, ...)`, and conversion constructor `MyPoly{T}(n::S, ...)`.
32
+
For constructors, it implements the shortcut for `MyPoly(...) = MyPoly{T}(...)`, singleton constructor `MyPoly(x::Number, ...)`, conversion constructor `MyPoly{T}(n::S, ...)`, and `variable` alternative `MyPoly(var=:x)`.
33
33
"""
34
34
macroregister(name)
35
35
poly =esc(name)
@@ -40,19 +40,12 @@ macro register(name)
40
40
$poly{promote_type(T, S)}
41
41
Base.promote_rule(::Type{$poly{T}}, ::Type{S}) where {T,S<:Number} =
42
42
$poly{promote_type(T, S)}
43
-
44
-
function (p::$poly)(x::AbstractVector)
45
-
Base.depwarn(
46
-
"Calling p(x::AbstractVector is deprecated. Use p.(x) instead.",
47
-
Symbol("(p::AbstractPolynomial)"),
48
-
)
49
-
returnp.(x)
50
-
end
51
-
52
43
$poly(coeffs::AbstractVector{T}, var::SymbolLike=:x) where {T} =
53
44
$poly{T}(coeffs, Symbol(var))
54
-
$poly(n::Number, var =:x) =$poly([n], var)
55
-
$poly{T}(n::S, var =:x) where {T,S<:Number} =$poly(T(n), var)
56
45
$poly{T}(x::AbstractVector{S}, var =:x) where {T,S<:Number} =$poly(T.(x), var)
46
+
$poly{T}(n::Number, var =:x) where {T} =$poly(T(n), var)
47
+
$poly(n::Number, var =:x) =$poly([n], var)
48
+
$poly{T}(var=:x) where {T} =variable($poly{T}, var)
0 commit comments