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[vectoint] - index of vector in canonical ordering
combinat[inttovec] - vector referenced by integer in canonical ordering
Calling Sequence
vectoint(l)
inttovec(m, n)
Parameters
l
-
list of non-negative integers
m
non-negative integer
n
Description
These two functions provide a one-to-one correspondence between the non-negative integers and all vectors composed of n non-negative integers.
The one-to-one correspondence is defined as follows. View all vectors of n non-negative integers as exponent vectors on n variables. Therefore, for each vector, there is a corresponding monomial. Collect all such monomials and order them by increasing total degree. Resolve ties by ordering monomials of the same degree in lexicographic order. This gives a canonical ordering.
Given a vector l of n non-negative integers, the corresponding integer m is its index in this canonical ordering. The function vectoint(l) computes and returns this integer m.
Given a non-negative integer m, the corresponding vector l is the m^th vector in this canonical ordering of vectors of length n. The function inttovec(m, n) computes and returns this vector l.
Here is a sample canonical ordering where n is 3:
Vector
Number
Monomial
[0,0,0]
0
1
[1,0,0]
x
[0,1,0]
2
y
[0,0,1]
3
z
[2,0,0]
4
x^2
[1,1,0]
5
x*y
[1,0,1]
6
x*z
[0,2,0]
7
y^2
...
The command with(combinat,vectoint) allows the use of the abbreviated form of this command.
Examples
See Also
combinat[decodepart], combinat[encodepart]
Download Help Document