19namespace layer1_foundations {
40 for (i = 0; i < len; i++) {
54 for (i = 0; i < len; i++) {
60 double c2,
double *v2,
double *v3,
int len)
64 for (i = 0; i < len; i++) {
65 v3[i] = c1 * v1[i] + c2 * v2[i];
70 double c1,
double *v1,
71 double c2,
double *v2,
72 double c3,
double *v3,
77 for (i = 0; i < len; i++) {
78 w[i] = c1 * v1[i] + c2 * v2[i] + c3 * v3[i];
86 for (i = 0; i < len; i++) {
95 for (i = 0; i < len; i++) {
104 for (i = 0; i < len; i++) {
110 int *base_cols,
int f_complete,
113 int f_v = (verbose_level >= 1);
114 int f_vv = (verbose_level >= 2);
115 int i, j, k, jj, rank;
116 double a, b, c, f, z;
117 double pivot, pivot_inv;
120 cout <<
"Gauss_elimination" << endl;
131 for (j = 0; j < n; j++) {
133 cout <<
"j=" << j << endl;
136 for (k = i; k < m; k++) {
139 cout <<
"i=" << i <<
" pivot found in "
140 << k <<
"," << j << endl;
144 for (jj = j; jj < n; jj++) {
146 A[i * n + jj] = A[k * n + jj];
156 cout <<
"no pivot found" << endl;
162 cout <<
"row " << i <<
" pivot in row " << k
163 <<
" colum " << j << endl;
171 pivot = A[i * n + j];
173 cout <<
"pivot=" << pivot << endl;
175 pivot_inv = 1. / pivot;
177 cout <<
"pivot=" << pivot <<
" pivot_inv="
178 << pivot_inv << endl;
181 for (jj = j; jj < n; jj++) {
182 A[i * n + jj] *= pivot_inv;
185 cout <<
"pivot=" << pivot <<
" pivot_inv=" << pivot_inv
186 <<
" made to one: " << A[i * n + j] << endl;
192 cout <<
"doing elimination in column " << j
193 <<
" from row " << i + 1 <<
" to row "
194 << m - 1 <<
":" << endl;
196 for (k = i + 1; k < m; k++) {
198 cout <<
"k=" << k << endl;
201 if (
ABS(z) < 0.00000001) {
208 cout <<
"eliminating row " << k << endl;
210 for (jj = j + 1; jj < n; jj++) {
220 cout << A[k * n + jj] <<
" ";
238 cout <<
"completing" << endl;
243 for (i = rank - 1; i >= 0; i--) {
247 for (k = i - 1; k >= 0; k--) {
253 for (jj = j + 1; jj < n; jj++) {
274 for (i = 0; i < m; i++) {
275 for (j = 0; j < n; j++) {
276 cout << A[i * n + j] <<
"\t";
283 int *base_cols,
int nb_base_cols,
284 int &kernel_m,
int &kernel_n,
290 int r, k, i, j, ii, iii, a, b;
294 if (kernel == NULL) {
295 cout <<
"get_kernel kernel == NULL" << endl;
314 for (i = 0; i < n; i++) {
330 cout <<
"get_kernel ii != k" << endl;
342 for (i = 0; i < n; i++) {
344 for (iii = 0; iii < k; iii++) {
346 kernel[i * kernel_n + iii] = M[j * n + a];
357 for (iii = 0; iii < k; iii++) {
359 kernel[i * kernel_n + iii] = m_one;
362 kernel[i * kernel_n + iii] = 0.;
376 int f_v = (verbose_level >= 1);
379 int kernel_m, kernel_n;
383 cout <<
"Null_space" << endl;
385 Ker =
new double [n * n];
393 kernel_m, kernel_n, Ker);
396 cout <<
"kernel_m != n" << endl;
400 for (i = 0; i < kernel_n; i++) {
401 for (j = 0; j < kernel_m; j++) {
402 K[i * n + j] = Ker[j * kernel_n + i];
410 cout <<
"Null_space done" << endl;
420 for (i = len - 1; i >= 0; i--) {
421 if (
ABS(v[i]) > 0.01) {
426 cout <<
"numerics::vec_normalize_from_back i < 0" << endl;
430 for (j = 0; j <= i; j++) {
440 for (i = len - 1; i >= 0; i--) {
441 if (
ABS(v[i]) > 0.01) {
446 cout <<
"numerics::vec_normalize_to_minus_one_from_back i < 0" << endl;
450 for (j = 0; j <= i; j++) {
459 double *abc3,
double *angles3,
double *T3,
462 int f_v = (verbose_level >= 1);
463 int f_vv = (verbose_level >= 2);
480 cout <<
"numerics::triangular_prism" << endl;
497 for (i = 0; i < 3; i++) {
500 for (i = 0; i < 3; i++) {
505 cout <<
"after translation:" << endl;
516 cout <<
"next, we make the y-coordinate of the first point "
517 "disappear by turning around the z-axis:" << endl;
521 cout <<
"phi=" <<
rad2deg(phi) << endl;
525 cout <<
"Rz=" << endl;
532 cout <<
"after rotation Rz by an angle of -1 * "
533 <<
rad2deg(phi) <<
":" << endl;
542 cout <<
"something is wrong in step 1, "
543 "the y-coordinate is too big" << endl;
549 cout <<
"next, we make the z-coordinate of the "
550 "first point disappear by turning around the y-axis:" << endl;
554 cout <<
"psi=" <<
rad2deg(psi) << endl;
559 cout <<
"Ry=" << endl;
566 cout <<
"after rotation Ry by an angle of "
567 <<
rad2deg(psi) <<
":" << endl;
576 cout <<
"something is wrong in step 2, "
577 "the z-coordinate is too big" << endl;
582 cout <<
"next, we move the plane determined by the second "
583 "point into the xz plane by turning around the x-axis:"
588 cout <<
"chi=" <<
rad2deg(chi) << endl;
593 cout <<
"Rx=" << endl;
600 cout <<
"after rotation Rx by an angle of "
601 <<
rad2deg(chi) <<
":" << endl;
610 cout <<
"something is wrong in step 3, "
611 "the y-coordinate is too big" << endl;
616 for (i = 0; i < 3; i++) {
626 cout <<
"numerics::triangular_prism done" << endl;
632 double *abc3,
double *angles3,
double *T3,
635 int f_v = (verbose_level >= 1);
636 int f_vv = (verbose_level >= 2);
642 double *P1, *P2, *P3;
658 cout <<
"general_prism" << endl;
664 Moved_pts1 =
new double[nb_pts * 3];
665 Moved_pts2 =
new double[nb_pts * 3];
666 Moved_pts3 =
new double[nb_pts * 3];
667 Moved_pts4 =
new double[nb_pts * 3];
682 for (h = 0; h < nb_pts; h++) {
683 for (i = 0; i < 3; i++) {
684 Moved_pts1[h * 3 + i] = Pts[h * 3 + i] - T[i];
688 for (i = 0; i < 3; i++) {
691 for (i = 0; i < 3; i++) {
696 cout <<
"after translation:" << endl;
707 cout <<
"next, we make the y-coordinate of the first point "
708 "disappear by turning around the z-axis:" << endl;
712 cout <<
"phi=" <<
rad2deg(phi) << endl;
716 cout <<
"Rz=" << endl;
722 for (h = 0; h < nb_pts; h++) {
723 mult_matrix(Moved_pts1 + h * 3, Rz, Moved_pts2 + h * 3);
726 cout <<
"after rotation Rz by an angle of -1 * "
727 <<
rad2deg(phi) <<
":" << endl;
736 cout <<
"something is wrong in step 1, the y-coordinate "
737 "is too big" << endl;
743 cout <<
"next, we make the z-coordinate of the first "
744 "point disappear by turning around the y-axis:" << endl;
748 cout <<
"psi=" <<
rad2deg(psi) << endl;
753 cout <<
"Ry=" << endl;
759 for (h = 0; h < nb_pts; h++) {
760 mult_matrix(Moved_pts2 + h * 3, Ry, Moved_pts3 + h * 3);
763 cout <<
"after rotation Ry by an angle of "
764 <<
rad2deg(psi) <<
":" << endl;
773 cout <<
"something is wrong in step 2, the z-coordinate "
774 "is too big" << endl;
779 cout <<
"next, we move the plane determined by the second "
780 "point into the xz plane by turning around the x-axis:"
785 cout <<
"chi=" <<
rad2deg(chi) << endl;
790 cout <<
"Rx=" << endl;
796 for (h = 0; h < nb_pts; h++) {
797 mult_matrix(Moved_pts3 + h * 3, Rx, Moved_pts4 + h * 3);
800 cout <<
"after rotation Rx by an angle of "
801 <<
rad2deg(chi) <<
":" << endl;
810 cout <<
"something is wrong in step 3, the y-coordinate "
811 "is too big" << endl;
816 for (i = 0; i < 3; i++) {
825 for (h = 0; h < nb_pts; h++) {
826 Pts_xy[2 * h + 0] = Moved_pts4[h * 3 + 0];
827 Pts_xy[2 * h + 1] = Moved_pts4[h * 3 + 2];
830 delete [] Moved_pts1;
831 delete [] Moved_pts2;
832 delete [] Moved_pts3;
833 delete [] Moved_pts4;
836 cout <<
"numerics::general_prism done" << endl;
846 for (j = 0; j < 3; j++) {
848 for (i = 0; i < 3; i++) {
849 c += v[i] * R[i * 3 + j];
856 double *A,
double *B,
double *C,
int m,
int n,
int o)
862 for (i = 0; i < m; i++) {
863 for (j = 0; j < o; j++) {
865 for (h = 0; h < n; h++) {
866 c += A[i * n + h] * B[h * o + j];
877 for (i = 0; i < 3; i++) {
878 for (j = 0; j < 3; j++) {
879 cout << R[i * 3 + j] <<
" ";
892 for (i = 0; i < 9; i++) {
898 R[1 * 3 + 0] = -1. * s;
909 for (i = 0; i < 9; i++) {
915 R[0 * 3 + 2] = -1 * s;
927 for (i = 0; i < 9; i++) {
934 R[2 * 3 + 1] = -1 * s;
943 if (
ABS(x) < 0.00001) {
955 phi = atan(y / x) +
M_PI;
971 for (i = 0; i < len; i++) {
979 n[0] = u[1] * v[2] - v[1] * u[2];
980 n[1] = u[2] * v[0] - u[0] * v[2];
981 n[2] = u[0] * v[1] - u[1] * v[0];
990 for (i = 0; i < len; i++) {
1002 d = sqrt(x1 * x1 + x2 * x2 + x3 * x3);
1012 for (i = 0; i < len; i++) {
1024 if (
ABS(d) < 0.00001) {
1025 cout <<
"make_unit_vector ABS(d) < 0.00001" << endl;
1033 int *Pt_idx,
int nb_pts,
double *c)
1038 for (i = 0; i < len; i++) {
1041 for (h = 0; h < nb_pts; h++) {
1043 for (i = 0; i < len; i++) {
1044 c[i] += Pts[idx * len + i];
1052 double *p1,
double *p2,
double *p3,
1053 double *n,
double &d)
1064 cout <<
"u=" << endl;
1067 cout <<
"v=" << endl;
1075 cout <<
"n=" << endl;
1081 if (
ABS(a) < 0.00001) {
1082 cout <<
"plane_through_three_points ABS(a) < 0.00001" << endl;
1086 for (i = 0; i < 3; i++) {
1091 cout <<
"n unit=" << endl;
1101 double *A,
double *Av,
int verbose_level)
1103 int f_v = (verbose_level >= 1);
1108 cout <<
"numerics::orthogonal_transformation_from_point_"
1109 "to_basis_vector" << endl;
1114 for (i = 0; i < 3; i++) {
1115 if (
ABS(Av[i]) > a) {
1121 cout <<
"i0 == -1" << endl;
1133 for (i = 0; i < 3; i++) {
1136 Av[3 + i1] = -Av[i0];
1137 Av[3 + i0] = Av[i1];
1141 if (
ABS(d) > 0.01) {
1142 cout <<
"dot product between first and second "
1143 "row of Av is not zero" << endl;
1148 if (
ABS(d) > 0.01) {
1149 cout <<
"dot product between first and third "
1150 "row of Av is not zero" << endl;
1154 if (
ABS(d) > 0.01) {
1155 cout <<
"dot product between second and third "
1156 "row of Av is not zero" << endl;
1165 for (i = 0; i < 3; i++) {
1166 for (j = 0; j < 3; j++) {
1167 A[j * 3 + i] = Av[i * 3 + j];
1172 cout <<
"numerics::orthogonal_transformation_from_point_"
1173 "to_basis_vector done" << endl;
1179 if (
ABS(a) < 0.0001) {
1192 for (j = 0; j < 4; j++) {
1194 for (i = 0; i < 4; i++) {
1195 c += v[i] * R[i * 4 + j];
1206 for (i = 0; i < 4; i++) {
1207 for (j = 0; j < 4; j++) {
1208 At[i * 4 + j] = A[j * 4 + i];
1217 for (i = 0; i < n; i++) {
1218 for (j = 0; j < n; j++) {
1219 At[i * n + j] = A[j * n + i];
1225 double *coeff_in,
double *coeff_out,
1226 double *A4_inv,
int verbose_level)
1239 int f_v = (verbose_level >= 1);
1252 int Affine_to_monomial[16];
1254 int nb_monomials = 10;
1260 int h, i, j, a, nb_affine, idx;
1268 cout <<
"substitute_quadric_linear" << endl;
1273 for (i = 0; i < nb_affine; i++) {
1276 for (j = 0; j < degree; j++) {
1280 for (idx = 0; idx < 10; idx++) {
1286 cout <<
"could not determine Affine_to_monomial" << endl;
1289 Affine_to_monomial[i] = idx;
1293 for (i = 0; i < nb_monomials; i++) {
1296 for (h = 0; h < nb_monomials; h++) {
1302 V = Variables + h * degree;
1309 for (i = 0; i < nb_monomials; i++) {
1312 for (a = 0; a < nb_affine; a++) {
1318 for (j = 0; j < degree; j++) {
1320 b *= A4_inv[A[j] * n + V[j]];
1322 idx = Affine_to_monomial[a];
1326 for (j = 0; j < nb_monomials; j++) {
1330 for (j = 0; j < nb_monomials; j++) {
1331 coeff3[j] += coeff2[j];
1335 for (j = 0; j < nb_monomials; j++) {
1336 coeff_out[j] = coeff3[j];
1341 cout <<
"substitute_quadric_linear done" << endl;
1346 double *coeff_in,
double *coeff_out,
1347 double *A4_inv,
int verbose_level)
1371 int f_v = (verbose_level >= 1);
1395 int Affine_to_monomial[64];
1397 int nb_monomials = 20;
1403 int h, i, j, a, nb_affine, idx;
1411 cout <<
"numerics::substitute_cubic_linear_using_povray_ordering" << endl;
1418 cout <<
"Variables:" << endl;
1421 Monomials =
NEW_int(nb_monomials * n);
1423 for (i = 0; i < nb_monomials; i++) {
1424 for (j = 0; j < degree; j++) {
1425 a = Variables[i * degree + j];
1426 Monomials[i * n + a]++;
1430 cout <<
"Monomials:" << endl;
1434 for (i = 0; i < nb_affine; i++) {
1437 for (j = 0; j < degree; j++) {
1441 for (idx = 0; idx < nb_monomials; idx++) {
1446 if (idx == nb_monomials) {
1447 cout <<
"could not determine Affine_to_monomial" << endl;
1448 cout <<
"Monomials:" << endl;
1454 Affine_to_monomial[i] = idx;
1458 cout <<
"Affine_to_monomial:";
1464 for (i = 0; i < nb_monomials; i++) {
1467 for (h = 0; h < nb_monomials; h++) {
1473 V = Variables + h * degree;
1480 for (i = 0; i < nb_monomials; i++) {
1483 for (a = 0; a < nb_affine; a++) {
1489 for (j = 0; j < degree; j++) {
1491 b *= A4_inv[A[j] * n + V[j]];
1493 idx = Affine_to_monomial[a];
1497 for (j = 0; j < nb_monomials; j++) {
1501 for (j = 0; j < nb_monomials; j++) {
1502 coeff3[j] += coeff2[j];
1506 for (j = 0; j < nb_monomials; j++) {
1507 coeff_out[j] = coeff3[j];
1513 cout <<
"numerics::substitute_cubic_linear_using_povray_ordering done" << endl;
1518 double *coeff_in,
double *coeff_out,
1519 double *A4_inv,
int verbose_level)
1558 int f_v = (verbose_level >= 1);
1601 int Affine_to_monomial[256];
1603 int nb_monomials = 35;
1609 int h, i, j, a, nb_affine, idx;
1617 cout <<
"numerics::substitute_quartic_linear_using_povray_ordering" << endl;
1624 cout <<
"Variables:" << endl;
1627 Monomials =
NEW_int(nb_monomials * n);
1629 for (i = 0; i < nb_monomials; i++) {
1630 for (j = 0; j < degree; j++) {
1631 a = Variables[i * degree + j];
1632 Monomials[i * n + a]++;
1636 cout <<
"Monomials:" << endl;
1640 for (i = 0; i < nb_affine; i++) {
1643 for (j = 0; j < degree; j++) {
1647 for (idx = 0; idx < nb_monomials; idx++) {
1652 if (idx == nb_monomials) {
1653 cout <<
"could not determine Affine_to_monomial" << endl;
1654 cout <<
"Monomials:" << endl;
1660 Affine_to_monomial[i] = idx;
1664 cout <<
"Affine_to_monomial:";
1670 for (i = 0; i < nb_monomials; i++) {
1673 for (h = 0; h < nb_monomials; h++) {
1679 V = Variables + h * degree;
1686 for (i = 0; i < nb_monomials; i++) {
1689 for (a = 0; a < nb_affine; a++) {
1695 for (j = 0; j < degree; j++) {
1697 b *= A4_inv[A[j] * n + V[j]];
1699 idx = Affine_to_monomial[a];
1703 for (j = 0; j < nb_monomials; j++) {
1707 for (j = 0; j < nb_monomials; j++) {
1708 coeff3[j] += coeff2[j];
1712 for (j = 0; j < nb_monomials; j++) {
1713 coeff_out[j] = coeff3[j];
1719 cout <<
"numerics::substitute_quartic_linear_using_povray_ordering done" << endl;
1724 double *u,
double *A,
double *Av,
1730 int f_v = (verbose_level >= 1);
1734 cout <<
"make_transform_t_varphi_u_double" << endl;
1736 for (i = 0; i < n; i++) {
1737 for (j = 0; j < n; j++) {
1739 A[i * n + j] = 1. + varphi[i] * u[j];
1742 A[i * n + j] = varphi[i] * u[j];
1748 cout <<
"make_transform_t_varphi_u_double done" << endl;
1755 int f_v = (verbose_level >= 1);
1758 int i, j, two_n, rk;
1761 cout <<
"matrix_double_inverse" << endl;
1764 M =
new double [n * n * 2];
1767 for (i = 0; i < n; i++) {
1768 for (j = 0; j < n; j++) {
1769 M[i * two_n + j] = A[i * n + j];
1771 M[i * two_n + n + j] = 1.;
1774 M[i * two_n + n + j] = 0.;
1781 cout <<
"matrix_double_inverse the matrix "
1782 "is not invertible" << endl;
1785 if (base_cols[n - 1] != n - 1) {
1786 cout <<
"matrix_double_inverse the matrix "
1787 "is not invertible" << endl;
1790 for (i = 0; i < n; i++) {
1791 for (j = 0; j < n; j++) {
1792 Av[i * n + j] = M[i * two_n + n + j];
1799 cout <<
"matrix_double_inverse done" << endl;
1805 double *pt1_out,
double *pt2_out,
double r,
int verbose_level)
1809 double x1, x2, x3, y1, y2, y3;
1810 double a, b, c, av, d, e;
1811 double lambda1, lambda2;
1815 cout <<
"numerics::line_centered" << endl;
1816 cout <<
"r=" << r << endl;
1847 a = v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
1848 b = 2. * (x1 * v[0] + x2 * v[1] + x3 * v[2]);
1849 c = x1 * x1 + x2 * x2 + x3 * x3 - r * r;
1851 cout <<
"a=" << a <<
" b=" << b <<
" c=" << c << endl;
1856 d = b * b * 0.25 - c;
1858 cout <<
"a=" << a <<
" b=" << b <<
" c=" << c <<
" d=" << d << endl;
1861 cout <<
"line_centered d < 0" << endl;
1862 cout <<
"r=" << r << endl;
1863 cout <<
"d=" << d << endl;
1864 cout <<
"a=" << a << endl;
1865 cout <<
"b=" << b << endl;
1866 cout <<
"c=" << c << endl;
1882 lambda1 = -b * 0.5 + e;
1883 lambda2 = -b * 0.5 - e;
1884 pt1_out[0] = x1 + lambda1 * v[0];
1885 pt1_out[1] = x2 + lambda1 * v[1];
1886 pt1_out[2] = x3 + lambda1 * v[2];
1887 pt2_out[0] = x1 + lambda2 * v[0];
1888 pt2_out[1] = x2 + lambda2 * v[1];
1889 pt2_out[2] = x3 + lambda2 * v[2];
1891 cout <<
"numerics::line_centered done" << endl;
1897 double *pt1_out,
double *pt2_out,
double r,
int verbose_level)
1899 int f_v = (verbose_level >= 1);
1901 double x1, x2, x3, y1, y2, y3;
1902 double a, b, c, av, d, e;
1903 double lambda1, lambda2;
1907 cout <<
"numerics::line_centered_tolerant" << endl;
1908 cout <<
"r=" << r << endl;
1939 a = v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
1940 b = 2. * (x1 * v[0] + x2 * v[1] + x3 * v[2]);
1941 c = x1 * x1 + x2 * x2 + x3 * x3 - r * r;
1943 cout <<
"a=" << a <<
" b=" << b <<
" c=" << c << endl;
1948 d = b * b * 0.25 - c;
1950 cout <<
"a=" << a <<
" b=" << b <<
" c=" << c <<
" d=" << d << endl;
1953 cout <<
"line_centered d < 0" << endl;
1954 cout <<
"r=" << r << endl;
1955 cout <<
"d=" << d << endl;
1956 cout <<
"a=" << a << endl;
1957 cout <<
"b=" << b << endl;
1958 cout <<
"c=" << c << endl;
1972 lambda1 = -b * 0.5 + e;
1973 lambda2 = -b * 0.5 - e;
1974 pt1_out[0] = x1 + lambda1 * v[0];
1975 pt1_out[1] = x2 + lambda1 * v[1];
1976 pt1_out[2] = x3 + lambda1 * v[2];
1977 pt2_out[0] = x1 + lambda2 * v[0];
1978 pt2_out[1] = x2 + lambda2 * v[1];
1979 pt2_out[2] = x3 + lambda2 * v[2];
1981 cout <<
"numerics::line_centered_tolerant done" << endl;
2006 int f_v = (verbose_level >= 1);
2010 cout <<
"eigenvalues" << endl;
2018 for (i = 0; i < n; i++) {
2019 for (j = 0; j < n; j++) {
2020 P[i * n + j].
init(n + 1);
2022 P[i * n + j].
coeff[0] = A[i * n + j];
2023 P[i * n + j].
coeff[1] = -1.;
2027 P[i * n + j].
coeff[0] = A[i * n + j];
2032 for (i = 0; i < n; i++) {
2033 for (j = 0; j < n; j++) {
2034 P[i * n + j].
print(cout);
2047 cout <<
"characteristic polynomial ";
2056 lambda, verbose_level);
2060 for (i = 0; i < n; i++) {
2061 for (j = i + 1; j < n; j++) {
2062 if (lambda[i] > lambda[j]) {
2066 lambda[i] = lambda[j];
2072 cout <<
"The eigenvalues are: ";
2073 for (i = 0; i < n; i++) {
2083 cout <<
"eigenvalues done" << endl;
2088 int n,
double *lambda,
int verbose_level)
2090 int f_v = (verbose_level >= 1);
2094 cout <<
"eigenvectors" << endl;
2097 cout <<
"The eigenvalues are: ";
2098 for (i = 0; i < n; i++) {
2109 B =
new double[n * n];
2110 K =
new double[n * n];
2112 for (h = 0; h < n; ) {
2113 cout <<
"eigenvector " << h <<
" / " << n <<
" is " << lambda[h] <<
":" << endl;
2114 for (i = 0; i < n; i++) {
2115 for (j = 0; j < n; j++) {
2117 B[i * n + j] = A[i * n + j] - lambda[h];
2120 B[i * n + j] = A[i * n + j];
2127 cout <<
"the eigenvalue has multiplicity " << k << endl;
2128 for (u = 0; u < k; u++) {
2129 for (j = 0; j < n; j++) {
2130 Basis[j * n + h + u] = K[u * n + j];
2134 for (v = 0; v < u; v++) {
2136 for (i = 0; i < n; i++) {
2137 uv += Basis[i * n + h + u] * Basis[i * n + h + v];
2140 for (i = 0; i < n; i++) {
2141 vv += Basis[i * n + h + v] * Basis[i * n + h + v];
2144 for (i = 0; i < n; i++) {
2145 Basis[i * n + h + u] -= s * Basis[i * n + h + v];
2151 for (v = 0; v < k; v++) {
2153 for (i = 0; i < n; i++) {
2154 vv += Basis[i * n + h + v] * Basis[i * n + h + v];
2157 for (i = 0; i < n; i++) {
2158 Basis[i * n + h + v] *= s;
2164 cout <<
"The orthonormal Basis is: " << endl;
2165 for (i = 0; i < n; i++) {
2166 for (j = 0; j < n; j++) {
2167 cout << Basis[i * n + j] <<
"\t";
2173 cout <<
"eigenvectors done" << endl;
2179 return phi * 180. /
M_PI;
2187 for (p = from, q = to, i = 0; i < len; p++, q++, i++) {
2198 for (p = from, q = to, i = 0; i < len; p++, q++, i++) {
2210 for (i = 0; i < len; i++) {
2221 istringstream ins(s);
2228 istringstream ins(s);
2234 int verbose_level = 0;
2235 int f_v = (verbose_level >= 1);
2241 v =
new double [len];
2266 cout <<
"character \"" << c
2267 <<
"\", ascii=" << (int)c << endl;
2280 else if ((c >=
'0' && c <=
'9') || c ==
'.') {
2301 sscanf(s,
"%lf", &a);
2304 cout <<
"digit as string: " << s <<
", numeric: " << a << endl;
2310 v2 =
new double [len];
2347 x = (phi *
M_PI) / 180.;
2355 x = (phi *
M_PI) / 180.;
2363 x = (phi *
M_PI) / 180.;
2372 phi = (y * 180.) /
M_PI;
2377 double *Px,
double *Py,
2379 int N,
double xmin,
double ymin,
double xmax,
double ymax,
2382 int f_v = (verbose_level >= 1);
2383 int f_vv = (verbose_level >= 2);
2384 double in[4], out[4];
2385 double x_min, x_max;
2386 double y_min, y_max;
2390 x_min = x_max = Px[0];
2391 y_min = y_max = Py[0];
2393 for (i = 1; i < N; i++) {
2394 x_min =
MINIMUM(x_min, Px[i]);
2395 x_max =
MAXIMUM(x_max, Px[i]);
2396 y_min =
MINIMUM(y_min, Py[i]);
2397 y_max =
MAXIMUM(y_max, Py[i]);
2400 cout <<
"numerics::adjust_coordinates_double: x_min=" << x_min
2401 <<
"x_max=" << x_max
2402 <<
"y_min=" << y_min
2403 <<
"y_max=" << y_max << endl;
2404 cout <<
"adjust_coordinates_double: ";
2423 for (i = 0; i < N; i++) {
2427 cout <<
"In:" << x <<
"," << y <<
" : ";
2433 cout <<
" Out: " << Qx[i] <<
"," << Qy[i] << endl;
2439 double *a,
double *b,
double *c,
int l1,
int l2,
int pt)
2442 a[l1], b[l1], c[l1],
2443 a[l2], b[l2], c[l2],
2448 double a1,
double b1,
double c1,
2449 double a2,
double b2,
double c2,
2450 double &x,
double &y)
2454 d = a1 * b2 - a2 * b1;
2456 x = d * (b2 * -c1 + -b1 * -c2);
2457 y = d * (-a2 * -c1 + a1 * -c2);
2461 double *a,
double *b,
double *c,
2462 int pt1,
int pt2,
int line_idx)
2465 a[line_idx], b[line_idx], c[line_idx]);
2469 double pt2_x,
double pt2_y,
double &a,
double &b,
double &c)
2472 const double MY_EPS = 0.01;
2474 if (
ABS(pt2_x - pt1_x) > MY_EPS) {
2475 s = (pt2_y - pt1_y) / (pt2_x - pt1_x);
2476 off = pt1_y - s * pt1_x;
2482 s = (pt2_x - pt1_x) / (pt2_y - pt1_y);
2483 off = pt1_x - s * pt1_y;
2491 double pt1_x,
double pt1_y,
2492 double pt2_x,
double pt2_y,
2493 double &x1,
double &y1,
double &x2,
double &y2)
2510 double a,
double b,
double c,
2511 double &x1,
double &y1,
double &x2,
double &y2)
2517 double x02 = x0 * x0;
2518 double y02 = y0 * y0;
2519 double r2 = rad * rad;
2520 double p, q, u, disc, d;
2522 cout <<
"a=" << a <<
" b=" << b <<
" c=" << c << endl;
2524 B = 2 * a * c / b2 - 2 * x0 + 2 * a * y0 / b;
2525 C = c2 / b2 + 2 * c * y0 / b + x02 + y02 - r2;
2526 cout <<
"A=" << A <<
" B=" << B <<
" C=" << C << endl;
2534 y1 = (-a * x1 - c) / b;
2535 y2 = (-a * x2 - c) / b;
2539 int pt0,
int pt1,
int pt2,
double alpha,
int new_pt)
2543 X[new_pt] = X[pt0] + alpha * (X[pt2] - X[pt1]);
2544 Y[new_pt] = Y[pt0] + alpha * (Y[pt2] - Y[pt1]);
2549 int idx,
double angle_in_degree,
double rad)
2552 Px[idx] =
cos_grad(angle_in_degree) * rad;
2553 Py[idx] =
sin_grad(angle_in_degree) * rad;
2557 int p0,
int p1,
int p2,
double f1,
int p3)
2559 int x = Px[p0] + (int)(f1 * (
double)(Px[p2] - Px[p1]));
2560 int y = Py[p0] + (int)(f1 * (
double)(Py[p2] - Py[p1]));
2566 int p0,
int p1,
int p1b,
2567 double f1,
int p2,
int p2b,
double f2,
int p3)
2570 + (int)(f1 * (
double)(Px[p1b] - Px[p1]))
2571 + (int)(f2 * (
double)(Px[p2b] - Px[p2]));
2573 + (int)(f1 * (
double)(Py[p1b] - Py[p1]))
2574 + (int)(f2 * (
double)(Py[p2b] - Py[p2]));
2582 return sqrt((
double)(x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
2585#undef DEBUG_TRANSFORM_LLUR
2592#ifdef DEBUG_TRANSFORM_LLUR
2593 cout <<
"transform_llur: ";
2594 cout <<
"In=" << in[0] <<
"," << in[1] <<
"," << in[2] <<
"," << in[3] << endl;
2595 cout <<
"Out=" << out[0] <<
"," << out[1] <<
"," << out[2] <<
"," << out[3] << endl;
2600 a = (double) dx / (
double)(in[2] - in[0]);
2601 b = (double) dy / (
double)(in[3] - in[1]);
2604#ifdef DEBUG_TRANSFORM_LLUR
2605 cout <<
"transform_llur: (x,y)=(" << x <<
"," << y <<
") in[2] - in[0]=" << in[2] - in[0] <<
" in[3] - in[1]=" << in[3] - in[1] <<
" (a,b)=(" << a <<
"," << b <<
") -> ";
2610#ifdef DEBUG_TRANSFORM_LLUR
2611 cout <<
"f=" << f << endl;
2618 dx = (int)(a * (
double)(out[2] - out[0]));
2619 dy = (int)(b * (
double)(out[3] - out[1]));
2622#ifdef DEBUG_TRANSFORM_LLUR
2623 cout << x <<
"," << y <<
" a=" << a <<
" b=" << b << endl;
2632 a = (double) x / (
double)(in[2] - in[0]);
2633 b = (double) y / (
double)(in[3] - in[1]);
2634 dx = (int)(a * (
double) (out[2] - out[0]));
2635 dy = (int)(b * (
double) (out[3] - out[1]));
2645 a = (double) x / (
double)(in[2] - in[0]);
2646 dx = (int)(a * (
double) (out[2] - out[0]));
2655 b = (double) y / (
double)(in[3] - in[1]);
2656 dy = (int)(b * (
double) (out[3] - out[1]));
2665#ifdef DEBUG_TRANSFORM_LLUR
2666 cout <<
"transform_llur_double: " << x <<
"," << y <<
" -> ";
2670 a = dx / (in[2] - in[0]);
2671 b = dy / (in[3] - in[1]);
2672 dx = a * (out[2] - out[0]);
2673 dy = b * (out[3] - out[1]);
2676#ifdef DEBUG_TRANSFORM_LLUR
2677 cout << x <<
"," << y << endl;
2684 int idx,
int angle_in_degree,
int rad)
2686 Px[idx] = (int)(
cos_grad(angle_in_degree) * (double) rad);
2687 Py[idx] = (int)(
sin_grad(angle_in_degree) * (double) rad);
2714 double q, P, Q, PQ, c;
2723 c = (double) nCk * PQ;
2728 double *triangle_points,
double &x,
double &y,
2731 int f_v = (verbose_level >= 1);
2736 cout <<
"numerics::local_coordinates_wrt_triangle" << endl;
2739 -1, triangle_points + 0 * 3, b1, 3);
2742 -1, triangle_points + 0 * 3, b2, 3);
2745 cout <<
"numerics::local_coordinates_wrt_triangle b1:" << endl;
2748 cout <<
"numerics::local_coordinates_wrt_triangle b2:" << endl;
2754 double system_transposed[9];
2761 -1, triangle_points + 0 * 3, system + 6, 3);
2764 cout <<
"system (transposed):" << endl;
2768 rk =
Null_space(system_transposed, 3, 3, K, 0 );
2770 cout <<
"system transposed in RREF" << endl;
2773 cout <<
"K=" << endl;
2779 cout <<
"numerics::local_coordinates_wrt_triangle rk != 1" << endl;
2784 cout <<
"numerics::local_coordinates_wrt_triangle ABS(K[2]) < EPSILON" << endl;
2805 cout <<
"numerics::local_coordinates_wrt_triangle done" << endl;
2812 double *line1_pt1_coords,
double *line1_pt2_coords,
2813 double *line2_pt1_coords,
double *line2_pt2_coords,
2818 int f_v = (verbose_level >= 1);
2827 cout <<
"numerics::intersect_line_and_line" << endl;
2844 M[0 * 3 + 2] = -1. * line1_pt1_coords[0];
2845 M[1 * 3 + 2] = -1. * line1_pt1_coords[1];
2846 M[2 * 3 + 2] = -1. * line1_pt1_coords[2];
2848 M[0 * 3 + 2] += line2_pt1_coords[0];
2849 M[1 * 3 + 2] += line2_pt1_coords[1];
2850 M[2 * 3 + 2] += line2_pt1_coords[2];
2853 for (i = 0; i < 3; i++) {
2854 v[i] = line1_pt2_coords[i] - line1_pt1_coords[i];
2857 for (i = 0; i < 3; i++) {
2861 M[i * 3 + 0] = v[i];
2865 for (i = 0; i < 3; i++) {
2866 M[i * 3 + 1] = -1. * (line2_pt2_coords[i] - line2_pt1_coords[i]);
2877 cout <<
"numerics::intersect_line_and_line "
2878 "before Gauss elimination:" << endl;
2887 cout <<
"numerics::intersect_line_and_line "
2888 "after Gauss elimination:" << endl;
2894 cout <<
"numerics::intersect_line_and_line "
2895 "the matrix M does not have full rank" << endl;
2898 lambda = M[0 * 3 + 2];
2899 for (i = 0; i < 3; i++) {
2900 pt_coords[i] = line1_pt1_coords[i] + lambda * v[i];
2905 cout <<
"numerics::intersect_line_and_line "
2906 "The intersection point is "
2907 << pt_coords[0] <<
", " << pt_coords[1] <<
", " << pt_coords[2] << endl;
2913 cout <<
"numerics::intersect_line_and_line done" << endl;
2919 double *line1_pt1_coords,
double *line1_pt2_coords,
2920 double *line2_pt1_coords,
double *line2_pt2_coords,
2921 double *pt_in,
double *pt_out,
2922 double *Cubic_coords_povray_ordering,
2923 int line1_idx,
int line2_idx,
2926 int f_v = (verbose_level >= 1);
2938 cout <<
"numerics::clebsch_map_up "
2939 "line1_idx=" << line1_idx
2940 <<
" line2_idx=" << line2_idx << endl;
2943 if (line1_idx == line2_idx) {
2944 cout <<
"numerics::clebsch_map_up "
2945 "line1_idx == line2_idx, line1_idx=" << line1_idx << endl;
2949 Num.
vec_copy(line1_pt1_coords, M, 3);
2951 Num.
vec_copy(line1_pt2_coords, M + 4, 3);
2957 cout <<
"numerics::clebsch_map_up "
2958 "system for plane 1=" << endl;
2964 cout <<
"numerics::clebsch_map_up "
2965 "system for plane 1 does not have nullity 1" << endl;
2966 cout <<
"numerics::clebsch_map_up "
2967 "nullity=" << rk << endl;
2971 cout <<
"numerics::clebsch_map_up "
2972 "perp for plane 1=" << endl;
2976 Num.
vec_copy(line2_pt1_coords, M, 3);
2978 Num.
vec_copy(line2_pt2_coords, M + 4, 3);
2983 cout <<
"numerics::clebsch_map_up "
2984 "system for plane 2=" << endl;
2990 cout <<
"numerics::clebsch_map_up "
2991 "system for plane 2 does not have nullity 1" << endl;
2992 cout <<
"numerics::clebsch_map_up "
2993 "nullity=" << rk << endl;
2997 cout <<
"numerics::clebsch_map_up "
2998 "perp for plane 2=" << endl;
3003 cout <<
"numerics::clebsch_map_up "
3004 "system for line=" << endl;
3009 cout <<
"numerics::clebsch_map_up "
3010 "system for line does not have nullity 2" << endl;
3011 cout <<
"numerics::clebsch_map_up "
3012 "nullity=" << rk << endl;
3016 cout <<
"numerics::clebsch_map_up "
3017 "perp for Line=" << endl;
3024 cout <<
"numerics::clebsch_map_up "
3025 "perp for Line normalized=" << endl;
3029 if (
ABS(L[11]) < 0.0001) {
3031 Num.
vec_add(L + 8, L + 12, Pts + 4, 4);
3034 cout <<
"numerics::clebsch_map_up "
3035 "two affine points on the line=" << endl;
3041 cout <<
"numerics::clebsch_map_up "
3042 "something is wrong with the line" << endl;
3047 Num.
line_centered(Pts, Pts + 4, N, N + 4, 10, verbose_level - 1);
3052 cout <<
"numerics::clebsch_map_up "
3053 "line centered=" << endl;
3058 double line3_pt1_coords[3];
3059 double line3_pt2_coords[3];
3064 for (i = 0; i < 3; i++) {
3065 line3_pt1_coords[i] = N[i];
3067 for (i = 0; i < 3; i++) {
3068 line3_pt2_coords[i] = N[4 + i];
3071 for (i = 0; i < 3; i++) {
3072 N[4 + i] = N[4 + i] - N[i];
3074 for (i = 8; i < 16; i++) {
3079 cout <<
"N=" << endl;
3088 cout <<
"numerics::clebsch_map_up "
3089 "transformed cubic=" << endl;
3093 double a, b, c, d, tr, t1, t2, t3;
3104 cout <<
"numerics::clebsch_map_up "
3105 "a=" << a <<
" b=" << b
3106 <<
" c=" << c <<
" d=" << d << endl;
3107 cout <<
"clebsch_scene::create_point_up "
3108 "tr = " << tr << endl;
3111 double pt1_coords[3];
3112 double pt2_coords[3];
3116 line3_pt1_coords, line3_pt2_coords,
3117 line1_pt1_coords, line1_pt2_coords,
3121 cout <<
"numerics::clebsch_map_up "
3122 "problem computing intersection with line 1" << endl;
3128 for (i = 0; i < 3; i++) {
3129 P1[i] = N[i] + t1 * (N[4 + i] - N[i]);
3133 cout <<
"numerics::clebsch_map_up t1=" << t1 << endl;
3134 cout <<
"numerics::clebsch_map_up P1=";
3136 cout <<
"numerics::clebsch_map_up point: ";
3143 eval_t1 = (((a * t1 + b) * t1) + c) * t1 + d;
3146 cout <<
"numerics::clebsch_map_up "
3147 "eval_t1=" << eval_t1 << endl;
3152 line3_pt1_coords, line3_pt2_coords,
3153 line1_pt2_coords, line2_pt2_coords,
3157 cout <<
"numerics::clebsch_map_up "
3158 "problem computing intersection with line 2" << endl;
3164 for (i = 0; i < 3; i++) {
3165 P2[i] = N[i] + t2 * (N[4 + i] - N[i]);
3168 cout <<
"numerics::clebsch_map_up t2=" << t2 << endl;
3169 cout <<
"numerics::clebsch_map_up P2=";
3171 cout <<
"numerics::clebsch_map_up point: ";
3178 eval_t2 = (((a * t2 + b) * t2) + c) * t2 + d;
3181 cout <<
"numerics::clebsch_map_up "
3182 "eval_t2=" << eval_t2 << endl;
3192 eval_t3 = (((a * t3 + b) * t3) + c) * t3 + d;
3195 cout <<
"numerics::clebsch_map_up "
3196 "eval_t3=" << eval_t3 << endl;
3202 cout <<
"numerics::clebsch_map_up "
3203 "tr=" << tr <<
" t1=" << t1
3204 <<
" t2=" << t2 <<
" t3=" << t3 << endl;
3209 for (i = 0; i < 3; i++) {
3210 Q[i] = N[i] + t3 * N[4 + i];
3214 cout <<
"numerics::clebsch_map_up Q=";
3226 cout <<
"numerics::clebsch_map_up done" << endl;
3232 double rad,
double height,
double x,
double y,
double &xp,
double &yp)
3237 double x1, y1, d0, d1;
3238 f = rad / sqrt(height * height + x * x + y * y);
3241 d1 = (double) step / (
double) nb_steps;
3243 xp = x * d0 + x1 * d1;
3244 yp = y * d0 + y1 * d1;
3246 else if (f_projection_on) {
3247 f = rad / sqrt(height * height + x * x + y * y);
a collection of combinatorial functions
long int int_n_choose_k(int n, int k)
void matrix_print(int *p, int m, int n)
a collection of functions related to sorted vectors
int int_vec_compare(int *p, int *q, int len)
various functions related to geometries
void AG_element_unrank(int q, int *v, int stride, int len, long int a)
basic number theoretic functions
int i_power_j(int i, int j)
numerical functions, mostly concerned with double
int triangular_prism(double *P1, double *P2, double *P3, double *abc3, double *angles3, double *T3, int verbose_level)
void print_matrix(double *R)
void vec_add(double *a, double *b, double *c, int len)
double atan_xy(double x, double y)
void vec_linear_combination3(double c1, double *v1, double c2, double *v2, double c3, double *v3, double *w, int len)
void orthogonal_transformation_from_point_to_basis_vector(double *from, double *A, double *Av, int verbose_level)
int intersect_line_and_line(double *line1_pt1_coords, double *line1_pt2_coords, double *line2_pt1_coords, double *line2_pt2_coords, double &lambda, double *pt_coords, int verbose_level)
double distance_euclidean(double *x, double *y, int len)
void make_Rx(double *R, double chi)
void make_Rz(double *R, double phi)
void make_Ry(double *R, double psi)
void vec_scalar_multiple(double *a, double lambda, int len)
void plane_through_three_points(double *p1, double *p2, double *p3, double *n, double &d)
void vec_linear_combination1(double c1, double *v1, double *w, int len)
int Gauss_elimination(double *A, int m, int n, int *base_cols, int f_complete, int verbose_level)
void substitute_quadric_linear(double *coeff_in, double *coeff_out, double *A4_inv, int verbose_level)
void eigenvectors(double *A, double *Basis, int n, double *lambda, int verbose_level)
void get_kernel(double *M, int m, int n, int *base_cols, int nb_base_cols, int &kernel_m, int &kernel_n, double *kernel)
void print_system(double *A, int m, int n)
void intersect_circle_line(double rad, double x0, double y0, double a, double b, double c, double &x1, double &y1, double &x2, double &y2)
void vec_linear_combination(double c1, double *v1, double c2, double *v2, double *v3, int len)
double distance_from_origin(double x1, double x2, double x3)
void affine_combination(double *X, double *Y, int pt0, int pt1, int pt2, double alpha, int new_pt)
void vec_scan_from_stream(std::istream &is, double *&v, int &len)
void vec_print(double *a, int len)
void mult_matrix(double *v, double *R, double *vR)
int general_prism(double *Pts, int nb_pts, double *Pts_xy, double *abc3, double *angles3, double *T3, int verbose_level)
void eigenvalues(double *A, int n, double *lambda, int verbose_level)
void transpose_matrix_nxn(double *A, double *At, int n)
void local_coordinates_wrt_triangle(double *pt, double *triangle_points, double &x, double &y, int verbose_level)
void vec_scan(const char *s, double *&v, int &len)
void transform_llur_double(double *in, double *out, double &x, double &y)
void project_to_disc(int f_projection_on, int f_transition, int step, int nb_steps, double rad, double height, double x, double y, double &xp, double &yp)
void on_circle_int(int *Px, int *Py, int idx, int angle_in_degree, int rad)
double bernoulli(double p, int n, int k)
void make_unit_vector(double *v, int len)
double cos_grad(double phi)
void mult_matrix_4x4(double *v, double *R, double *vR)
int Null_space(double *M, int m, int n, double *K, int verbose_level)
void cross_product(double *u, double *v, double *n)
double atan_grad(double x)
void adjust_coordinates_double(double *Px, double *Py, int *Qx, int *Qy, int N, double xmin, double ymin, double xmax, double ymax, int verbose_level)
int line_centered(double *pt1_in, double *pt2_in, double *pt1_out, double *pt2_out, double r, int verbose_level)
void output_double(double a, std::ostream &ost)
void affine_pt1(int *Px, int *Py, int p0, int p1, int p2, double f1, int p3)
void make_transform_t_varphi_u_double(int n, double *varphi, double *u, double *A, double *Av, int verbose_level)
double power_of(double x, int n)
void intersection_of_lines(double a1, double b1, double c1, double a2, double b2, double c2, double &x, double &y)
void vec_subtract(double *a, double *b, double *c, int len)
void transform_llur(int *in, int *out, int &x, int &y)
int line_centered_tolerant(double *pt1_in, double *pt2_in, double *pt1_out, double *pt2_out, double r, int verbose_level)
void center_of_mass(double *Pts, int len, int *Pt_idx, int nb_pts, double *c)
void transform_dist(int *in, int *out, int &x, int &y)
void Line_through_points(double *X, double *Y, double *a, double *b, double *c, int pt1, int pt2, int line_idx)
void affine_pt2(int *Px, int *Py, int p0, int p1, int p1b, double f1, int p2, int p2b, double f2, int p3)
void clebsch_map_up(double *line1_pt1_coords, double *line1_pt2_coords, double *line2_pt1_coords, double *line2_pt2_coords, double *pt_in, double *pt_out, double *Cubic_coords_povray_ordering, int line1_idx, int line2_idx, int verbose_level)
void substitute_quartic_linear_using_povray_ordering(double *coeff_in, double *coeff_out, double *A4_inv, int verbose_level)
double rad2deg(double phi)
void Intersection_of_lines(double *X, double *Y, double *a, double *b, double *c, int l1, int l2, int pt)
void transform_dist_x(int *in, int *out, int &x)
void intersect_circle_line_through(double rad, double x0, double y0, double pt1_x, double pt1_y, double pt2_x, double pt2_y, double &x1, double &y1, double &x2, double &y2)
void transpose_matrix_4x4(double *A, double *At)
void vec_swap(double *from, double *to, int len)
void substitute_cubic_linear_using_povray_ordering(double *coeff_in, double *coeff_out, double *A4_inv, int verbose_level)
void vec_normalize_from_back(double *v, int len)
double sin_grad(double phi)
void vec_normalize_to_minus_one_from_back(double *v, int len)
double norm_of_vector_2D(int x1, int x2, int y1, int y2)
void line_through_points(double pt1_x, double pt1_y, double pt2_x, double pt2_y, double &a, double &b, double &c)
void mult_matrix_matrix(double *A, double *B, double *C, int m, int n, int o)
double dot_product(double *u, double *v, int len)
void transform_dist_y(int *in, int *out, int &y)
double tan_grad(double phi)
void vec_copy(double *from, double *to, int len)
void on_circle_double(double *Px, double *Py, int idx, double angle_in_degree, double rad)
void matrix_double_inverse(double *A, double *Av, int n, int verbose_level)
data_structures::int_vec * Int_vec
domain for polynomials with double coefficients
void determinant_over_polynomial_ring(polynomial_double *P, polynomial_double *det, int n, int verbose_level)
void find_all_roots(polynomial_double *p, double *lambda, int verbose_level)
void init(int alloc_length)
polynomials with double coefficients, related to class polynomial_double_domain
void init(int alloc_length)
void print(std::ostream &ost)
#define Int_vec_zero(A, B)
#define NEW_OBJECTS(type, n)
#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