3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

adjust hnf

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

change in settings + random in adding terms to hnf

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

add terms in hnf from the beginning

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

adjusting settings

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

remove non used determinant()

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2018-06-22 09:51:33 -07:00
parent eeaca949e0
commit e5eea467b7
9 changed files with 36 additions and 79 deletions

View file

@ -3286,44 +3286,6 @@ void cutting_the_mix_example_1() {
std::cout << "d = " << d << ", u = " << u << ", vv = " << vv << std::endl;
}
void test_determinant() {
#ifdef Z3DEBUG
{
auto M = general_matrix(4);
M[0][0] = 1; M[0][1] = -1; M[0][2] = 1; M[0][3] = 1;
M[1][0] = 1; M[1][1] = 0; M[1][2] = 0; M[1][3] = 0;
M[2][0] = 0; M[2][1] = 1; M[2][2] = 4; M[2][3] = 0;
M[3][0] = 0; M[3][1] = 0; M[3][2] = 0; M[3][3] = 4;
std::cout << "M = "; M.print(std::cout, 4); endl(std::cout);
mpq d = hnf_calc::determinant(M);
std::cout << "det M = " << d << std::endl;
}
{
auto M = general_matrix(3);
M[0][0] = 3; M[0][1] = -1; M[0][2] = 1;
M[1][0] = 1; M[1][1] = 0; M[1][2] = 0;
M[2][0] = 0; M[2][1] = 1; M[2][2] = 4;
svector<unsigned> r;
std::cout << "M = "; M.print(std::cout, 4); endl(std::cout);
mpq d = hnf_calc::determinant_of_rectangular_matrix(M, r, mpq((int)100000));
std::cout << "det M = " << d << std::endl;
std::cout << "rank = " << r.size() << std::endl;
}
{
auto M = general_matrix(4, 6);
M[0][0] = 3; M[0][1] = -1; M[0][2] = 1; M[0][3] = 1; M[0][4] = 3; M[0][5] = -1;
M[1][0] = 1; M[1][1] = 0; M[1][2] = 0; M[1][3] = 0; M[1][4] = 2; M[1][5] = 7;
M[2][0] = 0; M[2][1] = 1; M[2][2] = 4; M[2][3] = 0; M[2][4] = 2; M[2][5] = 8;
M[3][0] = 6; M[3][1] = -2; M[3][2] = 2; M[3][3] = 2; M[3][4] = 6; M[3][5] = -2;
svector<unsigned> r;
std::cout << "M = "; M.print(std::cout, 4); endl(std::cout);
mpq d = hnf_calc::determinant_of_rectangular_matrix(M, r, mpq((int)1000000));
std::cout << "det M = " << d << std::endl;
std::cout << "rank = " << r.size() << std::endl;
}
#endif
}
#ifdef Z3DEBUG
void fill_general_matrix(general_matrix & M) {