summaryrefslogtreecommitdiffstats
path: root/combi.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-06-24 01:07:42 -0700
committerKaz Kylheku <kaz@kylheku.com>2024-06-24 01:07:42 -0700
commitd4e474f7179c54c985aa912328d1dff8dbfe7d40 (patch)
treea72eaf87e2d4f21808a288a9f0736516aac2fd7d /combi.h
parent20c5a95e9e8e7ea823d25e4cf6bdcefcf8791c7d (diff)
downloadtxr-d4e474f7179c54c985aa912328d1dff8dbfe7d40.tar.gz
txr-d4e474f7179c54c985aa912328d1dff8dbfe7d40.tar.bz2
txr-d4e474f7179c54c985aa912328d1dff8dbfe7d40.zip
combi: fix permi and rpermi; impl combi, rcombi; test.
* combi.c (permi_get, permi_peek): Fix algorithm. (permi_mark): New static function. (permi_ops): Reference permi_mark for mark operation. (permi): Initialize it->ul.next to nao as required by new get/peek algorithm. (rpermi_get, rpermi_peek): Fix algorithm. (rpermi_mark): New static function. (rpermi_ops): Reference permi_mark for mark operation. (rpermi): Initialize it->ul.next to nao as required by new get/peek algorithm. (combi_get, combi_peek, combi_mark, combi_clone): New static functions. (combi_ops): New static structure. (combi): New function. (rcombi_get, rcombi_peek, rcombi_mark, rcombi_clone): New static functions. (rcombi_ops): New static structure. (rcombi): New function. * combi.h (combi, rcombi): Declared. * tests/015/comb.tl: New tests.
Diffstat (limited to 'combi.h')
-rw-r--r--combi.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/combi.h b/combi.h
index 17465cc1..b2a78233 100644
--- a/combi.h
+++ b/combi.h
@@ -31,4 +31,6 @@ val permi(val seq, val k);
val rperm(val seq, val k);
val rpermi(val seq, val k);
val comb(val seq, val k);
+val combi(val seq, val k);
val rcomb(val seq, val k);
+val rcombi(val seq, val k);