~ubuntu-branches/ubuntu/saucy/gfan/saucy-proposed

« back to all changes in this revision

Viewing changes to app_tropicalimage.cpp

  • Committer: Package Import Robot
  • Author(s): Cédric Boutillier
  • Date: 2013-07-09 10:44:01 UTC
  • mfrom: (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130709104401-5q66ozz5j5af0dak
Tags: 0.5+dfsg-3
* Upload to unstable.
* modify remove_failing_tests_on_32bits.patch to replace command of
  0009RenderStairCase test with an empty one instead of deleting it.
* remove lintian override about spelling error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "parser.h"
 
2
#include "printer.h"
 
3
#include "lp.h"
 
4
#include "gfanapplication.h"
 
5
#include "polyhedralcone.h"
 
6
#include "polyhedralfan.h"
 
7
#include "polymakefile.h"
 
8
#include "tropicalmap.h"
 
9
 
 
10
class TropicalImageApplication : public GFanApplication
 
11
{
 
12
  StringOption inputOption;
 
13
public:
 
14
  bool includeInDefaultInstallation()
 
15
  {
 
16
    return false;
 
17
  }
 
18
  const char *helpText()
 
19
  {
 
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";
 
21
  }
 
22
  TropicalImageApplication():
 
23
    inputOption("-i","Specify the name of the file containing a polyhedral fan whose support is the domain of the function.",0)
 
24
  {
 
25
    registerOptions();
 
26
  }
 
27
 
 
28
  const char *name()
 
29
  {
 
30
    return "_tropicalimage";
 
31
  }
 
32
 
 
33
  int main()
 
34
  {
 
35
    PolynomialSet g=FileParser(Stdin).parsePolynomialSetWithRing();
 
36
 
 
37
    int n=g.getRing().getNumberOfVariables();
 
38
 
 
39
 
 
40
 
 
41
    PolyhedralFan domain=PolyhedralFan::fullSpace(n);
 
42
 
 
43
    if(inputOption.getValue())
 
44
      {
 
45
        domain=PolyhedralFan::readFan(inputOption.getValue());
 
46
      }
 
47
 
 
48
    PolyhedralFan f=imageOfTropicalMap(g,domain);
 
49
 
 
50
    AsciiPrinter P(Stdout);
 
51
 
 
52
    f.printWithIndices(&P,FPF_default|FPF_multiplicities/*|FPF_values*/);
 
53
 
 
54
    return 0;
 
55
  }
 
56
};
 
57
 
 
58
static TropicalImageApplication theApplication;
 
59