next_partition

synopsis: next_partition(OP partone, OP partnext)

description:

using the algorithm of Nijnhuis/Wilf the next partition with the same weight is computed. Better to use the general routine next(OP,OP)

example:

 to loop over all partitions

 #include "def.h"
 #include "macro.h"
 ANFANG
 scan(INTEGER,a);
 first_partition(a,b);
 do {
 println(b);
 } while (next(b,b));
 ENDE





Send comments or suggestions to:
symmetrica (at) symmetrica

this page was automatically generated on So Aug 10 12:23:24 CEST 2008 on the machine btn6xa