diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-05-01 16:24:15 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-05-01 16:24:15 +0200 |
commit | a30ba67504ffd12c4db499adbb5ce47a7d1f6036 (patch) | |
tree | 9ae1a7e3849dda6bbb5c578232f6f2fa5b2e7e7e /h/counters.h | |
parent | 89e99e8a827859729729dfc92d74be4a8f96f1a4 (diff) | |
parent | 094535c010320967639e8e86f974d878e80baa72 (diff) |
New release 1.7.0
Diffstat (limited to 'h/counters.h')
-rw-r--r-- | h/counters.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/h/counters.h b/h/counters.h index e3944d9..0fbb11a 100644 --- a/h/counters.h +++ b/h/counters.h @@ -54,6 +54,17 @@ /* After init or increment, expression is TRUE if counter is done */ #define DC_DONE(nn) \ (nn##_e >= nn##_di) + +/* Typical use: + + DCOUNT(cc, 15, 3, -1, -1, 2); + + DC_INIT(cc); + while(!DC_DONE(cc)) { + + DC_INC(cc); + } + */ /* (Do we need a version of the above that tracks the actual input coords ?) */ /* ------------------------------------------------------- */ @@ -137,6 +148,9 @@ /* Declare the counter name nn, combinations out of total */ /* mxdi should be set to maximum combinations */ +/* e.g. if there are 8 objects, and we want all combinations */ +/* of 4 out of the 8, we would use: COMBO(nn, 4, 4, 8) */ + #define COMBO(nn, mxdi, comb, total) \ int nn[mxdi+2]; /* counter value */ \ int nn##_cmb = (comb); /* number of combinations */ \ |