14namespace layer2_discreta {
18#undef DEBUG_CALLOC_NOBJECTS_PLUS_LENGTH
20#undef DEBUG_INVERT_MOD_INTEGER
30#define MAX_PRINTING_MODE_STACK 100
46 int verbose_level = 0;
47 int f_v = (verbose_level >= 1);
54 cout <<
"discreta_init WARNING: $DISCRETA_HOME not set !" << endl;
61 cout <<
"discreta_init WARNING: $DISCRETA_ARCH not set !" << endl;
68 strcat(str,
"/lib/this_is");
73 cout <<
"discreta_init WARNING: can't find my library (DISCRETA_HOME/lib) !" << endl;
101 cout <<
"calloc_nobjects no memory" << endl;
104 for (i = 0; i < n; i++) {
115 for (i = 0; i < n; i++) {
126#ifdef DEBUG_CALLOC_NOBJECTS_PLUS_LENGTH
127 cout <<
"calloc_nobjects_plus_length n=" << n << endl;
131 cout <<
"calloc_nobjects_plus_length no memory" << endl;
135 for (i = 0; i < n; i++) {
150 cout <<
"free_nobjects_plus_length length = " << n <<
" < 0" << endl;
152#ifdef DEBUG_CALLOC_NOBJECTS_PLUS_LENGTH
153 cout <<
"free_nobjects_plus_length n=" << n << endl;
155 for (i = 0; i < n; i++) {
170 cout <<
"calloc_m_times_n_objects no memory" << endl;
175 for (i = 0; i < m * n; i++) {
193 cout <<
"free_m_times_n_objects m = " << m <<
" < 0" << endl;
196 cout <<
"free_m_times_n_objects n = " << n <<
" < 0" << endl;
198 for (i = 0; i < m * n; i++) {
216 case BASE:
return "BASE";
217 case INTEGER:
return "INTEGER";
218 case VECTOR:
return "VECTOR";
222 case MATRIX:
return "MATRIX";
228 case MEMORY:
return "MEMORY";
232 case BTREE:
return "BTREE";
235 case BT_KEY:
return "BT_KEY";
240 case UNIPOLY:
return "UNIPOLY";
252 default:
return "unknown kind";
261 default:
return "unknown action_kind";
289#ifdef DEBUG_INVERT_MOD_INTEGER
290 cout <<
"invert_mod_integer i=" << i <<
", p=" << p << endl;
295#ifdef DEBUG_INVERT_MOD_INTEGER
296 cout <<
"i^-1=" << a.
s_i() << endl;
304#ifdef DEBUG_INVERT_MOD_INTEGER
305 cout <<
"invert_mod_integer i=" << i <<
", p=" << p << endl;
309#ifdef DEBUG_INVERT_MOD_INTEGER
310 cout <<
"i^-1=" << x.
s_i() << endl;
335 int d, last_prime = 2, l;
339 cout <<
"factor_integer n == 0" << endl;
347 d = NT.
sp_ge(n, last_prime);
352 exponents.
m_ii(0, 1);
356 d = NT.
sp_ge(n, last_prime);
358 if (d == last_prime) {
359 exponents.
m_ii(l - 1, exponents.
s_ii(l - 1) + 1);
365 exponents.
m_ii(l, 1);
379 if (l != exponents.
s_l()) {
380 cout <<
"print_factorization l != exponents.s_l()" << endl;
384 for (i = 0; i < l; i++) {
386 e = exponents.
s_ii(i);
390 o <<
"{" << e <<
"}";
401 for (i = 0; i < l; i++) {
403 e = exponents.
s_ii(i);
420 if (l != exponents.
s_l()) {
421 cout <<
"print_factorization l != exponents.s_l()" << endl;
426 for (i = 0; i < l; i++) {
428 e = exponents.
s_ii(i);
448 for (i = 0; i < l; i++) {
450 e = exponents.
s_ii(i);
508 for (i = 0; i < l; i++) {
526 for (j = 0; j < l; j++) {
542 int q, m0, m1, m_halbe;
545 cout <<
"NormRemainder m == 0" << endl;
571 cout <<
"log2 n <= 0" << endl;
574 for (i = -1; n > 0; i++) {
583 int f_v = (verbose_level >= 1);
587 cout <<
"sqrt_mod a=" << a <<
" p=" << p << endl;
598 for (x = 0; x < p; x++) {
599 if ((x * x) % p == a1) {
601 cout <<
"sqrt_mod a=" << a <<
" p=" << p <<
" done" << endl;
606 cout <<
"sqrt_mod() a not a quadratic residue" << endl;
607 cout <<
"a = " << a <<
" p=" << p << endl;
617 if (Y.
modp(p) != a1) {
618 cout <<
"sqrt_mod error in sqrt_mod_invoved" << endl;
622 cout <<
"sqrt_mod a=" << a <<
" p=" << p <<
" done" << endl;
631 int f_v = (verbose_level >= 1);
638 cout <<
"sqrt_mod_involved" << endl;
656 cout <<
"sqrt_mod_involved done" << endl;
668 cout <<
"sqrt_mod_involved done" << endl;
673 cout <<
"sqrt_mod() p % 8 = 5 and power neq +-1" << endl;
674 cout <<
"power = " << b << endl;
675 cout <<
"-1 = " << m1 << endl;
681 int n, r = 0, q, e, m;
682 longinteger Z, N, Y, B, T, d, mP, AB, Ypower, Bpower;
684#ifdef TONELLI_VERBOSE
685 cout <<
"sqrt_mod(), Tonelli / Shanks:\n";
693#ifdef TONELLI_VERBOSE
694 cout <<
"p - 1 = 2^" << e <<
" * " << q << endl;
699 n = (int)(((
double)rand() * (
double)p / RAND_MAX)) % p;
700 r = Legendre(n, p, verbose_level - 1);
703 for (n = 1; n < p - 1; n++) {
704 r = NT.
Legendre(n, p, verbose_level - 1);
711#ifdef TONELLI_VERBOSE
712 cout <<
"n=" << n <<
" p=" << p <<
" Legendre(n,p)=" << r<< endl;
714 cout <<
"n=" << n <<
" p=" << p <<
" Legendre(n,p)=" << r<< endl;
725#ifdef TONELLI_VERBOSE
726 cout <<
"initialization:\n";
730#ifdef TONELLI_VERBOSE
731 cout <<
"Z=" << Z << endl;
732 cout <<
"Y=" << Y << endl;
733 cout <<
"r=" << r << endl;
734 cout <<
"X=" << X << endl;
735 cout <<
"B=" << B << endl;
752 cout <<
"loop invariant violated: Y^{2^{r-1}} != -1" << endl;
759 cout <<
"loop invariant violated: ab != x^2" << endl;
760 cout <<
"ab=" << d << endl;
761 cout <<
"x^2=" << X2 << endl;
768 cout <<
"loop invariant violated: B^{2^{r-1}} != 1" << endl;
773 if (B.
modp(p) == 1) {
783 cout <<
"sqrt_mod(), Tonelli / Shanks:" << endl;
784 cout <<
"error: a is not a quadratic residue mod p" << endl;
791 cout << round <<
" & " << A <<
" & " << B <<
" & " << X <<
" & "
792 << X2 <<
" & " << Y <<
" & " << r <<
" & " << AB
793 <<
" & " << Ypower <<
" & " << Bpower <<
" & ";
796 cout <<
" & & & & \\\\" << endl;
806 cout <<
"sqrt_mod_involved done" << endl;
811#ifdef TONELLI_VERBOSE
812 cout <<
"m=" << m << endl;
821 cout <<
" & " << Y <<
" & " << X <<
" & " << B <<
" & " << r;
822 cout <<
"\\\\" << endl;
826 cout <<
"sqrt_mod_involved done" << endl;
830void html_head(ostream& ost,
char *title_long,
char *title_short)
835 ost << title_short <<
"\n";
841 ost << title_long <<
"\n";
851 ost <<
"<p><hr><p>\n";
852 ost <<
"created: " << h.
s() << endl;
859 int f_v = (verbose_level >= 1);
860 int i, from, to, l, unit_size = 1000;
864 from = i * unit_size + 1;
865 to = from + unit_size - 1;
868 cout <<
"[" << from <<
"," << to
869 <<
"], total number of primes = "
882 int f_v = (verbose_level >= 1);
883 int x, y, l, k, p, f_prime;
890 for (; x <= to; x++, x++) {
894 for (k = 0; k < l; k++) {
898 if ((x - y * p) == 0) {
912 cout <<
"error: " << x <<
" is not prime!\n";
916 cout << v.
s_l() <<
" " << x << endl;
929 for (i = 0; i < l; i++) {
930 cout << v.
s_ii(i) <<
" ";
931 if ((i + 1) % 10 == 0)
942 int f_v = (verbose_level >= 1);
967 cout <<
"stirling_second";
971 cout <<
"(" << n <<
", " << k <<
")" << endl;
989 cout <<
"stirling_second";
993 cout <<
"(" << n <<
", " << k <<
") = " << res << endl;
1001 int f_v = (verbose_level >= 1);
1027 cout <<
"stirling_first";
1029 cout <<
" signless ";
1031 cout <<
"(" << n <<
", " << k <<
")" << endl;
1043 for (x = 1; x <= l; x++) {
1066 cout <<
"stirling_first";
1068 cout <<
" signless ";
1070 cout <<
"(" << n <<
", " << k <<
") = " << res << endl;
1076 int f_v = (verbose_level >= 1);
1082 for (i = 2; i <= n; i++) {
1089 int f_v = (verbose_level >= 1);
1094 for (i = 1; i <= n; i++) {
1100 cout <<
"Catalan_n(" << n <<
")=" << a << endl;
1112 for (k = n; k > 0; k--) {
1113 for (i = 0; i <= n; i++) {
1126 Cnk.
m_mn_n(n + 1, n + 1);
1129 for (k = 1; k <= n; k++) {
1133 for (k = 1; k <= n; k++) {
1138 for (i = 2; i <= n; i++) {
1140 for (k = 2; k <= n; k++) {
1148 int f_v = (verbose_level >= 1);
1153 for (i = 0; i <= n - 1; i++) {
1155 b *= Cnk[n - i - 1][k];
1159 cout <<
"Catalan_nk_star(" << n <<
", " << k <<
")=" << a << endl;
1172 cout <<
"N_choose_K(): k < 0" << endl;
1214 cout <<
"Binomial(): k < 0" << endl;
1218 n_choose_k.
m_i_i(0);
1221 if (n == 0 || k == 0 || k == n) {
1222 n_choose_k.
m_i_i(1);
1234 cout <<
"reallocating table of binomial coefficients to length " << n + 1 << endl;
1237 for (i = 0; i < tn; i++) {
1238 for (j = 0; j <= i; j++) {
1239 (*T)[i][j].
swap(TT[i][j]);
1244 Binomial_using_table(n, k, *T, n_choose_k);
1247static void Binomial_using_table(
int n,
int k, discreta_matrix & T, discreta_base & res)
1249 discreta_base tmp1, tmp2;
1254 cout <<
"Binomial_using_table: m < n" << endl;
1258 cout <<
"Binomial_using_table: k > n" << endl;
1261 if (k > (n >> 1) + 1) {
1262 Binomial_using_table(n, n - k, T, res);
1263 T[n][k] = T[n][n - k];
1267 cout <<
"Binomial_using_table: n == 0" << endl;
1271 cout <<
"Binomial_using_table: n < 0" << endl;
1275 cout <<
"Binomial_using_table: k < 0" << endl;
1293 if (T.s_ij(n, k).is_zero()) {
1294 Binomial_using_table(n - 1, k - 1, T, tmp1);
1295 Binomial_using_table(n - 1, k, T, tmp2);
1314 for (u = 0; u <= u_max; u++) {
1336 i = (rank - a) / (n - 1);
1360 cout <<
"tuple2_unrank() not injective !" << endl;
1381 for (i = 0; i < l; i++) {
1401 for (i = 0; i < l; i++) {
1414static int table_of_primes[] = {
1415 2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
1416 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
1417 73, 79, 83, 89, 97 } ;
1418static int table_of_primes_len = 25;
1424 if (n <= table_of_primes_len) {
1426 for (i = 0; i < n; i++) {
1427 P.
m_ii(i, table_of_primes[i]);
1431 cout <<
"the_first_n_primes: n too large" << endl;
1442 x = (double)(Px[i1] + Px[i2]) * 0.5;
1443 y = (double)(Py[i1] + Py[i2]) * 0.5;
1448void midpoint_of_5(
int *Px,
int *Py,
int i1,
int i2,
int i3,
int i4,
int i5,
int idx)
1452 x = (double)(Px[i1] + Px[i2] + Px[i3] + Px[i4] + Px[i5]) * 0.2;
1453 y = (double)(Py[i1] + Py[i2] + Py[i3] + Py[i4] + Py[i5]) * 0.2;
1458void ratio_int(
int *Px,
int *Py,
int idx_from,
int idx_to,
int idx_result,
double r)
1462 dx = (int)((
double)(Px[idx_to] - Px[idx_from]) * r);
1463 dy = (int)((
double)(Py[idx_to] - Py[idx_from]) * r);
1464 Px[idx_result] = Px[idx_from] + dx;
1465 Py[idx_result] = Py[idx_from] + dy;
1472 return sizeof (uint) * 8;
1475void bit_set(uint & g,
int k)
1477 g |= (((uint) 1) << k);
1480void bit_clear(uint & g,
int k)
1482 g &= ~(((uint) 1) << k);
1485int bit_test(uint & g,
int k)
1487 return ( (g & (((uint) 1) << k)) ?
TRUE :
FALSE );
1490void bitset2vector(uint g, Vector &v)
1496 if (bit_test(g, 0)) {
1497 v.append_integer(i);
1518 for (i = 0; i < l; i++) {
1520 for (j = 0; j <= n; j++) {
1541 for (i = 0; i < l; i++) {
1543 for (j = 0; j < n; j++) {
1563 for (ii = 0; ii < l; ii++) {
1584 cout <<
"printing_mode() overflow in printing_mode stack" << endl;
1593 cout <<
"~printing_mode() underflow in printing_mode stack" << endl;
1601 printf(
"executing: %s\n", cmd);
1616#define HASH_PRIME ((int)(1 << 30)-1)
1649 cout <<
"queue_get_and_remove_first_element() queue is empty" << endl;
1653 for (i = 0; i < l - 1; i++) {
1695 for (i = 0; i < l; i++) {
1697 if (!multiplicities[i].is_one()) {
1698 ost <<
"^{" << multiplicities[i] <<
"}";
1711 for (i = 0; i < n; i++) {
1716int Gauss_int(
int *A,
int f_special,
int f_complete,
int *base_cols,
1717 int f_P,
int *P,
int m,
int n,
int Pn,
1718 int q,
int *add_table,
int *mult_table,
1719 int *negate_table,
int *inv_table,
int verbose_level)
1724 int f_v = (verbose_level >= 1);
1725 int rank, i, j, k, jj;
1726 int pivot, pivot_inv = 0, a, b, c, z, f;
1730 cout <<
"Gauss_int Gauss algorithm for matrix:" << endl;
1734 for (j = 0; j < n; j++) {
1737 for (k = i; k < m; k++) {
1741 for (jj = j; jj < n; jj++) {
1742 Algo.
int_swap(A[i * n + jj], A[k * n + jj]);
1745 for (jj = 0; jj < Pn; jj++) {
1746 Algo.
int_swap(P[i * Pn + jj], P[k * Pn + jj]);
1758 cout <<
"Gauss_int row " << i <<
" pivot in row " << k <<
" colum " << j << endl;
1763 pivot = A[i * n + j];
1764 pivot_inv = inv_table[pivot];
1767 for (jj = j; jj < n; jj++) {
1768 A[i * n + jj] = mult_table[A[i * n + jj] * q + pivot_inv];
1771 for (jj = 0; jj < Pn; jj++) {
1772 P[i * Pn + jj] = mult_table[P[i * Pn + jj] * q + pivot_inv];
1776 cout <<
"Gauss_int pivot=" << pivot <<
" pivot_inv=" << pivot_inv
1777 <<
" made to one: " << A[i * n + j] << endl;
1782 for (k = i + 1; k < m; k++) {
1787 f = mult_table[z * q + pivot_inv];
1792 f = negate_table[f];
1795 cout <<
"Gauss_int eliminating row " << k << endl;
1797 for (jj = j + 1; jj < n; jj++) {
1803 c = mult_table[f * q + a];
1804 c = add_table[c * q + b];
1807 cout << A[k * n + jj] <<
" ";
1811 for (jj = 0; jj < Pn; jj++) {
1815 c = mult_table[f * q + a];
1816 c = add_table[c * q + b];
1826 cout <<
"Gauss_int A=" << endl;
1829 cout <<
"Gauss_int P=" << endl;
1836 for (i = rank - 1; i >= 0; i--) {
1842 pivot = A[i * n + j];
1843 pivot_inv = inv_table[pivot];
1846 for (k = i - 1; k >= 0; k--) {
1851 for (jj = j + 1; jj < n; jj++) {
1855 a = mult_table[a * q + pivot_inv];
1857 c = mult_table[z * q + a];
1858 c = negate_table[c];
1859 c = add_table[c * q + b];
1863 for (jj = 0; jj < Pn; jj++) {
1867 a = mult_table[a * q + pivot_inv];
1869 c = mult_table[z * q + a];
1870 c = negate_table[c];
1871 c = add_table[c * q + b];
1879 cout <<
"Gauss_int the rank is " << rank << endl;
1888 for (i = 0; i < len; i++)
1894 int *q =
new int[new_length];
1897 m =
MINIMUM(old_length, new_length);
1898 for (i = 0; i < m; i++) {
1907 int *q =
new int[new_length];
1910 for (i = 0; i < new_length; i++) {
1919 int *q =
new int[new_m * new_n];
1920 int m =
MINIMUM(old_m, new_m);
1921 int n =
MINIMUM(old_n, new_n);
1924 for (i = 0; i < m; i++) {
1925 for (j = 0; j < n; j++) {
1926 q[i * new_n + j] = p[i * old_n + j];
1935 static int col_reached[1000];
1936 static int row_reached[1000];
1944 int c_processed = 0;
1946 int r_processed = 0;
1950 cout <<
"code_is_irreducible() nmk > 1000" << endl;
1954 cout <<
"code_is_irreducible() k > 1000" << endl;
1957 for (j = 0; j < nmk; j++)
1959 for (i = 0; i < k; i++)
1964 for (j = 0; j < nmk; j++) {
1965 if (M[i * nmk + j] != 0) {
1966 if (col_reached[j] == 0) {
1974 while ((c_processed < c_reached) ||
1975 (r_processed < r_reached)) {
1979 if (c_processed < c_reached) {
1980 for (j = 0; j < nmk; j++) {
1982 if (col_reached[j] == 1) {
1984 for (i = 0; i < k; i++) {
1985 if (M[i * nmk + j] != idx_zero) {
1986 if (row_reached[i] == 0) {
2001 if (r_processed < r_reached) {
2002 for (i = 0; i < k; i++) {
2004 if (row_reached[i] == 1) {
2006 for (j = 0; j < nmk; j++) {
2007 if (M[i * nmk + j] != idx_zero) {
2008 if (col_reached[j] == 0) {
2025 if (c_processed < nmk || r_processed < k)
2037 int f_v = (verbose_level >= 1);
2038 int f_vv = (verbose_level >= 2);
2044 cout <<
"fine_tune: tuning matrix:" << endl;
2055 for (i = 0; i < 16; i++) {
2058 mtxGram[0 * 4 + 1] = 1;
2059 mtxGram[1 * 4 + 0] = 1;
2060 mtxGram[2 * 4 + 3] = 1;
2061 mtxGram[3 * 4 + 2] = 1;
2070 cout <<
"D^transpose * Gram * D = " << endl;
2078 for (i = 0; i < 16; i++) {
2079 if (mtxGram[i] == 0) {
2081 cout <<
"does not preserve the form" << endl;
2091 cout <<
"does not preserve the form (type 2 error)" << endl;
2097 cout <<
"scalar c = " << c << endl;
2101 cout <<
"cv = " << cv << endl;
2106 cout <<
"q is not a prime" << endl;
2111 cout <<
"sqrt(cv) = " << s << endl;
2115 for (i = 0; i < 16; i++) {
2116 mtxG[i] = F->
mult(mtxD[i], s);
2120 cout <<
"mtxG = s * mtxD:" << endl;
2134 cout <<
"G^transpose * Gram * G = " << endl;
2139 for (i = 0; i < 16; i++) {
2143 cout <<
"fine_tune: the resulting matrix is" << endl;
catch all class for algorithms
void int_swap(int &x, int &y)
linear_algebra::linear_algebra * Linear_algebra
various functions related to geometries
long int nb_PG_elements(int n, int q)
long int nb_AG_elements(int n, int q)
void transpose_matrix(int *A, int *At, int ma, int na)
void mult_matrix_matrix(int *A, int *B, int *C, int m, int n, int o, int verbose_level)
basic number theoretic functions
int sp_ge(int n, int p_min)
int smallest_primedivisor(int n)
int Legendre(long int a, long int p, int verbose_level)
int i_power_j(int i, int j)
int is_prime_power(int q)
a collection of functions related to file io
long int file_size(std::string &fname)
DISCRETA vector class for vectors of DISCRETA objects.
void PG_element_unrank(int a)
Vector & append_integer(int a)
void AG_element_rank(int &a)
void AG_element_unrank(int a)
void PG_element_rank(int &a)
DISCRETA base class. All DISCRETA classes are derived from this class.
void integral_division_exact(discreta_base &x, discreta_base &q)
virtual std::ostream & print(std::ostream &)
discreta_base & factorial(int z)
discreta_base & power_int_mod(int l, discreta_base &p)
void add_mod(discreta_base &x, discreta_base &y, discreta_base &p)
void swap(discreta_base &a)
void mult_mod(discreta_base &x, discreta_base &y, discreta_base &p)
discreta_base & power_int(int l)
Vector & change_to_vector()
discreta_matrix & m_mn_n(int m, int n)
DISCRETA class for influencing arithmetic operations.
void append(const char *p)
DISCRETA class for integers of arbitrary magnitude.
int compare_with(discreta_base &b)
DISCRETA class for partitions of an integer.
void multinomial_ordered(discreta_base &res, int f_v)
int first_into_k_parts(int n, int k)
int next_into_k_parts(int n, int k)
DISCRETA permutation class.
DISCRETA class related to printing of objects.
printing_mode(enum printing_mode_enum printing_mode)
DISCRETA class related to class domain.
#define Int_vec_print_integer_matrix(A, B, C, D)
#define Int_vec_print_integer_matrix_width(A, B, C, D, E, F)
#define MAX_PRINTING_MODE_STACK
void print_intvec_mod_10(Vector &v)
void fill_char(void *v, int cnt, int c)
void discreta_print_factorization(Vector &primes, Vector &exponents, std::ostream &o)
void html_foot(std::ostream &ost)
enum printing_mode_enum current_printing_mode()
discreta_base * calloc_nobjects_plus_length(int n, kind k)
void texable_string(char *in, char *out)
void print_factorization_hollerith(Vector &primes, Vector &exponents, hollerith &h)
void free_nobjects_plus_length(discreta_base *p)
void stirling_first(int n, int k, int f_signless, discreta_base &res, int verbose_level)
void freeobject(discreta_base *p)
void Catalan_nk_matrix(int n, discreta_matrix &Cnk, int verbose_level)
discreta_base * callocobject(kind k)
void ratio_int(int *Px, int *Py, int idx_from, int idx_to, int idx_result, double r)
void sieve_primes(Vector &v, int from, int to, int limit, int verbose_level)
void int_vector_realloc(int *&p, int old_length, int new_length)
int sqrt_mod_involved(int a, int p, int verbose_level)
void tuple2_rank(int rank, int &i, int &j, int n, int f_injective)
void free_m_times_n_objects(discreta_base *p)
void database_init(int verbose_level)
void sieve(Vector &primes, int factorbase, int verbose_level)
void int_matrix_realloc(int *&p, int old_m, int new_m, int old_n, int new_n)
void Binomial(int n, int k, discreta_base &n_choose_k)
void printobjectkind(std::ostream &ost, kind k)
void frobenius_in_AG(domain *dom, int n, permutation &p)
void free_nobjects(discreta_base *p, int n)
int Gauss_int(int *A, int f_special, int f_complete, int *base_cols, int f_P, int *P, int m, int n, int Pn, int q, int *add_table, int *mult_table, int *negate_table, int *inv_table, int verbose_level)
void uint4_swap(uint_4 &x, uint_4 &y)
int factor_if_prime_power(int n, int *p, int *e)
int sqrt_mod(int a, int p, int verbose_level)
void midpoint_of_5(int *Px, int *Py, int i1, int i2, int i3, int i4, int i5, int idx)
int hash_int(int hash0, int a)
void stirling_second(int n, int k, int f_ordered, discreta_base &res, int verbose_level)
const char * discreta_arch
void midpoint_of_2(int *Px, int *Py, int i1, int i2, int idx)
int queue_get_and_remove_first_element(Vector &Q)
const char * kind_ascii(kind k)
void fine_tune(layer1_foundations::field_theory::finite_field *F, int *mtxD, int verbose_level)
void Catalan(int n, Vector &v, int verbose_level)
void print_classification_tex(Vector &content, Vector &multiplicities)
int queue_length(Vector &Q)
@ PERMUTATION
PERMUTATION.
@ DESIGN_PARAMETER
DESIGN_PARAMETER.
@ NUMBER_PARTITION
NUMBER_PARTITION.
@ LONGINTEGER
LONGINTEGER.
@ DESIGN_PARAMETER_SOURCE
DESIGN_PARAMETER_SOURCE.
std::ostream & operator<<(std::ostream &ost, class discreta_base &p)
void Catalan_n(int n, Vector &v, discreta_base &res, int verbose_level)
void the_first_n_primes(Vector &P, int n)
void queue_init(Vector &Q, int elt)
void N_choose_K(discreta_base &n, int k, discreta_base &res)
int tuple2_unrank(int i, int j, int n, int f_injective)
int NormRemainder(int a, int m)
void call_system(char *cmd)
void html_head(std::ostream &ost, char *title_long, char *title_short)
void queue_append(Vector &Q, int elt)
void translation_in_AG(domain *dom, int n, int i, discreta_base &a, permutation &p)
void int_vector_shorten(int *&p, int new_length)
void Krawtchouk(int n, int q, int i, int j, discreta_base &a)
void factor_integer(int n, Vector &primes, Vector &exponents)
const char * discreta_home
discreta_base * calloc_nobjects(int n, kind k)
int printing_mode_stack_size
void Catalan_nk_star_matrix(int n, discreta_matrix &Cnk, int verbose_level)
void char_move(char *p, char *q, int len)
void perm2permutation(int *a, int n, permutation &p)
void frobenius_in_PG(domain *dom, int n, permutation &p)
const char * action_kind_ascii(action_kind k)
int remainder_mod(int i, int n)
int invert_mod_integer(int i, int p)
void output_texable_string(std::ostream &ost, char *in)
discreta_base * calloc_m_times_n_objects(int m, int n, kind k)
int code_is_irreducible(int k, int nmk, int idx_zero, int *M)
void Catalan_nk_star(int n, int k, discreta_matrix &Cnk, discreta_base &res, int verbose_level)
the orbiter library for the classification of combinatorial objects