Dom
::DistributedPolynomial
Domains of distributed polynomials
Syntax
Domain Creation
Dom::DistributedPolynomial(<Vars, <R, <Order>>
>)
Element Creation
Dom::DistributedPolynomial(Vars, R, Order)(p
)
Dom::DistributedPolynomial(Vars, R, Order)(lm
)
Dom::DistributedPolynomial(Vars, R, Order)(lm
, v
)
Description
Dom::DistributedPolynomial(Vars, R, ..)
creates
the domain of polynomials in the variables of the list Vars
over
the commutative ring R
in distributed representation.
Dom::DistributedPolynomial(Vars, R, Order)
creates
a domain of polynomials in the variables of the list Vars
over
a domain of category Cat::CommutativeRing
in
sparse distributed representation with respect to the monomial ordering Order
.
If Dom::DistributedPolynomial
is called without
any argument, a polynomial domain in arbitrarily many indeterminates
over the domain Dom::ExpressionField
(normal)
with
respect to the lexicographic monomial ordering is created.
If Dom::DistributedPolynomial
is called only
with the variable list Vars
as argument, the polynomial
domain in the variable list Vars
over the domain Dom::ExpressionField
(normal)
with
respect to the lexicographic monomial ordering is created.
Dom::DistributedPolynomial
accepts expressions
as indeterminates, similar to the kernel domain DOM_POLY
. Hence, for example, [x,cos(x)]
is
a valid variable list.
If the variable list Vars
is the empty list
([]
), a polynomial domain in arbitrarily many indeterminates
is created. In this case, when creating new elements from polynomials
or polynomial expressions, the system function indets
is first called to get the variables
and then the polynomial is created with respect to these variables.
Hence, in this case only identifiers can be valid indeterminates,
because indets
returns
only identifiers.
It is not allowed to create polynomial domains in arbitrarily
many indeterminates over another polynomial domain of category Cat::Polynomial
, but it is
possible to create multivariate polynomial domains with a given list
of variables over any polynomial domain.
Dom::DistributedPolynomial
represents polynomials
over arbitrary commutative rings. It is intended as a basic domain
for distributed polynomials from which it is easy to create new distributed
polynomial domains.
All usual algebraic and arithmetical polynomial operations are
implemented, including Gröbner basis computation.
Note
It is highly recommended to use only coefficient rings with
unique zero representation. Otherwise it can happen that, e.g., a
polynomial division will not terminate or a wrong degree will be returned.
Please note that for reasons of efficiency not all methods check
their arguments, not even at the interactive level. In particular
this is true for many access methods, converting methods and technical
methods.
Examples
Example 1
The following call creates a polynomial domain in x, y and z.
Since neither the coefficient ring nor the monomial ordering
was specified, this domain is created with the default values for
these parameters.
It is rather easy to create elements of this domain, as e.g.
In contrast to expressions all elements of this domain have
a representation which is fixed by the chosen Order
,
the representation of the coefficient ring R
and
the way of representing monomials.
With these elements one can now perform usual arithmetic operations
as, e.g., (scalar) multiplication, multiplication with integers and
adding polynomials and ring elements:
There are a lot of methods for manipulating polynomials and
to get access to all parts of a polynomial. For example one has access
to the leading monomial of a
as follows:
The leading monomial of a polynomial depends on the monomial
ordering, so with respect to the degree order one gets a different
result:
To get a
minus its leading monomial one may
call:
Obviously the following identity holds:
There are also methods for converting elements of this domain
into other domains, like a basic polynomial domain or the domain of
arbitrary expressions:
Entries
"characteristic" | The characteristic of this domain. |
"coeffRing" | The coefficient ring of this domain as defined by the
parameter R . |
"key" | The name of the created domain. |
"one" | The neutral element w.r.t. "_mult" . |
"ordering" | The monomial order as defined by the parameter Order . |
"variables" | The list of variables as defined by the parameter Vars . |
"zero" | The neutral element w.r.t. "_plus" . |
Methods
expand all
Mathematical Methods
_divide
— Exact polynomial division
_divide(a
, b
)
_divide(a
, b
)
_divide(a
, b
)
It overloads the function _divide
for polynomials,
i.e., one may use it either in the form a / b
,
or in functional form _divide(a, b)
.
Note
This method only exists if R
is an integral
domain, i.e., a domain of category Cat::IntegralDomain
.
_invert
— Inverse of an element
_mult
— Multiplie polynomials and coefficient ring elements
_mult(<a, b, …
>)
This method overloads the function _mult
for polynomials,
i.e., one may use it either in the form a * b * ...
or
in functional notation _mult(a, b, ...)
.
_negate
— Negate a polynomial
_negate(a
)
This method overloads the function _negate
for polynomials, i.e., one may
use it either in the form -a
or in functional notation _negate(a)
.
_plus
— Add polynomials and coefficent ring elements
_plus(<a, b, …
>)
This method overloads the function _plus
for polynomials,
i.e., one may use it either in the form a + b + ...
or
in functional notation _plus(a, b, ...)
.
_power
— Nth power of a polynomial
_power(a
, n
)
This method overloads the function _power
for polynomials, i.e., one may
use it either in the form a^n
or in functional
notation _power(a,n)
.
_subtract
— Subtract a polynomial or a coefficient ring element
_subtract(a
, b
)
This method overloads the function _subtract
for polynomials, i.e., one
may use it either in the form a - b
or in functional
notation _subtract(a, b)
.
associates
— Test if elements are associates
content
— Content of a polynomial
content(a
)
Note
This method only exists if R
is a domain
of category Cat::GcdDomain
.
D
— Differential operator for polynomials
Dpoly
— Differential operator for polynomials
Dpoly(a
)
Dpoly(l
, a
)
Dpoly(l,a)
computes the partial derivative
of a
with respect to l
. For
details see polylib::Dpoly
.
This method overloads the function polylib::Dpoly
for polynomials.
decompose
— Functional decomposition of a polynomial
decompose(a
, <var
>)
If a
is a polynomial in only one variable,
the second argument is not necessary.
This method overloads the function polylib::decompose
for polynomials.
diff
— Differentiate a polynomial
diff(a
, varseq
)
If varseq
is an empty sequence, a
is
returned unchanged.
If in varseq
an expression occurs which is
not a variable of a
, the zero polynomial is returned.
This method overloads the function diff
for polynomials.
dimension
— Dimension of affine variety
dimension(ais
, <ord
>)
dimension(ais
, <ord
>)
This method is merely an interface for the function groebner::dimension
.
Note
This method only exists if R
is a field,
i.e., a domain of category Cat::Field
and Vars
is
not the empty list.
divide
— Divide polynomials
divide(a
, b
,
<Quo | Rem | Exact
>)
divide(a
, b
, var
,
<Quo | Rem | Exact
>)
If no option is given, the quotient s
and
the remainder r
are computed such that a
= s*b + r
and the degree of r
in the
relevant indeterminate is smaller than that of b
.
The sequence consisting of s, r
is returned, otherwise FAIL
.
If the option Quo
is given, only the quotient s
is
returned.
If the option Rem
is given, only the remainder r
is
returned.
If the option Exact
is given, only the quotient s
is
returned, in case the remainder is zero, otherwise FAIL
.
divide(a,b,Exact)
divides the multivariate
polynomial a
by b
. If a
cannot
be divided by b
, the method returns FAIL
.
This method overloads the function divide
for polynomials.
Note
This method only exists if R
is a field,
i.e., a domain of category Cat::Field
and
either this domain is of category Cat::UnivariatePolynomial(R)
or R
has
characteristic zero (R::characteristic = 0
). If
the first pair of conditions is true then the first call is valid
otherwise the second one.
divides
— Test if elements divides another
equiv
— Test for equivalence
evalp
— Evaluate a polynomial
evalp(a
, var = e
)
This method overloads the function evalp
for polynomials.
factor
— Factor a polynomial
factor(a
)
This method overloads the function factor
for polynomials.
func_call
— Applie expressions to a polynomial
func_call(a
, e1, …
, en
,
<Expr>)
func_call(a
, e1, …
, en
,
<Expr>)
func_call(a
, e1, …
, en
,
<Expr>)
a(e1,...,en)
applies the sequence e1,...,en
of
either elements of this domain or elements of R
with
respect to Vars
(where n
is
the number of variables) to the polynomial a
. An
element of this domain or an element of the coefficient ring respectively
is returned.
a(e1,...,en, Expr)
applies the sequence of
expressions or of elements of this domain or of elements of R
to
the polynomial a
. With this call a
is
first converted into an expression. Afterwards e1,...,en
is
substituted into this expression with respect to Vars
.
The return value may be any object.
The number of variables must be equal to the number of applied
expressions.
Note
This method only exists if Vars
has at least
one indeterminate.
gcd
— Greatest common divisor of polynomials
gcd(a, b, …
)
This method overloads the function gcd
for polynomials.
Note
This method only exists if R
is a domain
of category Cat::GcdDomain
.
gcdex
— Extended Euclidean algorithm for polynomials
gcdex(a
, b
)
This method overloads the function gcdex
for polynomials. Especially, it
only works for coefficient rings described there.
Note
This method only exists if R
is a domain
of category Cat::GcdDomain
.
groebner
— Reduced Gröbner basis
groebner(ais
, <ord
>,
<Reorder>)
groebner(ais
, <ord
>,
<Reorder>)
If the option Reorder
is given, the lexicographical
order of variables may change to another one that is likely to decrease
the running time.
Note
Note that this may also cause a change of the returned list,
which may now have polynomials over the same coefficient ring R
but
with a possibly re-ordered variable list. Thus, it may contain elements not belonging
to this domain.
This method is merely an interface for the function groebner::gbasis
.
Note
This method only exists if R
is a field,
i.e., a domain of category Cat::Field
,
and Vars
is not the empty list.
idealGenerator
— Generator of finitely generated ideal
int
— Definite and indefinite integration of a polynomial
int(a
, <x
>)
int(a
, <x = x0 ..
x1
>)
int(a,x=x0..x1)
returns the definite integral or FAIL
,
if the result is not an element of this domain or an element of a
polynomial domain over Dom::Fraction(R)
.
This method overloads the function int
for polynomials.
intmult
— Multiplie a polynomial with an integer
intmult(a
, z
)
This method is more efficient than using polynomial multiplication
and is, e.g., necessary for the method "Dpoly"
.
irreducible
— Test if element is irreducible
isone
— Test for one
isone(a
)
Note
The result can only be valid if the coefficients of a
are
in normal form (i.e., if zero has a unique representation in R
).
Thus, R
should have at least Ax::normalRep
.
iszero
— Test for zero
iszero(a
)
Note
The result can only be valid, if the coefficients of a
are
in normal form (i.e., if zero has a unique representation in R
).
Thus, the coefficient ring R
should have at least Ax::normalRep
.
lcm
— Least common multiple of polynomials
lcm(a, b, …
)
This method overloads the function lcm
for polynomials.
Note
This method only exists if R
is a domain
of category Cat::GcdDomain
.
makeIntegral
— Make the coefficients fraction free
makeIntegral(a
)
Note
This method only exists if R
is a domain
of category Cat::GcdDomain
and R
has
the method "denom"
.
monic
— Normalize a polynomial
monic(a
)
The zero polynomial returns itself.
Note
This method only exists if R
is a field,
i.e., a domain of category Cat::Field
.
normalForm
— Complete reduction modulo an ideal
normalForm(a
, ais
,
<ord
>)
normalForm(a
, ais
,
<ord
>)
This method is merely an interface for the function groebner::normalf
.
Note
This method only exists if R
is a field,
i.e., a domain of category Cat::Field
,
and Vars
is not the empty list.
pdioe
— Solve polynomial Diophantine equations
pdioe(a
, b
, c
)
This method overloads the function solvelib::pdioe
.
Note
This method only exists if R
is a field,
i.e., a domain of category Cat::Field
and Vars
consists
of a single variable.
pdivide
— Pseudo-division of polynomials
pdivide(a
, b
,
<Quo | Rem
>)
If the option Quo
is given, only the pseudo-quotient q
is
returned.
If the option Rem
is given, only the pseudo-remainder r
is
returned.
This method overloads the function pdivide
for polynomials.
Note
This method only exists if Vars
consists
of a single variable.
pquo
— Pseudo-quotient of polynomials
pquo(a
, b
)
Note
This method only exists if Vars
consists
of a single variable.
prem
— Pseudo-remainder of polynomials
prem(a
, b
)
Note
This method only exists if Vars
consists
of a single variable.
random
— Create a random polynomial
random()
With every call the global variable SEED
is
changed by a call of random()
. Thus it is hard
to create the same random sequence twice, see random
.
If the parameter Vars
is the empty list,
first a list of 1 to 4 variables
is generated randomly and the random polynomial is generated in these
indeterminates afterwards.
This method overloads the function polylib::randpoly
for polynomials.
rem
— Euclidean remainder
resultant
— Resultant of two polynomials
resultant(a
, b
,
<var
>)
resultant(a, b, var)
returns the resultant
of a
and b
with respect to the
variable var
.
The value returned is a polynomial of this domain or FAIL
.
This method overloads the function polylib::resultant
for polynomials.
Note
This method only exists if R
has the method "_divide"
.
ringmult
— Multiplie a polynomial with a coefficient ring element
solve
— Zero of polynomials
solve(a
, <var
>,
<options
>)
solve(a
, <vars
>,
<options
>)
solve(ais
, <var
>,
<options
>)
solve(ais
, <vars
>,
<options
>)
solve(ais, ..)
tries to find the zeros of
the polynomial system ais
. The exact behavior depends
on further arguments.
For a detailed description of possible return values and options
see function solve
.
This method overloads the function solve
.
SPolynomial
— Compute the S-polynomial of two polynomials
SPolynomial(a
, b
,
<ord
>)
This method is merely an interface for the function groebner::spoly
.
Note
This method only exists if R
is a field,
i.e., a domain of category Cat::Field
,
and Vars
is not the empty list.
sqrfree
— Square-free factorization of polynomials
sqrfree(a
)
The ai
are primitive and pairwise different
square-free divisors of a
and represented as elements
of this domain. u
is a unit of the coefficient
ring and represented as an element of this domain. The ei
are
integers.
This method overloads the function polylib::sqrfree
for polynomials.
unitNormalRep
— Return unit normal representation
Inherited from Cat::Polynomial
.
Access Methods
coeff
— Coefficient of a polynomial
coeff(a
)
coeff(a
, var
, n
)
coeff(a
, n
)
coeff(a,var,n)
returns the coefficient of
the term var^n
—as an element of this domain
if it is of category Cat::Polynomial(R)
, or as
an element of the coefficient ring R
if it is of Cat::UnivariatePolynomial(R)
,
where a
is considered as a univariate polynomial
in a valid variable var
.
coeff(a,n)
returns the coefficient of the
term var^n
—as an element of this domain
if it is of category Cat::Polynomial(R)
, or as
an element of the coefficient ring R
if it is of Cat::UnivariatePolynomial(R)
,
where a
is considered as a univariate polynomial
in var
and var
is the main variable
of a
, i.e., the variable returned by dom::mainvar(a)
.
This method overloads the function coeff
for polynomials.
degree
— Degree of a polynomial
degree(a
)
degree(a
, var
)
degree(a, var)
returns the degree of a
with
respect to var
.
The degree of the zero polynomial is defined as zero.
This method overloads the function degree
for polynomials.
degreevec
— Vector of exponents of the leading term of a polynomial
degreevec(a
, <ord
>)
The degree vector of the zero polynomial is defined as a list
of zeros.
This method overloads the function degreevec
for polynomials.
euclideanDegree
— Euclidean degree function
euclideanDegree(a
)
Note
This method only exists if Vars
consists
of a single variable.
ground
— Ground term of a polynomial
ground(a
)
This method overloads the function ground
for polynomials.
has
— Existence of an object in a polynomial
has(a
, obj
)
This method overloads the function has
.
indets
— Indeterminate of a polynomial
indets(<a
>)
In case Vars
is not the empty list, indets
can
be called without argument.
Since this domain allows expressions as indeterminates, the
returned set may contain expressions, too.
This method overloads the function indets
for polynomials.
lcoeff
— Leading coefficient of a polynomial
lcoeff(a
)
lcoeff(a
, <vars
>,
<ord
>)
lcoeff(a, ord)
returns the leading coefficient
of a
with respect to the monomial ordering ord
as
an element of the coefficient ring R
.
lcoeff(a, vars, ord)
returns the leading
coefficient of a
with respect to the variable list vars
and
the monomial ordering ord
as an element of this
domain if it is of category Cat::Polynomial(R)
,
or as an element of the coefficient ring R
if it
is of Cat::UnivariatePolynomial(R)
.
If ord
is not explicitly given,
the lexicographical order LexOrder
will be used
instead.
It tries to convert a
into a polynomial
in the specified list of indeterminates vars
over
the coefficient ring R
and returns FAIL
if this conversions
fails.
This method overloads the function lcoeff
for polynomials.
ldegree
— Lowest degree of a polynomial
ldegree(a
)
ldegree(a
, x
)
ldegree(a, x)
returns the lowest degree of
the variable x
in a
.
This method overloads the function ldegree
for polynomials.
lmonomial
— Leading monomial of a polynomial
lmonomial(a
, <ord
>)
lmonomial(a
, <vars
>,
<ord
>, <Rem>)
lmonomial(a, vars, ord)
returns the leading
monomial of a
with respect to the variable list vars
and
the monomial ordering ord
as an element of this
domain.
If ord
is not explicitly given,
the lexicographical order LexOrder
will be used
instead.
It tries to convert a
into a polynomial
in the specified list of indeterminates vars
over
the coefficient ring R
and returns FAIL
if this conversions
fails.
lmonomial(a, vars, ord, Rem)
returns the
list consisting of the leading monomial and the reductum of a
with
respect to the variable list vars
and the monomial
ordering ord
as a list of elements of this domain.
If ord
is not explicitly given,
the lexicographical order LexOrder
will be used
instead.
It tries to convert a
into a polynomial
in the specified list of indeterminates vars
over
the coefficient ring R
and returns FAIL
if this conversions
fails.
Note
In MuPAD^{®} a monomial denotes a coefficient together with
a power product as, e.g., 3 x^{2}.
This method overloads the function lmonomial
for polynomials.
lterm
— Leading term of a polynomial
lterm(a
)
lterm(a
, <vars
>,
<ord
>)
lterm(a, ord)
returns the leading coefficient
of a
with respect to the monomial ordering ord
as
an element of this domain.
lterm(a, vars, ord)
returns the leading term
of a
with respect to the variable list vars
and
the monomial ordering ord
as an element of this
domain.
If ord
is not explicitly given,
the lexicographical order LexOrder
will be used
instead.
It tries to convert a
into a polynomial
in the specified list of indeterminates vars
over
the coefficient ring R
and returns FAIL
if this conversions
fails.
Note
In MuPAD a term denotes a power product without a coefficient
as, e.g., x^{2} y^{3} z.
This method overloads the function lterm
for polynomials.
mainvar
— Main variable of a polynomial
mainvar(<a
>)
If Vars
is not the empty list, mainvar
can
be called without argument.
mapcoeffs
— Applie a function to the coefficients of a polynomial
mapcoeffs(a
, f
,
<e1, …
>)
This method overloads the function mapcoeffs
for polynomials.
multcoeffs
— Multiplie the coefficients of a polynomial with a factor
multcoeffs(a
, c
)
This method overloads the function multcoeffs
for polynomials.
nterms
— Number of terms of a polynomial
nterms(a
)
This method overloads the function nterms
for polynomials.
nthcoeff
— N-th coefficient of a polynomial
nthcoeff(a
, n
,
<ord
>)
If n
is larger than the number of monomials
of the polynomial then the function returns FAIL
.
The zero polynomial has no monomials. nthcoeff
returns FAIL
when
invoked on the zero polynomial.
This method overloads the function nthcoeff
for polynomials.
nthmonomial
— N-th monomial of a polynomial
nthmonomial(a
, n
,
<ord
>)
If n
is larger than the number of monomials
of the polynomial then the function returns FAIL
.
The zero polynomial has no monomials. nthmonomial
returns FAIL
for
the zero polynomial.
This method overloads the function nthmonomial
for polynomials.
nthterm
— N-th term of a polynomial
nthterm(a
, n
,
<ord
>)
If n
is larger than the number of monomials
of the polynomial then the function returns FAIL
.
The zero polynomial has no monomials. nthterm
returns FAIL
when
called with the zero polynomial.
This method overloads the function nthterm
for polynomials.
orderedVariableList
— Ordered list of indeterminates of a polynomial
orderedVariableList(<a
>)
In case Vars
is not the empty list, orderedVariableList
can
be called without an argument.
pivotSize
— Size of a pivot element
pivotSize(a
)
This method is called if this domain is used as the component
ring of a matrix domain to perform Gaussian elimination.
reductum
— Reductum of a polynomial
tcoeff
— Lowest coefficient of a polynomial
tcoeff(a
, <ord
>)
This method overloads the function tcoeff
for polynomials.
Conversion Methods
coerce
— Coerce into this domain
convert
— Conversion to a polynomial
expr
— Conversion to a basic type
expr(a
)
This method overloads the function expr
.
poly
— Convert to a basic polynomial domain
poly(a
)
This method overloads the function poly
.
TeXCoeff
— TeX formatting of a polynomial coefficient
TeXident
— TeX formatting of a polynomial indeterminate
TeXTerm
— TeX formatting of a polynomial term
Technical Methods
adaptIndets
— Convert polynomials to common indeterminates
adaptIndets(<a, b, …
>)
Note
This method only exists if the parameter Vars
is
the empty list ([]
).
allEntries
— Return the names of all entries
Inherited from Dom::BaseDomain
.
getAxioms
— Return axioms stated in the constructor
Inherited from Dom::BaseDomain
.
getCategories
— Return categories stated in the constructor
Inherited from Dom::BaseDomain
.
getSuperDomain
— Return super-domain stated in the constructor
Inherited from Dom::BaseDomain
.
info
— Print short information about this domain
Inherited from Dom::BaseDomain
.
isNeg
— Test on leading output token
mult
— Multiplie polynomials
new
— Create a new element
new(p
)
new(lm
)
new(lm
, v
)
dom(p)
creates an element of this domain
from a polynomial or a polynomial expression p
and
returns that element. If this is not possible, an error message is
given.
If Vars
is chosen as the empty list ([]
)
then in creating new elements from a polynomial or polynomial expression
the function indets
is
first called to get the identifiers. Afterwards the element is created
with this list of identifiers. For creating an element from a constant
the dummy variable _dummy
is introduced. The drawback
of this approach is that two mathematically equal polynomials may
have variable lists which differ by the dummy variable.
dom(lm)
creates, if Vars
is
not the empty list []
, a polynomial from the list lm
of
the form [[c1, [e11,... e1n]],... [cm,[em1,... emn]]]
where
the ci
are coefficients and the eij
are
the exponents with respect to Vars
. For a univariate
polynomial this list can be simplified to [[c1,e1],... [cm,em]]
.
dom(lm,v)
creates, if Vars = []
,
a polynomial from the list lm
of the form [[c1,
[e11,... e1n]],... [cm,[em1,... emn]]]
where the ci
are
coefficients and the eij
are the exponents with
respect to v
. For a univariate polynomial this
list can be simplified to [[c1,e1],... [cm,em]]
.
The list of indeterminates v
must contain valid
indeterminates.
print
— Print polynomials
print(a
)
This method overloads the function print
.
printMonomial
— Print a monomial in defined order
printTerm
— Print a term in defined order
printTerm(d
)
printTerm(d
, v
)
printTerm(d,v)
returns an ordered sequence
of the indeterminates together with their powers as given in the variable
list v
and the degree vector d
respectively.
Note that this call is only valid if nops(v)=nops(d)
.
Rep
— Data representation of a polynomial
sign
— Leading sign of a polynomial
sign(a
)
Note: this method does not have the meaning
of a mathematical sign function!
testtype
— Test type of object
whichEntry
— Return the domain or category implementing an entry
Inherited from Dom::BaseDomain
.