Structured Flavors in Maple - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Random Objects : RandomTools package : Flavors : flavor/structured

Structured Flavors in Maple

 

Description

Examples

Description

• 

A structured flavor is any Maple expression other than a symbol that can be interpreted as a description of a random flavor. A typical example would be integer,integer. This expression describes a list that contains two elements, each of which is an integer.

• 

The following table gives a formal grammatical description of the valid structured flavors in Maple. The table uses the following notation: "::=" means "is defined to be", "|" means "or", and "*" means "zero or more occurrences of".

 

Syntax

Matches

 

 

 

flavor ::=

{ flavor* }

alternation; any of the flavors

 

| [ flavor* ]

a list of the given flavors

 

| complex(numeric)

match complex numerical constants exactly

 

| string

match strings exactly

 

| flavor = flavor

an equation of the corresponding flavors

 

| flavor <> flavor

an inequality compared with given flavors

 

| flavor < flavor

a relation compared with given flavors

 

| flavor <= flavor

a relation compared with given flavors

 

| flavor > flavor

a relation compared with given flavors

 

| flavor >= flavor

a relation compared with given flavors

 

| flavor .. flavor

a range compared with given flavors

 

| flavor and flavor

an and of the corresponding flavors

 

| flavor or flavor

an or of the corresponding flavors

 

| not flavor

a not of the corresponding flavor

 

| flavor &+ flavor ...

a sum of the corresponding flavors

 

| flavor &* flavor ...

a product of the corresponding flavors

 

| flavor &. flavor ...

a dot product of the corresponding flavors

 

| flavor ^ flavor

a power compared with the given flavors

 

| fcnflavor

a function or special flavor

 

 

 

fcnflavor ::=

set(flavor, nonnegint)

sets of elements compared with the given flavor

 

| list(flavor, nonnegint)

lists of elements compared with the given flavor

 

| `&+`(flavor)

a sum of terms of the given flavors

 

| `&*`(flavor)

a product of factors of the given flavors

 

| function(flavor)

any function with arguments compared with given flavor

 

| name(flavor)

any name with a value of the given flavor

 

| foo(flavor*)

a flavor defined by a procedure added with RandomTools[AddFlavor]

 

| foo(flavor*)

the function foo with arguments compared with the given flavors

• 

The square brackets [ and ] are used to check for a fixed argument sequence.  For example, the flavor integer&comma;rational describes a list that contains an integer and a rational number.

• 

The flavor identicalx describes the object x itself.

• 

The flavor stringn generates a string of length n.

Examples

withRandomTools&colon;

Generateintegerrange&equals;3..10&comma;rationalrange&equals;3..10&comma;denominator&equals;13

7&comma;8413

(1)

Generatefintegerrange&equals;3..10&comma;rationalrange&equals;3..10&comma;denominator&equals;17

f10&comma;5717

(2)

Generatepolynomintegerrange&equals;10..10&comma;x&plus;3

6x56x45x37x2&plus;x6

(3)

Generate&apos;Array&apos;negintrange&equals;10..posintrange&equals;10

Array3..5&comma;

(4)

See Also

RandomTools

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam