3
#include "polynomial.h"
5
#include "buchberger.h"
8
#include "reversesearch.h"
10
#include "ep_standard.h"
12
#include "gfanapplication.h"
16
class RenderNewtonPolytopeApplication : public GFanApplication
18
FieldOption theFieldOption;
19
SimpleOption optionListOfPolynomialSets;
20
IntegerOption optionMaxEntry;
21
IntegerOption optionWidth;
23
bool includeInDefaultInstallation()
27
const char *helpText()
29
return "Renders the Newton polytope of a polynomial in two variables.\n"
30
"The output is an xfig file.\n";
32
RenderNewtonPolytopeApplication():
33
optionListOfPolynomialSets("-m","undocumented"),
34
optionMaxEntry("-d","undocumented",8),
35
optionWidth("-w","undocumented",5)
42
return "_rendernewtonpolytope";
47
/* LpSolver::printList(Stderr);
48
lpSetSolver("cddgmp");
52
Polynomial p=P.parsePolynomialWithRing();
61
f.beginDrawLine(false,true);
63
f.addPoint(maxX*scale,0);
66
f.beginDrawLine(false,true);
68
f.addPoint(0,-maxY*scale);
72
for(TermMap::iterator i=p.terms.begin();i!=p.terms.end();i++)
76
IntegerVector v=m.exponent;
80
f.drawDot(scale*x,-scale*y);
82
f.drawString(scale*x+int(0.2*scale),-scale*y+60,i->second.toString());
89
static RenderNewtonPolytopeApplication theApplication;