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

« back to all changes in this revision

Viewing changes to app_pointconfiguration.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 "buchberger.h"
 
6
#include "wallideal.h"
 
7
#include "lp.h"
 
8
#include "reversesearch.h"
 
9
#include "termorder.h"
 
10
#include "gfanapplication.h"
 
11
#include "wallideal.h"
 
12
 
 
13
class PointConfigurationApplication : public GFanApplication
 
14
{
 
15
  IntegerOption dimension1Option;
 
16
  IntegerOption dimension2Option;
 
17
public:
 
18
  bool includeInDefaultInstallation()
 
19
  {
 
20
    return false;
 
21
  }
 
22
  const char *helpText()
 
23
  {
 
24
    return "This program produces the point configuration of the product of two standard simplices together with their symmetries.\n";
 
25
  }
 
26
  PointConfigurationApplication():
 
27
    dimension1Option("-d1","Number of vertices in the first simplex.",2),
 
28
    dimension2Option("-d2","Number of vertices in the second simplex.",2)
 
29
  {
 
30
    registerOptions();
 
31
  }
 
32
 
 
33
  const char *name()
 
34
  {
 
35
    return "_pointconfiguration";
 
36
  }
 
37
 
 
38
  int main()
 
39
  {
 
40
    int d1=dimension1Option.getValue();
 
41
    int d2=dimension2Option.getValue();
 
42
    assert(d1>=2);
 
43
    assert(d2>=2);
 
44
    IntegerMatrix A(d1*d2,d1+d2);
 
45
    IntegerVector p1(d1*d2);
 
46
    IntegerVector p2(d1*d2);
 
47
    IntegerVector p3(d1*d2);
 
48
    IntegerVector p4(d1*d2);
 
49
    for(int b=0;b<d2;b++)
 
50
      for(int a=0;a<d1;a++)
 
51
        {
 
52
          A[b*d1+a][b]=1;
 
53
          A[b*d1+a][a+d2]=1;
 
54
 
 
55
          p1[b*d1+a]=b*d1+((a==0 || a==1)?1-a:a);
 
56
          p2[b*d1+a]=b*d1+((a+1)%d1);
 
57
          p3[b*d1+a]=((b==0 || b==1)?1-b:b)*d1+a;
 
58
          p4[b*d1+a]=((b+1)%d2)*d1+a;
 
59
        }
 
60
    pout<<A.getRows();
 
61
 
 
62
    IntegerVectorList p;
 
63
    p.push_back(p1);
 
64
    p.push_back(p2);
 
65
    p.push_back(p3);
 
66
    p.push_back(p4);
 
67
    pout<<p;
 
68
 
 
69
    return 0;
 
70
  }
 
71
};
 
72
 
 
73
static PointConfigurationApplication theApplication;