16namespace layer1_foundations {
17namespace orthogonal_geometry {
22 int f_v = (verbose_level >= 1);
26 cout <<
"orthogonal::find_root" << endl;
35 cout <<
"orthogonal::find_root epsilon = " <<
epsilon << endl;
39 cout <<
"orthogonal::find_root done" << endl;
46 long int rk_from,
long int rk_to,
long int root,
int verbose_level)
48 int f_v = (verbose_level >= 1);
51 cout <<
"orthogonal::Siegel_map_between_singular_points" << endl;
59 cout <<
"orthogonal::Siegel_map_between_singular_points done" << endl;
64 long int rk_from,
long int rk_to,
long int root,
int m,
int verbose_level)
66 int f_v = (verbose_level >= 1);
70 cout <<
"orthogonal::Siegel_map_between_singular_points_hyperbolic" << endl;
73 1, 2 *
m - 1, 0,0,0, Gram, verbose_level - 1);
81 cout <<
"orthogonal::Siegel_map_between_singular_points_hyperbolic done" << endl;
86 long int rk_from,
long int rk_to,
long int root,
90 int f_v = (verbose_level >= 1);
93 cout <<
"Siegel_Transformation rk_from=" << rk_from
94 <<
" rk_to=" << rk_to <<
" root=" << root << endl;
101 cout <<
"Siegel_Transformation done" << endl;
106 long int rk_from,
long int rk_to,
long int root,
107 int *B,
int *Bv,
int *w,
int *z,
int *x,
110 int f_v = (verbose_level >= 1);
111 int f_vv = (verbose_level >= 2);
112 int *From, *To, *Root;
115 cout <<
"orthogonal::Siegel_Transformation2" << endl;
143 cout <<
"the Siegel transformation is:" << endl;
147 cout <<
"orthogonal::Siegel_Transformation2 done" << endl;
152 int *from,
int *to,
int *root,
153 int *B,
int *Bv,
int *w,
int *z,
int *x,
156 int i, j, a, b, av, bv, minus_one;
159 int f_v = (verbose_level >= 1);
160 int f_vv = (verbose_level >= 2);
164 cout <<
"orthogonal::Siegel_Transformation3" << endl;
169 cout <<
"n=" <<
n << endl;
170 cout <<
"Gram matrix:" << endl;
181 for (i = 0; i <
n; i++) {
202 for (i = 0; i <
n; i++) {
204 w[i] =
F->
mult(w[i], bv);
206 for (i = 2; i <
n; i++) {
207 for (j = 0; j <
n; j++) {
213 cout <<
"before perp, the matrix B is:" << endl;
218 cout <<
"the matrix B is:" << endl;
223 cout <<
"the matrix Bv is:" << endl;
229 cout <<
"the coefficient vector z is:" << endl;
235 cout <<
"the coefficient vector z is:" << endl;
241 cout <<
"the vector x is:" << endl;
245 for (i = 0; i <
n; i++) {
246 x[i] =
F->
mult(x[i], minus_one);
249 cout <<
"the vector -x is:" << endl;
254 cout <<
"the Siegel transformation is:" << endl;
258 cout <<
"orthogonal::Siegel_Transformation3 done" << endl;
263 int f_action_is_semilinear,
267 int f_semisimilarity,
268 int *Mtx,
int verbose_level)
270 int f_v = (verbose_level >= 1);
271 int f_vv = (verbose_level >= 2);
276 cout <<
"orthogonal::random_generator_for_orthogonal_group" << endl;
277 cout <<
"f_action_is_semilinear=" << f_action_is_semilinear << endl;
278 cout <<
"f_siegel=" << f_siegel << endl;
279 cout <<
"f_reflection=" << f_reflection << endl;
280 cout <<
"f_similarity=" << f_similarity << endl;
281 cout <<
"f_semisimilarity=" << f_semisimilarity << endl;
287 if (r == 0 && f_siegel) {
290 else if (r == 1 && f_reflection) {
293 else if (r == 2 && f_similarity) {
296 else if (r == 3 && f_semisimilarity) {
297 if (!f_action_is_semilinear) {
306 cout <<
"orthogonal::random_generator_for_orthogonal_group "
307 "choosing Siegel_transformation" << endl;
310 if (f_action_is_semilinear) {
316 cout <<
"orthogonal::random_generator_for_orthogonal_group "
317 "choosing orthogonal reflection" << endl;
321 if (f_action_is_semilinear) {
327 cout <<
"orthogonal::random_generator_for_orthogonal_group "
328 "choosing similarity" << endl;
331 if (f_action_is_semilinear) {
337 cout <<
"orthogonal::random_generator_for_orthogonal_group "
338 "choosing random similarity" << endl;
343 cout <<
"orthogonal::random_generator_for_orthogonal_group "
350 int *Mtx,
int verbose_level)
353 int f_v = (verbose_level >= 1);
354 int f_vv = (verbose_level >= 2);
363 cout <<
"orthogonal::create_random_Siegel_transformation" << endl;
373 cout <<
"orthogonal::create_random_Siegel_transformation "
375 cout <<
"orthogonal::create_random_Siegel_transformation "
377 cout <<
"orthogonal::create_random_Siegel_transformation "
378 "Witt index k=" << k << endl;
379 cout <<
"orthogonal::create_random_Siegel_transformation "
380 "nb_pts=" << nb_pts << endl;
387 cout <<
"orthogonal::create_random_Siegel_transformation "
388 "rk_u=" << rk_u << endl;
397 rk_v = random_integer(nb_pts_affine);
399 cout <<
"orthogonal::create_random_Siegel_transformation "
400 "trying rk_v=" << rk_v << endl;
402 AG_element_unrank(
q, v, 1 , d, rk_v);
404 for (i = 0; i < d; i++) {
414 cout <<
"orthogonal::create_random_Siegel_transformation "
420 cout <<
"orthogonal::create_random_Siegel_transformation "
421 "fail, try again" << endl;
425 cout <<
"rk_u = " << rk_u <<
" : ";
437 Mtx, v, u, verbose_level - 1);
440 cout <<
"form_c1=" <<
form_c1 << endl;
441 cout <<
"form_c2=" <<
form_c2 << endl;
442 cout <<
"form_c3=" <<
form_c3 << endl;
447 cout <<
"}=" << endl;
453 cout <<
"orthogonal::create_random_Siegel_transformation "
461 int f_v = (verbose_level >= 1);
468 cout <<
"orthogonal::create_random_semisimilarity" << endl;
470 for (i = 0; i < d * d; i++) {
473 for (i = 0; i < d; i++) {
494 for (i = 0; i < d - 2; i++) {
497 Mtx[(i + 1) * d + i + 1] = 2;
504 Mtx[(d - 2) * d + d - 2] = u;
505 Mtx[(d - 2) * d + d - 1] = v;
506 Mtx[(d - 1) * d + d - 2] = w;
507 Mtx[(d - 1) * d + d - 1] = x;
510 cout <<
"orthogonal::create_random_semisimilarity "
511 "semisimilarity for even characteristic and "
512 "q != 4 not yet implemented" << endl;
522 cout <<
"orthogonal::create_random_semisimilarity "
523 "k=(p-1)/2=" << k <<
" a=prim elt=" << a
524 <<
" b=a^k=" << b <<
" c=b^{p^{h-1}}=" << c << endl;
530 cout <<
"orthogonal::create_random_semisimilarity done" << endl;
538 int f_v = (verbose_level >= 1);
539 int f_vv = (verbose_level >= 2);
545 cout <<
"orthogonal::create_random_similarity" << endl;
547 for (i = 0; i < d * d; i++) {
555 for (i = 0; i < d; i++) {
560 cout <<
"orthogonal::create_random_similarity "
564 for (i = 0; i < d; i++) {
573 cout <<
"orthogonal::create_random_similarity "
577 for (i = 1; i < d; i++) {
585 for (i = 0; i < d - 2; i++) {
596 cout <<
"orthogonal::create_random_similarity done" << endl;
601 int *Mtx,
int verbose_level)
604 int f_v = (verbose_level >= 1);
605 int f_vv = (verbose_level >= 2);
618 cout <<
"orthogonal::create_random_orthogonal_reflection" << endl;
619 cout <<
"verbose_level=" << verbose_level << endl;
625 nb_pts_affine = i_power_j(
q, d);
627 cout <<
"orthogonal::create_random_orthogonal_reflection" << endl;
628 cout <<
"nb_pts_affine=" << nb_pts_affine << endl;
635 cout <<
"orthogonal::create_random_orthogonal_reflection "
636 "iteration = " << cnt << endl;
640 rk_z = random_integer(nb_pts_affine);
642 cout <<
"orthogonal::create_random_orthogonal_reflection "
643 "iteration = " << cnt
644 <<
" trying rk_z=" << rk_z << endl;
647 AG_element_unrank(
q, z, 1 , d, rk_z);
649 for (i = 0; i < d; i++) {
655 cout <<
"orthogonal::create_random_orthogonal_reflection "
663 cout <<
"orthogonal::create_random_orthogonal_reflection "
664 "value of the quadratic form is " <<
alpha << endl;
672 cout <<
"orthogonal::create_random_orthogonal_reflection "
675 <<
" alpha = " <<
alpha <<
" : ";
681 cout <<
"orthogonal::create_random_orthogonal_reflection "
682 "before make_orthogonal_reflection" << endl;
688 cout <<
"orthogonal::create_random_orthogonal_reflection "
689 "after make_orthogonal_reflection" << endl;
699 cout <<
"orthogonal::create_random_orthogonal_reflection "
700 "before transform_form_matrix" << endl;
706 cout <<
"orthogonal::create_random_orthogonal_reflection "
707 "after transform_form_matrix" << endl;
711 cout <<
"create_random_orthogonal_reflection "
712 "The Gram matrix is not preserved" << endl;
713 cout <<
"Gram matrix:" << endl;
716 cout <<
"transformed Gram matrix:" << endl;
726 cout <<
"orthogonal::create_random_orthogonal_reflection "
734 int *M,
int *z,
int verbose_level)
736 int f_v = (verbose_level >= 1);
737 int f_vv = (verbose_level >= 2);
741 cout <<
"orthogonal::make_orthogonal_reflection" << endl;
748 for (i = 0; i <
n; i++) {
749 for (j = 0; j <
n; j++) {
752 M[i *
n + j] =
F->
add(1, M[i *
n + j]);
758 cout <<
"orthogonal::make_orthogonal_reflection created:" << endl;
762 cout <<
"orthogonal::make_orthogonal_reflection done" << endl;
767 int n,
int *Gram,
int verbose_level)
774 int f_v = (verbose_level >= 1);
775 int f_vv = (verbose_level >= 2);
779 cout <<
"orthogonal::make_Siegel_Transformation" << endl;
794 for (i = 0; i <
n; i++) {
795 for (j = 0; j <
n; j++) {
797 M[i *
n + j] =
F->
add(M[i *
n + j], e);
807 for (i = 0; i <
n; i++) {
808 for (j = 0; j <
n; j++) {
816 for (i = 0; i <
n; i++) {
817 for (j = 0; j <
n; j++) {
819 M[i *
n + j] =
F->
add(M[i *
n + j],
824 cout <<
"Siegel matrix:" << endl;
827 cout <<
"transformed Gram matrix:" << endl;
832 cout <<
"orthogonal::make_Siegel_Transformation done" << endl;
838 long int rk1,
long int rk2,
int *v,
int *w,
int verbose_level)
840 int f_v = (verbose_level >= 1);
841 int f_vv = (verbose_level >= 2);
845 cout <<
"orthogonal::Siegel_move_forward_by_index" << endl;
848 cout <<
"orthogonal::Siegel_move_forward_by_index "
849 "rk1=" << rk1 <<
" rk2=" << rk2 << endl;
852 for (i = 0; i <
n; i++)
859 cout <<
"orthogonal::Siegel_move_forward_by_index" << endl;
860 cout << rk1 <<
" : ";
863 cout << rk2 <<
" : ";
869 cout <<
"orthogonal::Siegel_move_forward_by_index moving forward: ";
877 cout <<
"orthogonal::Siegel_move_forward_by_index done" << endl;
882 long int rk1,
long int rk2,
int *w,
int *v,
int verbose_level)
884 int f_v = (verbose_level >= 1);
885 int f_vv = (verbose_level >= 2);
889 cout <<
"orthogonal::Siegel_move_backward_by_index" << endl;
892 cout <<
"orthogonal::Siegel_move_backward_by_index "
893 "rk1=" << rk1 <<
" rk2=" << rk2 << endl;
896 for (i = 0; i <
n; i++)
903 cout <<
"orthogonal::Siegel_move_backward_by_index" << endl;
904 cout << rk1 <<
" : ";
907 cout << rk2 <<
" : ";
913 cout <<
"orthogonal::Siegel_move_backward_by_index moving backward: ";
921 cout <<
"orthogonal::Siegel_move_backward_by_index done" << endl;
926 int *v1,
int *v2,
int *v3,
int *v4,
int verbose_level)
928 int f_v = (verbose_level >= 1);
929 int f_vv = (verbose_level >= 2);
930 int rk1_subspace, rk2_subspace, root, i;
933 cout <<
"orthogonal::Siegel_move_forward" << endl;
944 cout <<
"orthogonal::Siegel_move_forward rk1_subspace=" << rk1_subspace << endl;
945 cout <<
"orthogonal::Siegel_move_forward rk2_subspace=" << rk2_subspace << endl;
947 if (rk1_subspace == rk2_subspace) {
948 for (i = 0; i <
n; i++)
955 cout <<
"orthogonal::Siegel_move_forward root=" << root << endl;
958 rk1_subspace, rk2_subspace, root, verbose_level - 2);
964 cout <<
"orthogonal::Siegel_move_forward moving: ";
972 cout <<
"orthogonal::Siegel_move_forward done" << endl;
977 int *v1,
int *v2,
int *v3,
int *v4,
int verbose_level)
979 int f_v = (verbose_level >= 1);
980 int f_vv = (verbose_level >= 2);
981 long int rk1_subspace, rk2_subspace;
986 cout <<
"orthogonal::Siegel_move_backward" << endl;
997 cout <<
"rk1_subspace=" << rk1_subspace << endl;
998 cout <<
"rk2_subspace=" << rk2_subspace << endl;
1000 if (rk1_subspace == rk2_subspace) {
1001 for (i = 0; i <
n; i++)
1007 rk2_subspace, verbose_level - 2);
1009 cout <<
"orthogonal::Siegel_move_backward root=" << root << endl;
1010 cout <<
"orthogonal::Siegel_move_backward image, to be moved back: " << endl;
1015 rk1_subspace, rk2_subspace, root, verbose_level - 2);
1022 cout <<
"orthogonal::Siegel_move_backward moving: ";
1030 cout <<
"orthogonal::Siegel_move_backward done" << endl;
1037 long int pt_from,
long int pt_to,
1038 int nb,
long int *ranks,
int verbose_level)
1040 int *input_coords, *output_coords;
1045 for (i = 0; i < nb; i++) {
1047 input_coords + i *
n, 1, ranks[i],
1052 nb, input_coords, output_coords, verbose_level);
1054 for (i = 0; i < nb; i++) {
1056 output_coords + i *
n, 1, verbose_level - 1);
1064 int nb,
long int *input_ranks,
long int *output_ranks,
1067 int *input_coords, *output_coords;
1072 for (i = 0; i < nb; i++) {
1074 input_ranks[i], verbose_level - 1);
1078 nb, input_coords, output_coords, verbose_level);
1080 for (i = 0; i < nb; i++) {
1082 output_coords + i *
n, 1, verbose_level - 1);
1090 int nb,
int *input_coords,
int *output_coords,
1095 int *tmp_coords = NULL;
1099 if (pt_from == pt_to) {
1100 for (i = 0; i < nb *
n; i++) {
1101 output_coords[i] = input_coords[i];
1110 root =
find_root(pt_from, verbose_level - 2);
1117 T, tmp_coords, nb,
n,
n,
1119 input_coords2 = tmp_coords;
1122 input_coords2 = input_coords;
1125 root =
find_root(pt_to, verbose_level - 2);
1134 if (tmp_coords)
FREE_int(tmp_coords);
1142 int rk1, rk2, rk1_subspace, rk2_subspace, root, j, rk3, cnt, u, t2;
1145 cout << 0 <<
" : " << rk1 <<
" : ";
1151 cout << index <<
" : " << rk2 <<
" : ";
1158 cout <<
"rk1_subspace=" << rk1_subspace << endl;
1159 cout <<
"rk2_subspace=" << rk2_subspace << endl;
1162 rk2_subspace, verbose_level);
1164 rk1_subspace, rk2_subspace, root, verbose_level);
1166 cout <<
"Siegel map takes 1st point to" << endl;
1175 for (j = 0; j <
subspace->
P[t2 - 1]; j++) {
1177 cout <<
"f_even" << endl;
1187 cout <<
"error, u not zero" << endl;
1193 cout <<
"Siegel map takes 2nd point ";
1194 cout << cnt <<
" : " << j <<
" : " << rk3 <<
" : ";
a collection of combinatorial functions
void print_int_matrix(std::ostream &ost, int *A, int m, int n)
a collection of functions related to sorted vectors
int int_vec_compare(int *p, int *q, int len)
int frobenius_power(int a, int frob_power)
linear_algebra::linear_algebra * Linear_algebra
void Siegel_Transformation(int epsilon, int k, int form_c1, int form_c2, int form_c3, int *M, int *v, int *u, int verbose_level)
void transform_form_matrix(int *A, int *Gram, int *new_Gram, int d, int verbose_level)
void identity_matrix(int *A, int n)
void invert_matrix(int *A, int *A_inv, int n, int verbose_level)
void mult_matrix_matrix(int *A, int *B, int *C, int m, int n, int o, int verbose_level)
void mult_vector_from_the_right(int *A, int *v, int *Av, int m, int n)
int perp(int n, int k, int *A, int *Gram, int verbose_level)
int evaluate_quadratic_form(int n, int nb_terms, int *i, int *j, int *coeff, int *x)
int evaluate_bilinear_form(int n, int *v1, int *v2, int *Gram)
void Siegel_map_between_singular_points(int *T, long int rk_from, long int rk_to, long int root, int epsilon, int algebraic_dimension, int form_c1, int form_c2, int form_c3, int *Gram_matrix, int verbose_level)
void Gram_matrix(int epsilon, int k, int form_c1, int form_c2, int form_c3, int *&Gram, int verbose_level)
interface to system functions
int random_integer(int p)
long int rank_point(int *v, int stride, int verbose_level)
void Siegel_move_backward_by_index(long int rk1, long int rk2, int *w, int *v, int verbose_level)
field_theory::finite_field * F
void Siegel_move_forward_by_index(long int rk1, long int rk2, int *v, int *w, int verbose_level)
void test_Siegel(int index, int verbose_level)
void Siegel_Transformation3(int *T, int *from, int *to, int *root, int *B, int *Bv, int *w, int *z, int *x, int verbose_level)
void Siegel_Transformation(int *T, long int rk_from, long int rk_to, long int root, int verbose_level)
void random_generator_for_orthogonal_group(int f_action_is_semilinear, int f_siegel, int f_reflection, int f_similarity, int f_semisimilarity, int *Mtx, int verbose_level)
void unrank_point(int *v, int stride, long int rk, int verbose_level)
void move_points(long int pt_from, long int pt_to, int nb, int *input_coords, int *output_coords, int verbose_level)
void create_random_similarity(int *Mtx, int verbose_level)
void parabolic_neighbor51_odd_unrank(long int index, int *v, int verbose_level)
int find_root_hyperbolic(long int rk2, int m, int verbose_level)
void Siegel_map_between_singular_points_hyperbolic(int *T, long int rk_from, long int rk_to, long int root, int m, int verbose_level)
void create_random_semisimilarity(int *Mtx, int verbose_level)
void Siegel_move_backward(int *v1, int *v2, int *v3, int *v4, int verbose_level)
void Siegel_map_between_singular_points(int *T, long int rk_from, long int rk_to, long int root, int verbose_level)
void Siegel_Transformation2(int *T, long int rk_from, long int rk_to, long int root, int *B, int *Bv, int *w, int *z, int *x, int verbose_level)
void create_random_orthogonal_reflection(int *Mtx, int verbose_level)
int evaluate_bilinear_form(int *u, int *v, int stride)
long int type_and_index_to_point_rk(long int type, long int index, int verbose_level)
int evaluate_quadratic_form(int *v, int stride)
void make_Siegel_Transformation(int *M, int *v, int *u, int n, int *Gram, int verbose_level)
long int find_root(long int rk2, int verbose_level)
void move_points_by_ranks(long int pt_from, long int pt_to, int nb, long int *input_ranks, long int *output_ranks, int verbose_level)
void create_random_Siegel_transformation(int *Mtx, int verbose_level)
void Siegel_move_forward(int *v1, int *v2, int *v3, int *v4, int verbose_level)
void make_orthogonal_reflection(int *M, int *z, int verbose_level)
void move_points_by_ranks_in_place(long int pt_from, long int pt_to, int nb, long int *ranks, int verbose_level)
long int find_root_parabolic(long int rk2, int verbose_level)
#define Int_vec_print_integer_matrix(A, B, C, D)
#define Int_vec_print_integer_matrix_width(A, B, C, D, E, F)
#define Int_matrix_print(A, B, C)
#define Int_vec_print(A, B, C)
the orbiter library for the classification of combinatorial objects