4
#include "gfanapplication.h"
5
#include "polyhedralcone.h"
6
#include "polyhedralfan.h"
7
#include "polymakefile.h"
8
#include "tropicalmap.h"
10
class TropicalImageApplication : public GFanApplication
12
StringOption inputOption;
14
bool includeInDefaultInstallation()
18
const char *helpText()
20
return "This program computes the image of the tropicalization of a polynomial map. The output is a polyhedral fan with support equal to the image. The input is the polynomial ring, followed by a list of coordinate polynomials. A domain different from $R^n$ can be chosen with the option -i.\n";
22
TropicalImageApplication():
23
inputOption("-i","Specify the name of the file containing a polyhedral fan whose support is the domain of the function.",0)
30
return "_tropicalimage";
35
PolynomialSet g=FileParser(Stdin).parsePolynomialSetWithRing();
37
int n=g.getRing().getNumberOfVariables();
41
PolyhedralFan domain=PolyhedralFan::fullSpace(n);
43
if(inputOption.getValue())
45
domain=PolyhedralFan::readFan(inputOption.getValue());
48
PolyhedralFan f=imageOfTropicalMap(g,domain);
50
AsciiPrinter P(Stdout);
52
f.printWithIndices(&P,FPF_default|FPF_multiplicities/*|FPF_values*/);
58
static TropicalImageApplication theApplication;