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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
#include "parser.h"
#include "printer.h"
#include "polynomial.h"
#include "division.h"
#include "buchberger.h"
#include "wallideal.h"
#include "lp.h"
#include "reversesearch.h"
#include "termorder.h"
#include "ep_standard.h"
#include "ep_xfig.h"
#include "gfanapplication.h"
#include "matrix.h"
#include "latticeideal.h"
#include "subspace.h"
#include "scarf.h"
class ScarfComplexApplication : public GFanApplication
{
public:
bool includeInDefaultInstallation()
{
return false;
}
const char *helpText()
{
return "This program .\n";
}
ScarfComplexApplication()
{
registerOptions();
}
const char *name()
{
return "_scarf_complex";
}
int main()
{
LpSolver::printList(Stdout);
lpSetSolver("cddgmp");
FileParser P(Stdin);
IntegerVectorList ivl=P.parseIntegerVectorList();
IntegerMatrix A=rowsToIntegerMatrix(ivl);
bool s1=satisfiesA1(A);
fprintf(Stdout,"A1 satisfied:%i\n",s1);
if(s1)
{
IntegerVectorList N=neighbours(A);
AsciiPrinter Q(Stdout);
Q.printVectorList(N);
fprintf(Stdout,"A2 satisfied:%i\n",satisfiesA2(A));
fprintf(Stdout,"A3 satisfied:%i\n",satisfiesA3(A,&N));
N=orientedNeighbours(N,-A[0]);
IntegerMatrix N2(1,A.getWidth());
N2.append(rowsToIntegerMatrix(N));
N2.append((-1)*rowsToIntegerMatrix(N));
Q.printVectorList(N2.getRows());
/* simplex=StringParser("(0,5,6)").parseIntegerVector();
Q.printVector(simplex);
simplex=kFlip(A,N2,simplex,0);
Q.printVector(simplex);
*/
IntegerVector simplex=computeMaximalScarfSimplex(A,N2);
traverseScarfComplex(A,N2,simplex);
}
else
fprintf(Stdout,"Neighbours for this matrix cannot be computed with the implemented method.\n");
return 0;
}
};
static ScarfComplexApplication theApplication;
|