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
|
#include "parser.h"
#include "printer.h"
#include "lp.h"
#include "gfanapplication.h"
#include "polyhedralcone.h"
#include "polyhedralfan.h"
#include "polymakefile.h"
#include "tropicalmap.h"
class TropicalImageApplication : public GFanApplication
{
StringOption inputOption;
public:
bool includeInDefaultInstallation()
{
return false;
}
const char *helpText()
{
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";
}
TropicalImageApplication():
inputOption("-i","Specify the name of the file containing a polyhedral fan whose support is the domain of the function.",0)
{
registerOptions();
}
const char *name()
{
return "_tropicalimage";
}
int main()
{
PolynomialSet g=FileParser(Stdin).parsePolynomialSetWithRing();
int n=g.getRing().getNumberOfVariables();
PolyhedralFan domain=PolyhedralFan::fullSpace(n);
if(inputOption.getValue())
{
domain=PolyhedralFan::readFan(inputOption.getValue());
}
PolyhedralFan f=imageOfTropicalMap(g,domain);
AsciiPrinter P(Stdout);
f.printWithIndices(&P,FPF_default|FPF_multiplicities/*|FPF_values*/);
return 0;
}
};
static TropicalImageApplication theApplication;
|