generate a particular random object - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Random Objects : RandomTools package : Commands : RandomTools/Generate

RandomTools[Generate] - generate a particular random object

Calling Sequence

Generate(expr)

Parameters

expr

-

expression; defines the form of the random object

Description

• 

The Generate(expr) function generates a particular random object that is determined by expr. The expr parameter is used to:

  

* indicate a particular Maple type,

  

* indicate a flavor template, where specific keywords describe the form of the returned random object, or

  

* choose a random entry from a Maple data structure.

  

The following list describes the Maple types, flavor templates, and data structures that are recognized by Generate. For more information about how to generate a random number that corresponds to one of these items, see the corresponding help page (flavor/<topic>).

choose

complex

distribution

exprseq

float

identical

integer

lislist

list

Matrix

negative

negint

nonnegative

nonnegint

nonposint

nonpositive

nonzero

nonzeroint

polynom

posint

positive

rational

set

structured

truefalse

Vector

 

 

• 

The Generate function calls the Maple rand procedure.

• 

The Generate function maps onto all objects that are not of type atomic.

• 

This function is part of the RandomTools package, and so it can be used in the form Generate(..) only after executing the command with(RandomTools). However, it can always be accessed through the long form of the command by using the form RandomTools[Generate](..).

Examples

withRandomTools&colon;

Generateinteger

104281139460

(1)

Generatelistfloat&comma;3

0.001715876735&comma;0.0002700862948&comma;5.42417046610-8

(2)

Generatenegint&comma;integer&comma;float

84764803536&comma;342622684448&comma;8.34453987810-7

(3)

Matrix3&comma;3&comma;Generaterationaldenominator&equals;10&comma;makeproc&equals;true

4545110910254512150

(4)

Matrix3&comma;3&comma;Generaterationaldenominator&equals;10&comma;makeproc&equals;true

2515110310359102531025

(5)

Vector4&comma;Generatecomplexintegerrange&equals;1..100&comma;makeproc&equals;true

39&plus;92I71&plus;67I78&plus;51I53&plus;12I

(6)

See Also

LinearAlgebra[RandomMatrix], LinearAlgebra[RandomVector], makeproc, rand, RandomTools, randpoly, type/atomic


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