File: lattice.cpp

package info (click to toggle)
gfan 0.5%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,348 kB
  • ctags: 5,683
  • sloc: cpp: 39,675; makefile: 454; sh: 1
file content (23 lines) | stat: -rw-r--r-- 486 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "lattice.h"

#include "linalg.h"
#include "field_rationals.h"


bool isPartOfAZBasis(IntegerVectorList const &l)
{
  if(l.size()==0)return true;
  IntegerMatrix A=rowsToIntegerMatrix(l).transposed();
  FieldMatrix Af=integerMatrixToFieldMatrix(A,Q);
  Af.reduce(false,true);

  int i=-1;
  int j=-1;
  int nPivots=0;
  while(Af.nextPivot(i,j))
    {
      if(!((Af[i][j]*Af[i][j])-Q.zHomomorphism(1)).isZero())return false;
      nPivots++;
    }
  return l.size()==nPivots;
}