TOMS452
Combinations of M things out of N
TOMS452
is a FORTRAN77 library which
implements ACM TOMS algorithm 452, for generating, one at a
time, the combinations of M things out of N.
The text of many ACM TOMS algorithms is available online
through ACM:
http://www.acm.org/pubs/calgo
or NETLIB:
http://www.netlib.org/toms/index.html.
Usage:
-
call nxcbn ( n, m, ic )
-
where N is the total number of things, M is the number of
things in the combination, and IC(1:N) contains exactly
M values of 1, with the rest being 0. On output, IC will
be altered to indicate the "next" combination.
Related Programs:
COMBO,
a FORTRAN90 library which
contains several routines for generating, ranking, or randomly
selecting a combination.
SUBSET,
a FORTRAN90 library which
contains many routines for generating, ranking, or randomly
selecting a combination.
Reference:
-
CN Liu, DT Tang,
Algorithm 452: Enumerating Combinations of M out of N Objects,
Communications of the ACM,
August 1973, Volume 16, Number 8, page 485.
Source Code:
Examples and Tests:
List of Routines:
-
NXCBN generates the next combination of M things out of N.
You can go up one level to
the FORTRAN77 source codes.
Last revised on 01 December 2005.