PolynomialTools
FromCoefficientVector
return a univariate polynomial from a Vector of coefficients
FromCoefficientList
return a univariate polynomial from list of coefficients
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
FromCoefficientList(L, vars, opts)
FromCoefficientVector(L, vars, opts)
L
-
list of coefficients
var
name,list for the polynomial variable(s)
opts
(optional) equations of the form option=value (see below)
termorder = forward, reverse
By default, the first entry of the output will be the constant coefficient of the polynomial. If reverse is specified, the last entry of the output will be the constant coefficient.
form = monomial, horner
The polynomial is constructed in standard monomial form by default, but can be created in Horner form also known as nested multiplication form.
The FromCoefficientList(L, vars) calling sequence returns a polynomial in vars from a list of coefficients.
The FromCoefficientVector(L, vars) calling sequence returns a polynomial in vars from a vector of coefficients.
These are inverse commands to CoefficientList and CoefficientVector.
FromCoefficientVector is written to handle sparse Vector inputs efficiently.
These commands now support polynomials in many variables.
with⁡PolynomialTools:
FromCoefficientList⁡1,−1,2,3,x
3⁢x3+2⁢x2−x+1
FromCoefficientList⁡1,−1,2,3,x,form=horner
x⁢−1+x⁢2+3⁢x+1
FromCoefficientList⁡1,0,0,2,0,x,termorder=reverse
x4+2⁢x
FromCoefficientList⁡−7,22,−55,−94,87,−56,x,y
−94⁢x2+87⁢x⁢y−56⁢y2+22⁢x−55⁢y−7
FromCoefficientVector⁡y3,−y2,y−2,1,x
y3−y2⁢x+y−2⁢x2+x3
FromCoefficientList⁡,x
0
FromCoefficientVector⁡CoefficientVector⁡0,x,x
Most vector shapes will be handled efficiently
v1≔Vector⁡500000001,shape=unit300:
FromCoefficientVector⁡v1,x
x299
v2≔Vector⁡200000001,shape=scalar50000,a:
FromCoefficientVector⁡v2,x
a⁢x49999
v3≔Vector⁡10,shape=constantb2−1:
FromCoefficientVector⁡v3,x
b2−1+b2−1⁢x+b2−1⁢x2+b2−1⁢x3+b2−1⁢x4+b2−1⁢x5+b2−1⁢x6+b2−1⁢x7+b2−1⁢x8+b2−1⁢x9
v4≔Vector⁡1000000001,1=5,1000000001=1,storage=sparse:
FromCoefficientVector⁡v4,x
x1000000000+5
The option was updated in Maple 2021.
See Also
convert,horner
PolynomialTools[CoefficientVector]
Vector
Download Help Document