Example Worksheet - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Domains : Example Worksheet

The Domains Package

This example worksheet demonstrates commands from the Domains package. The Domains package can be used to create domains of computation and then develop code for complicated algorithms.

restart

withDomains:

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

Basic Examples Using Domains Z and Q

The domains Z (the integers) and Q (the rationals) have been defined. Let's do some operations.

ZGcd8,12

4

(1.1)

Q`+`12,13,14

1312

(1.2)

What are the objects Z and Q? Z and Q are Maple tables

typeZ,table

true

(1.3)

The table contains operations (Maple procedures) for computing in Z and Q. What operations are available?

showZ,operations


`     Signatures for constructor Z`
`     note: operations prefixed by  --  are not available`

`      * : (Z,Z*) -> Z`
`      * : (Integers,Z) -> Z`
`      + : (Z,Z*) -> Z`
`      - : Z -> Z`
`      - : (Z,Z) -> Z`
`      0 : Z`
`      1 : Z`
`      < : (Z,Z) -> Boolean`
`      <= : (Z,Z) -> Boolean`
`      <> : (Z,Z) -> Boolean`
`      = : (Z,Z) -> Boolean`
`      > : (Z,Z) -> Boolean`
`      >= : (Z,Z) -> Boolean`
`      Abs : Z -> Z`
`      Characteristic : Integers`
`      Coerce : Integers -> Z`
`      Div : (Z,Z) -> Union(Z,FAIL)`
`      EuclideanNorm : Z -> Integers`
`      Factor : Z -> [Z,[[Z,Integers]*]]`
`      Gcd : Z* -> Z`
`      Gcdex : (Z,Z,Name) -> Z`
`      Gcdex : (Z,Z,Name,Name) -> Z`
`      Input : Expression -> Union(Z,FAIL)`
`      Inv : Z -> Union(Z,FAIL)`
`      Lcm : Z* -> Z`
`      Max : (Z,Z*) -> Z`
`      Min : (Z,Z*) -> Z`
`      Modp : (Z,Z) -> Z`
`      Mods : (Z,Z) -> Z`
`      ModularHomomorphism : () -> (Z -> Z,Z)`
`      Normal : Z -> Z`
`      Output : Z -> Expression`
`      Powmod : (Z,Integers,Z) -> Z`
`      Prime : Z -> Boolean`
`      Quo : (Z,Z) -> Z`
`      Quo : (Z,Z,Name) -> Z`
`      Random : () -> Z`
`      RelativelyPrime : (Z,Z) -> Boolean`
`      Rem : (Z,Z) -> Z`
`      Rem : (Z,Z,Name) -> Z`
`      Sign : Z -> UNION(1,-1,0)`
`      SmallerEuclideanNorm : (Z,Z) -> Boolean`
`      Sqrfree : Z -> [Z,[[Z,Integers]*]]`
`      Type : Expression -> Boolean`
`      Unit : Z -> Z`
`      UnitNormal : Z -> [Z,Z,Z]`
`      Zero : Z -> Boolean`
`      ^ : (Z,Integers) -> Z`

Return to Index for Example Worksheets