File: app_exponentlattice.cpp

package info (click to toggle)
gfan 0.5%2Bdfsg-5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,296 kB
  • ctags: 5,612
  • sloc: cpp: 39,675; makefile: 453; sh: 1
file content (49 lines) | stat: -rw-r--r-- 1,092 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "parser.h"
#include "printer.h"
#include "polynomial.h"
#include "wallideal.h"
#include "termorder.h"
#include "gfanapplication.h"
#include "matrix.h"
#include "linalg.h"

class ExponentLatticeApplication : public GFanApplication
{
public:
  bool includeInDefaultInstallation()
  {
    return false;
  }
  const char *helpText()
  {
    return "This program computes a list of generators for the lattice generated by the exponent differences of monomials of the same polynomial in the input list of polynomials.\n";
  }
  ExponentLatticeApplication()
  {
    registerOptions();
  }

  const char *name()
  {
    return "_exponentlattice";
  }

  int main()
  {
    FileParser P(Stdin);

    PolynomialSet g=P.parsePolynomialSetWithRing();

    int n=g.getRing().getNumberOfVariables();
    IntegerVectorList l=exponentDifferences(g);

    FieldMatrix L=integerMatrixToFieldMatrix(rowsToIntegerMatrix(l,n),Q);
    L.reduce(false,true);
    L.removeZeroRows();
    pout<<fieldMatrixToIntegerMatrix(L).getRows();

    return 0;
  }
};

static ExponentLatticeApplication theApplication;