~ubuntu-branches/ubuntu/saucy/gfan/saucy-proposed

« back to all changes in this revision

Viewing changes to lattice.cpp

  • Committer: Package Import Robot
  • Author(s): Cédric Boutillier
  • Date: 2013-07-09 10:44:01 UTC
  • mfrom: (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130709104401-5q66ozz5j5af0dak
Tags: 0.5+dfsg-3
* Upload to unstable.
* modify remove_failing_tests_on_32bits.patch to replace command of
  0009RenderStairCase test with an empty one instead of deleting it.
* remove lintian override about spelling error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "lattice.h"
 
2
 
 
3
#include "linalg.h"
 
4
#include "field_rationals.h"
 
5
 
 
6
 
 
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
}