18namespace layer1_foundations {
72 int f_v = (verbose_level >= 1);
75 cout <<
"grassmann::init n=" <<
n
76 <<
" k=" <<
k <<
" q=" <<
F->
q << endl;
91 cout <<
"grassmann::init nCkq=" << *
nCkq << endl;
106 G->
init(
n - 1,
k - 1,
F, verbose_level);
123 ostream &ost,
long int a)
136 std::ostream &ost,
long int a)
147 for (i = 0; i < len; i++) {
148 cout <<
"subspace " << i <<
" / " << len
149 <<
" is " <<
v[i] <<
":" << endl;
164 for (i = 0; i < len; i++) {
165 ost <<
"subspace " << i <<
" / " << len <<
" is "
166 <<
v[i] <<
":\\\\" << endl;
184 ost <<
"\\qquad" << endl;
188 ost <<
"\\qquad" << endl;
192 ost <<
"\\qquad" << endl;
209 for (i = 0; i < len; i++) {
210 ost <<
"subspace " << i <<
" / " << len <<
" and its dual are "
211 <<
v[i] <<
":\\\\" << endl;
228 ost <<
"\\qquad" << endl;
232 ost <<
"\\qquad" << endl;
236 ost <<
"\\qquad" << endl;
261 for (i = 0; i < nb; i++) {
283 int f_v = (verbose_level >= 1);
287 cout <<
"grassmann::unrank_embedded_subspace_lint " << rk << endl;
295 for (i = 0; i <
n -
k; i++) {
297 M[(
k + i) *
n + j] = 1;
301 cout <<
"unrank_embedded_subspace_lint done" << endl;
307 int f_v = (verbose_level >= 1);
311 cout <<
"grassmann::rank_embedded_subspace_lint " << endl;
320 int f_v = (verbose_level >= 1);
324 cout <<
"grassmann::unrank_embedded_subspace_int_here " << rk << endl;
332 for (i = 0; i <
n -
k; i++) {
334 Basis[(
k + i) *
n + j] = 1;
338 cout <<
"unrank_embedded_subspace_int_here done" << endl;
345 int f_v = (verbose_level >= 1);
346 long int r, h, a = 1, A;
347 int nb_free_cols = 0;
348 long int Q, b, c, i, j;
354 cout <<
"grassmann::unrank_lint " << rk << endl;
367 cout <<
"r=" << r << endl;
373 cout <<
"[" <<
n - h - 1 <<
" choose " <<
k - 1
374 <<
"]_" <<
q <<
" = " << a << endl;
376 nb_free_cols =
n - h - 1 - (
k - 1);
379 cout <<
"Q=" << Q << endl;
383 cout <<
"A=" << A << endl;
390 cout <<
"r=" << r << endl;
395 cout <<
"grassmann::unrank_lint h == n" << endl;
396 cout <<
"h=" << h << endl;
397 cout <<
"r=" << r << endl;
403 cout <<
"grassmann::unrank_lint " << rk <<
" h=" << h
404 <<
" nb_free_cols=" << nb_free_cols << endl;
413 cout <<
"r=" << r <<
" coset " << b
414 <<
" subspace rank " << c << endl;
422 cout <<
"grassmann::unrank_lint coset " << b <<
" = ";
431 for (j = 0; j <
k - 1; j++) {
436 cout <<
"grassmann::unrank_lint calling "
437 "int_vec_complement n=" <<
n <<
" k=" <<
k <<
" : ";
445 for (j = 0; j < nb_free_cols; j++) {
450 for (j = 0; j < nb_free_cols; j++) {
458 for (i = 0; i <
G->
k; i++) {
461 for (j = 0; j <= h; j++) {
462 M[(1 + i) *
n + j] = 0;
466 for (j = 0; j <
G->
n; j++) {
467 M[(1 + i) *
n + h + 1 + j] =
G->
M[i *
G->
n + j];
472 cout <<
"grassmann::unrank_lint " << rk <<
", we found the matrix" << endl;
474 cout <<
"grassmann::unrank_lint base_cols = ";
477 cout <<
"grassmann::unrank_lint complement = ";
482 cout <<
"grassmann::unrank_lint " << rk <<
" finished" << endl;
488 int f_v = (verbose_level >= 1);
489 long int k1, r, h, a, A;
491 long int Q, b, c, i, j;
498 cout <<
"grassmann::rank_lint " << endl;
511 cout <<
"grassmann::rank_lint after Gauss:" << endl;
516 cout <<
"grassmann::rank_lint error, does not have full rank" << endl;
520 cout <<
"grassmann::rank_lint base_cols: ";
527 cout <<
"grassmann::rank_lint calling int_vec_complement n=" <<
n
528 <<
" k=" <<
k <<
" : ";
534 cout <<
"grassmann::rank_lint complement : ";
540 nb_free_cols =
n - h - 1 - (
k - 1);
546 nb_free_cols =
n - h - 1 - (
k - 1);
551 cout <<
"grassmann::rank_lint h=" << h <<
" nb_free_cols="
552 << nb_free_cols <<
" r=" << r << endl;
558 for (i = 0; i <
G->
k; i++) {
561 for (j = 0; j <
G->
n; j++) {
562 G->
M[i *
G->
n + j] =
M[(1 + i) *
n + h + 1 + j];
578 for (j = 0; j < nb_free_cols; j++) {
583 for (j = 0; j < nb_free_cols; j++) {
595 cout <<
"grassmann::rank_lint coset " << b <<
" = ";
605 cout <<
"grassmann::rank_lint b * a + c = " << b <<
" * "
606 << a <<
" + " << c << endl;
607 cout <<
"grassmann::rank_lint r=" << r <<
" coset " << b
608 <<
" subspace rank " << c << endl;
630 int f_v = (verbose_level >= 1);
634 int i, j, h, nb_free_cols = 0;
638 cout <<
"unrank_longinteger " << rk << endl;
644 for (j = 0; j <
n; j++) {
655 cout <<
"[" <<
n - h - 1 <<
" choose " <<
k - 1
656 <<
"]_" <<
q <<
" = " << a << endl;
658 nb_free_cols =
n - h - 1 - (
k - 1);
673 cout <<
"grassmann::unrank_longinteger h == n" << endl;
679 cout <<
"grassmann::unrank_longinteger " << rk
680 <<
" h=" << h <<
" nb_free_cols=" << nb_free_cols << endl;
690 cout <<
"r=" << r <<
" coset " << b
691 <<
" subspace rank " << c << endl;
699 cout <<
"grassmann::unrank_longinteger coset " << b <<
" = ";
708 for (j = 0; j <
k - 1; j++) {
713 cout <<
"grassmann::unrank_longinteger calling "
714 "int_vec_complement n=" <<
n <<
" k=" <<
k <<
" : ";
722 for (j = 0; j < nb_free_cols; j++) {
727 for (j = 0; j < nb_free_cols; j++) {
735 for (i = 0; i <
G->
k; i++) {
738 for (j = 0; j <= h; j++) {
739 M[(1 + i) *
n + j] = 0;
743 for (j = 0; j <
G->
n; j++) {
744 M[(1 + i) *
n + h + 1 + j] =
G->
M[i *
G->
n + j];
749 cout <<
"unrank_longinteger " << rk
750 <<
", we found the matrix" << endl;
752 cout <<
"grassmann::unrank_longinteger base_cols = ";
755 cout <<
"grassmann::unrank_longinteger complement = ";
760 cout <<
"unrank_longinteger " << rk <<
" finished" << endl;
767 int f_v = (verbose_level >= 1);
771 int k1, nb_free_cols, h, i, j;
774 r.
create(0, __FILE__, __LINE__);
776 cout <<
"grassmann::rank_longinteger " << endl;
788 cout <<
"grassmann::rank_longinteger after Gauss:" << endl;
793 cout <<
"grassmann::rank_longinteger error, does not have full rank" << endl;
797 cout <<
"grassmann::rank_longinteger base_cols: ";
804 cout <<
"grassmann::rank_longinteger calling int_vec_complement for ";
816 nb_free_cols =
n - h - 1 - (
k - 1);
819 cout <<
"create_i_power_j q=" <<
q
820 <<
" nb_free_cols=" << nb_free_cols
821 <<
" yields " << Q << endl;
825 cout <<
"q_binomial [" <<
n - h - 1 <<
"," <<
k - 1
826 <<
"]_" <<
q <<
" = " << a << endl;
832 nb_free_cols =
n - h - 1 - (
k - 1);
835 cout <<
"q_binomial [" <<
n - h - 1 <<
"," <<
k - 1
836 <<
"]_" <<
q <<
" = " << a << endl;
841 cout <<
"grassmann::rank_longinteger h=" << h
842 <<
" nb_free_cols=" << nb_free_cols
843 <<
" r=" << r << endl;
849 for (i = 0; i <
G->
k; i++) {
852 for (j = 0; j <
G->
n; j++) {
853 G->
M[i *
G->
n + j] =
M[(1 + i) *
n + h + 1 + j];
864 c.
create(0, __FILE__, __LINE__);
867 cout <<
"grassmann::rank_longinteger rank of subspace by induction is " << c << endl;
872 for (j = 0; j < nb_free_cols; j++) {
877 for (j = 0; j < nb_free_cols; j++) {
885 cout <<
"AG_element_rank_longinteger for coset ";
887 cout <<
" yields " << b << endl;
891 b.
create(0, __FILE__, __LINE__);
894 cout <<
"grassmann::rank_longinteger coset " << b <<
" = ";
903 cout <<
"grassmann::rank_longinteger computing r:=" << r <<
" + " << b
904 <<
" * " << a <<
" + " << c << endl;
908 cout << b <<
" * " << a <<
" = " << tmp1 << endl;
910 D.
add(tmp1, c, tmp2);
912 cout << tmp1 <<
" + " << c <<
" = " << tmp2 << endl;
918 cout <<
"grassmann::rank_longinteger r=" << r <<
" coset " << b
919 <<
" subspace rank " << c << endl;
935 for (i = 0; i <
k *
n; i++) {
939 for (i = 0; i <
k *
n; i++) {
947 int *Mtx,
long int rk,
int verbose_level)
950 int f_v = (verbose_level >= 1);
956 cout <<
"grassmann::unrank_lint_here_and_extend_basis" << endl;
965 cout <<
"r != k" << endl;
969 for (i = 0; i <
n -
k; i++) {
970 Mtx[(
k + i) *
n + embedding[i]] = 1;
975 cout <<
"grassmann::unrank_lint_here_and_extend_basis done" << endl;
980 int *Mtx,
long int rk,
int verbose_level)
983 int f_v = (verbose_level >= 1);
989 cout <<
"grassmann::unrank_int_here_and_compute_perp" << endl;
997 cout <<
"r != k" << endl;
1003 cout <<
"grassmann::unrank_int_here_and_compute_perp done" << endl;
1008 long int *®ulus,
int ®ulus_size,
int f_opposite,
int verbose_level)
1011 int f_v = (verbose_level >= 1);
1012 int f_vv = (verbose_level >= 2);
1013 int f_v3 = (verbose_level >= 3);
1018 cout <<
"grassmann::line_regulus_in_PG_3_q" << endl;
1021 cout <<
"grassmann::line_regulus_in_PG_3_q n != 4" << endl;
1025 cout <<
"grassmann::line_regulus_in_PG_3_q k != 2" << endl;
1028 regulus_size =
q + 1;
1031 for (u = 0; u < regulus_size; u++) {
1074 cout <<
"grassmann::line_regulus_in_PG_3_q "
1075 "regulus element " << u <<
":" << endl;
1082 cout <<
"grassmann::line_regulus_in_PG_3_q regulus:" << endl;
1087 cout <<
"grassmann::line_regulus_in_PG_3_q done" << endl;
1092 int *&self_dual_lines,
int &nb_self_dual_lines,
1095 int f_v = (verbose_level >= 1);
1096 int f_vv = (verbose_level >= 1);
1102 cout <<
"grassmann::compute_dual_line_idx" << endl;
1105 cout <<
"grassmann::compute_dual_line_idx need 2 * k == n" << endl;
1110 dual_line_idx =
NEW_int(nb_lines);
1111 self_dual_lines =
NEW_int(nb_lines);
1113 nb_self_dual_lines = 0;
1114 for (a = 0; a < nb_lines; a++) {
1117 cout <<
"line " << a <<
" / " << nb_lines <<
":" << endl;
1118 cout <<
"line is generated by" << endl;
1123 cout <<
"after perp:" << endl;
1128 cout <<
"line " << a <<
" / " << nb_lines
1129 <<
" the dual is " << b << endl;
1130 cout <<
"dual line is generated by" << endl;
1133 dual_line_idx[a] = b;
1135 self_dual_lines[nb_self_dual_lines++] = a;
1139 cout <<
"grassmann::compute_dual_line_idx done" << endl;
1144 int *spread,
int *dual_spread,
int spread_size,
1147 int f_v = (verbose_level >= 1);
1148 int f_vv = (verbose_level >= 5);
1153 cout <<
"grassmann::compute_dual_spread" << endl;
1156 cout <<
"grassmann::compute_dual_spread, need 2 * k == n" << endl;
1162 cout <<
"grassmann::compute_dual_spread The spread is : ";
1166 for (i = 0; i < spread_size; i++) {
1170 cout << i <<
"-th Line has rank " << a
1171 <<
" and is generated by" << endl;
1176 cout <<
"after perp:" << endl;
1181 cout << i <<
"-th Line dual has rank " << b
1182 <<
" and is generated by" << endl;
1188 cout <<
"grassmann::compute_dual_spread The dual spread is : ";
1195 cout <<
"grassmann::compute_dual_spread done" << endl;
1216 int f_v = (verbose_level >= 1);
1219 cout <<
"grassmann::create_Schlaefli_graph" << endl;
1242 for (i = 0; i < N; i++) {
1245 for (j = 0; j <
q + 1; j++) {
1257 cout <<
"create_graph::create_Schlaefli We found " << sz <<
" lines on the surface" << endl;
1264 for (i = 0; i < sz; i++) {
1267 for (j = i + 1; j < sz; j++) {
1275 Adj[i * sz + j] = 1;
1276 Adj[j * sz + i] = 1;
1287 cout <<
"grassmann::create_Schlaefli_graph done" << endl;
1294 int f_v = (verbose_level >= 1);
1295 int f_v3 = (verbose_level >= 3);
1299 cout <<
"grassmann::make_special_element_zero" << endl;
1307 for (i = 0; i <
k; i++) {
1311 cout <<
"grassmann::make_special_element_zero M:" << endl;
1316 cout <<
"grassmann::make_special_element_zero a=" << a << endl;
1323 int f_v = (verbose_level >= 1);
1324 int f_v3 = (verbose_level >= 3);
1328 cout <<
"grassmann::make_special_element_one" << endl;
1336 for (i = 0; i <
k; i++) {
1338 M[i *
n +
k + i] = 1;
1341 cout <<
"grassmann::make_special_element_one M:" << endl;
1346 cout <<
"grassmann::make_special_element_one a=" << a << endl;
1353 int f_v = (verbose_level >= 1);
1354 int f_v3 = (verbose_level >= 3);
1358 cout <<
"grassmann::make_special_element_infinity" << endl;
1366 for (i = 0; i <
k; i++) {
1367 M[i *
n +
k + i] = 1;
1370 cout <<
"grassmann::make_special_element_infinity M:" << endl;
1375 cout <<
"grassmann::make_special_element_infinity a=" << a << endl;
a collection of combinatorial functions
long int generalized_binomial(int n, int k, int q)
void q_binomial(ring_theory::longinteger_object &a, int n, int k, int q, int verbose_level)
void complement(int *v, int n, int k)
void print_matrix_latex(std::ostream &ost, int *A, int m, int n)
void print_matrix_numerical_latex(std::ostream &ost, int *A, int m, int n)
void PG_element_unrank_modified(int *v, int stride, int len, int a)
int evaluate_Fermat_cubic(int *v)
linear_algebra::linear_algebra * Linear_algebra
void PG_element_rank_modified_lint(int *v, int stride, int len, long int &a)
various functions related to geometries
void AG_element_unrank(int q, int *v, int stride, int len, long int a)
void AG_element_rank_longinteger(int q, int *v, int stride, int len, ring_theory::longinteger_object &a)
void AG_element_unrank_longinteger(int q, int *v, int stride, int len, ring_theory::longinteger_object &a)
long int AG_element_rank(int q, int *v, int stride, int len)
to rank and unrank subspaces of a fixed dimension in F_q^n
void print_set_tex_with_perp(std::ostream &ost, long int *v, int len)
field_theory::finite_field * F
void create_Schlaefli_graph(int *&Adj, int &sz, int verbose_level)
long int make_special_element_infinity(int verbose_level)
void unrank_longinteger(ring_theory::longinteger_object &rk, int verbose_level)
void print_set(long int *v, int len)
void unrank_longinteger_here(int *Mtx, ring_theory::longinteger_object &rk, int verbose_level)
long int nb_of_subspaces(int verbose_level)
long int make_special_element_one(int verbose_level)
void unrank_lint(long int rk, int verbose_level)
void unrank_embedded_subspace_lint_here(int *Basis, long int rk, int verbose_level)
void unrank_lint_here_and_compute_perp(int *Mtx, long int rk, int verbose_level)
int nb_points_covered(int verbose_level)
ring_theory::longinteger_object * nCkq
void latex_matrix_numerical(std::ostream &ost, int *p)
void rank_longinteger(ring_theory::longinteger_object &r, int verbose_level)
void line_regulus_in_PG_3_q(long int *®ulus, int ®ulus_size, int f_opposite, int verbose_level)
long int rank_embedded_subspace_lint(int verbose_level)
void latex_matrix(std::ostream &ost, int *p)
void compute_dual_line_idx(int *&dual_line_idx, int *&self_dual_lines, int &nb_self_dual_lines, int verbose_level)
void print_set_tex(std::ostream &ost, long int *v, int len)
long int rank_lint_here(int *Mtx, int verbose_level)
void rank_longinteger_here(int *Mtx, ring_theory::longinteger_object &rk, int verbose_level)
int dimension_of_join(long int rk1, long int rk2, int verbose_level)
void print_single_generator_matrix_tex_numerical(std::ostream &ost, long int a)
long int rank_lint(int verbose_level)
void compute_dual_spread(int *spread, int *dual_spread, int spread_size, int verbose_level)
void unrank_embedded_subspace_lint(long int rk, int verbose_level)
void unrank_lint_here(int *Mtx, long int rk, int verbose_level)
void init(int n, int k, field_theory::finite_field *F, int verbose_level)
long int make_special_element_zero(int verbose_level)
void unrank_lint_here_and_extend_basis(int *Mtx, long int rk, int verbose_level)
void points_covered(long int *the_points, int verbose_level)
void print_single_generator_matrix_tex(std::ostream &ost, long int a)
void mult_vector_from_the_left(int *v, int *A, int *vA, int m, 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 verbose_level)
void identity_matrix(int *A, int n)
void unrank_point_in_PG(int *v, int len, int rk)
int base_cols_and_embedding(int m, int n, int *A, int *base_cols, int *embedding, int verbose_level)
int RREF_and_kernel(int n, int k, int *A, int verbose_level)
int rank_of_rectangular_matrix(int *A, int m, int n, int verbose_level)
int perp_standard(int n, int k, int *A, int verbose_level)
basic number theoretic functions
int i_power_j(int i, int j)
long int i_power_j_lint(long int i, long int j)
data_structures::int_vec * Int_vec
domain to compute with objects of type longinteger
int compare(longinteger_object &a, longinteger_object &b)
void add(longinteger_object &a, longinteger_object &b, longinteger_object &c)
void mult(longinteger_object &a, longinteger_object &b, longinteger_object &c)
void integral_division(longinteger_object &a, longinteger_object &b, longinteger_object &q, longinteger_object &r, int verbose_level)
a class to represent arbitrary precision integers
void assign_to(longinteger_object &b)
void create_i_power_j(int i, int j)
void create(long int i, const char *file, int line)
void swap_with(longinteger_object &b)
#define Int_vec_zero(A, B)
#define Lint_vec_print(A, B, C)
#define Int_vec_print_integer_matrix_width(A, B, C, D, E, F)
#define Int_matrix_print(A, B, C)
#define Int_vec_copy(A, B, C)
#define Int_vec_print(A, B, C)
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects