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

« back to all changes in this revision

Viewing changes to app_isconnected.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 "polynomial.h"
 
4
#include "division.h"
 
5
#include "lp.h"
 
6
#include "gfanapplication.h"
 
7
#include "polyhedralcone.h"
 
8
#include "polyhedralfan.h"
 
9
#include "symmetry.h"
 
10
 
 
11
#include "polymakefile.h"
 
12
 
 
13
class IsConnectedApplication : public GFanApplication
 
14
{
 
15
  StringOption inputOption;
 
16
  SimpleOption optionSymmetry;
 
17
public:
 
18
  bool includeInDefaultInstallation()
 
19
  {
 
20
    return false;
 
21
  }
 
22
  const char *helpText()
 
23
  {
 
24
    return "This program checks if a PURE d-dimensional fan is connected in codimension one (in the sense of [Bogart, Jensen, Speyer, Sturmfels, Thomas]).\n";
 
25
  }
 
26
  IsConnectedApplication():
 
27
    inputOption("-i","Specify the name of the input file.","polymake.out"),
 
28
    optionSymmetry("--symmetry",
 
29
                   "Reads in the cone stored with symmetry. The generators of the symmetry group are given on the input. IF SYMMETRY IS SPECIFIED THEN "
 
30
                   "THE CHECK IS NOT COMPLETE AND IT WILL ONLY BE CHECKED IF THAT GIVEN"
 
31
                   "TWO CONES THAT EXIST ELEMENTS IN THE TWO RESPECTIVE ORBITS"
 
32
                   "WHICH ARE CONNECTED BY A RIDGE PATH\n")
 
33
  {
 
34
    registerOptions();
 
35
  }
 
36
 
 
37
  const char *name()
 
38
  {
 
39
    return "_isconnected";
 
40
  }
 
41
 
 
42
  int main()
 
43
  {
 
44
    PolyhedralFan f=PolyhedralFan::readFan(inputOption.getValue(),true,0,0,0,true);
 
45
    int n=f.getAmbientDimension();
 
46
    SymmetryGroup s(n);
 
47
 
 
48
    if(optionSymmetry.getValue())
 
49
      {
 
50
        IntegerVectorList generators=FileParser(Stdin).parseIntegerVectorList();
 
51
        s.computeClosure(generators);
 
52
      }
 
53
 
 
54
    cout << f.isConnected(&s) << endl;
 
55
 
 
56
    return 0;
 
57
  }
 
58
};
 
59
 
 
60
static IsConnectedApplication theApplication;
 
61