Type::PolyExpr
-- type for
testing polynomial expressionsWith Type::PolyExpr
, polynomial expressions can be
identified.
testtype(obj,
Type::PolyExpr(unknowns <,
coeff_type>)
)
obj |
- | any MuPAD object |
unknowns |
- | an indeterminate or a list of indeterminates |
coeff_type |
- | the type of the coefficients; a type can be an object
of the library Type or
one of the possible return values of domtype and type |
see testtype
testtype
, Type::PolyOf
, poly
, indets
testtype(obj,
Type::PolyExpr(unknowns)
) checks, whether obj
is a polynomial expression in the indeterminates unknowns
and, if so, returns TRUE
,
otherwise FALSE
.indet
is a MuPAD expression, where indet
occurs only as operand of _plus
or _mult
expressions and in the base of
_power
with a positive
integer exponent.DOM_EXPR
and is not produced by the
function poly
.Type::PolyExpr(
indets <, coeff_type>)
.
indets
must be an identifier or a list of
identifiers.
The optional argument coeff_type
determines the type of
the coefficients. If it is not given, Type::AnyType
will be used.
Is the object a polynomial expression with variable
x
?
>> X := -x^2 - x + 3: testtype(X, Type::PolyExpr(x))
TRUE
But X
is not a MuPAD polynomial in
x
:
>> testtype(X, Type::PolyOf(x))
FALSE
Is the object a polynomial expression with variables
x
and y
and with integer coefficients?
>> X := -x^2 - x + 3: testtype(X, Type::PolyExpr([x, y], Type::Integer))
TRUE
The next example too?
>> X := -x^2 - y^2 + 3*x + 3*y - 1: testtype(X, Type::PolyExpr([x, y], Type::Integer))
TRUE
>> delete X: