INGOR
Loading...
Searching...
No Matches
ytCombo.h
1/*
2 Combo.{h,c} : Combination functions.
3 Copyright (C) 2016, Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 See LICENSE.txt for details of the licensing agreement.
7*/
8#ifndef __YTLIB_COMBO_H
9#define __YTLIB_COMBO_H
10#include <stdint.h>
11#include <stdio.h>
12
13uint64_t ytCombo_choose(int n, int k);
14int ytCombo_generate(int n, int k, int * ar);
15void ytCombo_indexTable(int n, uint64_t * table);
16uint64_t ytCombo_chooseTable(int n, int k, const uint64_t * table, int tn);
17uint64_t ytCombo_index(int n, int c, const int * ar, const uint64_t * table, int tn);
18uint64_t ytCombo_index2(int n, int c, const int * ar, const int * a, const uint64_t * table, int tn);
19uint64_t ytCombo_index3(int n, int c, const int * ar, const int * a, const int * b, const uint64_t * table, int tn);
20void ytCombo_combination(int n, int c, uint64_t index, int * ar,
21 const uint64_t * table, int tn);
22void ytCombo_combination2(int n, int k, uint64_t index, int * ar, const int * a,
23 const uint64_t *table, int tn);
24void ytCombo_combination3(int n, int k, uint64_t index, int * ar,
25 const int * a, const int * b,
26 const uint64_t * table, int tn);
27
28void ytCombo_print(FILE * fp, size_t n, const int * A);
29void ytCombo_print2(FILE * fp, size_t n, const int * A, const int * B);
30
31void ytCombo_bitNext(uint64_t * bit);
32void ytCombo_bit(int n, int k, uint64_t index, uint64_t * bit,
33 const uint64_t * table, int tn);
34
35void ytCombo_bitCombo2(int n, int k, uint64_t index,
36 uint64_t * bit, int * A, const int * a,
37 const uint64_t * table, int tn);
38
39void ytCombo_printBitCombo(FILE * fp, uint64_t bit, int n);
40
41
42void ytCombo_test(FILE * fp);
43
44#endif /* __YTLIB_COMBO_H */
45/* End of file. */