evaldomains  evaluation of Mapleexpressions in a Domains domain

Calling Sequence


evaldomains[D](expr)


Parameters


expr



Mapleexpression

D



Domains domain





Description


•

evaldomains[D](expr) evaluates the Mapleexpression expr in the Domains domain D and returns a Mapleexpression. evaldomains provides a Maplelike userinterface, dataencapsulation and typechecking for the arguments of Domainsfunctions. It is intended to simplify interactive use of Domains and is not intended to be used as a coding tool for writing Domains programs.

•

domainInput/Output functions are implicitly applied during evaluation of the expression, hiding the datarepresentation of domainelements. The type of arguments passed to domainoperations is checked against the signatures of the operations. The signatures of the domain operations are accessible through the command show(D, operations).

•

All the operations within expr are assumed to be operations in the specified Domainsdomain D.

•

The following example shows the difference at the userinterface level:

>

domain := DenseUnivariatePolynomial (Zmod(7), x):

>

domain[Output](domain[`*`](domain[Input](x^23*x+1),domain[Input](2*x^34)));


Using the more familiar Maple syntax:

>

evaldomains[domain]((x^23*x+1)*(2*x^34));

•

If evaluations of several expressions in one domain are to be performed, it is often preferable to create a domainevaluator with the use of aliases:

>

alias (dup = evaldomains[domain]):

•

Since the expression passed to evaldomains is first processed by the Maple parser, the user has to be aware of the builtin simplifications, reordering of operands and evaluation of toplevel functions. Hence, the following is always simplified to 0.

>

evaldomains[domain] (Random()  Random());

•

An example for evaluation of toplevel functions within the call of evaldomains can be obtained by the following

>

galoisfield := GaloisField (13, 2):

>

evaldomains[galoisfield](order(Random()));

•

which results in an error, since order is a builtin toplevel function which will be evaluated before the expression is passed to evaldomains. In order to prevent such behavior, the user is advised to use forward quotes where necessary.

>

evaldomains[galoisfield]('order'(Random()));
...

•

Furthermore, if the domain has noncommutative multiplication or addition, the &version of the operator has to be used in order to prevent reordering of the operands, e.g.

>

Sm := SquareMatrix (2, Z): alias (sm = evaldomains[Sm]):

 (1) 
 (2) 
•

evaldomains is only available after performing the command with(Domains).



Examples


>


 Domains version 1.0 
Initially defined domains are Z and Q the integers and rationals
Abbreviations, e.g. DUP for DenseUnivariatePolynomial, also made
 
 (3) 
>


Create a Dupevaluator using the alias statement
>


>


 (4) 
evaldomains outputs even compound datastructures and ...
>


 (5) 
callbyname parameters nicely (ie. not in their internal representation)
>


 (6) 
>


 (7) 
>


>


>


 (8) 
>


 (9) 
Re and Im are also toplevel Maple functions which must be quoted in order to prevent evaluation by the Maple parser
>


 (10) 


Download Help Document
Was this information helpful?