35#ifndef __YTLIB_COMBO_H
36#define __YTLIB_COMBO_H
43uint64_t ytCombo_chooseTable(
int n,
int k,
const uint64_t * table,
int tn);
44uint64_t
ytCombo_index(
int n,
int c,
const int * ar,
const uint64_t * table,
int tn);
45uint64_t ytCombo_index2(
int n,
int c,
const int * ar,
const int * a,
const uint64_t * table,
int tn);
46uint64_t ytCombo_index3(
int n,
int c,
const int * ar,
const int * a,
const int * b,
const uint64_t * table,
int tn);
48 const uint64_t * table,
int tn);
50 const uint64_t *table,
int tn);
52 const int * a,
const int * b,
53 const uint64_t * table,
int tn);
55void ytCombo_print(FILE * fp,
size_t n,
const int * A);
56void ytCombo_print2(FILE * fp,
size_t n,
const int * A,
const int * B);
58void ytCombo_bitNext(uint64_t * bit);
59void ytCombo_bit(
int n,
int k, uint64_t index, uint64_t * bit,
60 const uint64_t * table,
int tn);
62void ytCombo_bitCombo2(
int n,
int k, uint64_t index,
63 uint64_t * bit,
int * A,
const int * a,
64 const uint64_t * table,
int tn);
66void ytCombo_printBitCombo(FILE * fp, uint64_t bit,
int n);
69void ytCombo_test(FILE * fp);
int ytCombo_generate(int n, int k, int *ar)
Generates the combination.
Definition: ytCombo.c:108
void ytCombo_combination3(int n, int k, uint64_t index, int *ar, const int *a, const int *b, const uint64_t *table, int tn)
Obtain the combination corresponding to the given index.
Definition: ytCombo.c:293
void ytCombo_indexTable(int n, uint64_t *table)
Generates the index table for ytCombo routines.
Definition: ytCombo.c:142
void ytCombo_combination2(int n, int k, uint64_t index, int *ar, const int *a, const uint64_t *table, int tn)
Obtain the combination corresponding to the given index.
Definition: ytCombo.c:257
uint64_t ytCombo_index(int n, int c, const int *ar, const uint64_t *table, int tn)
Calculates the index for the given combination.
Definition: ytCombo.c:171
void ytCombo_combination(int n, int k, uint64_t index, int *ar, const uint64_t *table, int tn)
Obtain the combination corresponding to the given index.
Definition: ytCombo.c:221
uint64_t ytCombo_choose(int n, int k)
Calculates the number of combinations of n things taken k at a time (binomial coefficient).
Definition: ytCombo.c:54