1 #include "lattice.h"
2 
3 #include "linalg.h"
4 #include "field_rationals.h"
5 
6 
isPartOfAZBasis(IntegerVectorList const & l)7 bool isPartOfAZBasis(IntegerVectorList const &l)
8 {
9   if(l.size()==0)return true;
10   IntegerMatrix A=rowsToIntegerMatrix(l).transposed();
11   FieldMatrix Af=integerMatrixToFieldMatrix(A,Q);
12   Af.reduce(false,true);
13 
14   int i=-1;
15   int j=-1;
16   int nPivots=0;
17   while(Af.nextPivot(i,j))
18     {
19       if(!((Af[i][j]*Af[i][j])-Q.zHomomorphism(1)).isZero())return false;
20       nPivots++;
21     }
22   return l.size()==nPivots;
23 }
24