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
combinat[cartprod] - iterate over a list of lists or sets
Calling Sequence
cartprod(LL)
Parameters
LL
-
list of sets or lists of anything
Description
The command cartprod is special iterating function. It allows one to iterate over the cartesian product of a list of lists or sets of values, as illustrated in the example below. It returns a table with two entries finished and nextvalue.
The nextvalue entry is a function. When called repeatedly, it iterates through the values in the cartesian product of the list of lists or sets LL.
The finished entry is either true or false and indicates whether the iteration is complete. If the finished flag is true, the nextvalue function can be called to get the next value in the cartesian product. If false, the sequence is finished.
The command with(combinat,cartprod) allows the use of the abbreviated form of this command.
Examples
See Also
combinat
Download Help Document