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 50 51 52 53 54
|
#include "vektor.h"
#include "printer.h"
#include "parser.h"
#include "gfanapplication.h"
#include "binomial.h"
#include "latticeideal.h"
#include "field_rationals.h"
#include "lll.h"
class LatticeIdealApplication : public GFanApplication
{
SimpleOption toricOption;
public:
bool includeInDefaultInstallation()
{
return false;
}
LatticeIdealApplication():
toricOption("-t","Compute the toric ideal of the matrix whose rows are given on the input instead.")
{
registerOptions();
}
char *name()
{
return "_latticeideal";
}
int main()
{
FileParser P(Stdin);
IntegerVectorList ivl=P.parseIntegerVectorList();
IntegerMatrix A=rowsToIntegerMatrix(ivl).transposed();
if(toricOption.getValue())
A=latticeKernelOfTransposed(A).transposed();
IntegerVectorList b=latticeIdealRevLex(A);
PolynomialRing theRing(Q,A.getHeight());
PolynomialSet g(theRing);
for(IntegerVectorList::const_iterator i=b.begin();i!=b.end();i++)
g.push_back(integerVectorToBinomial(*i,theRing));
AsciiPrinter(Stdout).printPolynomialRing(g.getRing());
AsciiPrinter(Stdout).printPolynomialSet(g);
return 0;
}
const char *helpText()
{
return "This program computes the lattice ideal of the lattice. The input is a list of generators for the lattice.\n";
}
};
static LatticeIdealApplication theApplication;
|