Gröbner basis project
Codebase for research into Gröbner basis computation
test_nonsingular.cpp
1 /*****************************************************************************\
2 * This file is part of DynGB. *
3 * *
4 * DynGB is free software: you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation, either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * Foobar is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with DynGB. If not, see <http://www.gnu.org/licenses/>. *
16 \*****************************************************************************/
17 
18 #include <iostream>
19 #include "monomial_ordering.hpp"
20 
21 #define ROWDIM 4
22 #define COLDIM 4
23 
24 int main() {
25  unsigned long **A = new unsigned long * [ROWDIM];
26  for (unsigned i = 0; i < ROWDIM; ++i)
27  A[i] = new unsigned long [COLDIM];
28  /* A[0][0] = A[0][1] = A[0][2] = A[0][3] = 1;
29  A[1][0] = A[1][1] = A[1][2] = 1; A[1][3] = 0;
30  A[2][0] = A[2][1] = 1; A[2][2] = A[2][3] = 0;
31  A[3][0] = 1; A[3][1] = A[3][2] = A[3][3] = 0; */
32  A[0][0] = A[0][1] = 0; A[0][2] = A[0][3] = 1;
33  A[1][0] = A[1][1] = A[1][2] = 1; A[1][3] = 2;
34  A[2][0] = 1; A[2][1] = 2; A[2][2] = A[2][3] = 3;
35  A[3][0] = A[3][1] = A[3][2] = 3; A[3][3] = 6;
36  std::cout << "Nonsingular? " << nonsingular(ROWDIM, COLDIM, const_cast<const unsigned long **>(A)) << std::endl;
37 }
bool nonsingular(NVAR_TYPE m, NVAR_TYPE n, const WT_TYPE **A)
verifies that a matrix supplied for an ordering is not nonsingular