Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
RandomTools[LinearCongruence][NewGenerator] - Create a Linear Congruence Pseudo Random Number Generator
Calling Sequence
NewGenerator( opt1, opt2, ... )
Parameters
opt1, opt2, ...
-
(optional) argument of the form option=value where option is range
Description
The NewGenerator command outputs a Maple procedure, a pseudo-random number generator, which when called outputs one pseudo-random integer. The output of the generator depends on the options described below. The default is to output integers on the range , i.e., a random 12 digit integer.
The returned procedure calls the LinearCongruence algorithm to generate the numbers. Although you can have multiple generating procedures, they all share the same state. This means that calling one procedure will effect the numbers returned by another.
The following optional arguments are supported. They are input as equations in any order.
range=integer..integer or integer
If the value of the range argument is a range, then the integer will be chosen from that range. If the value of the range argument is an integer, then the integer will be take from the range [0..value). The default range is .
If one only needs to generate a small number of integers then the GenerateInteger function can be used. However, using a procedure returned by NewGenerator is faster than calling GenerateInteger multiple times.
Examples
See Also
rand, RandomTools, RandomTools[Generate], RandomTools[LinearCongruence], RandomTools[LinearCongruence][GenerateInteger]
Download Help Document