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

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
#include "parser.h"
#include "printer.h"
#include "matrix.h"
#include "symmetry.h"
#include "gfanapplication.h"


class ComposePermutationApplication : public GFanApplication
{
  FieldOption theFieldOption;
public:
  bool includeInDefaultInstallation()
  {
    return false;
  }
  const char *helpText()
  {
    return "This program takes a list of permutations and composes them in the given order.\n";
  }
  ComposePermutationApplication()
  {
    registerOptions();
  }

  const char *name()
  {
    return "_composepermutations";
  }

  int main()
  {
    IntegerMatrix m=rowsToIntegerMatrix(FileParser(Stdin).parseIntegerVectorList());

    int n=m.getWidth();
    IntegerVector p=SymmetryGroup::identity(n);
    for(int i=0;i<m.getHeight();i++)
      p=SymmetryGroup::compose(p,m[i]);

    AsciiPrinter(Stderr).printVector(p);

    return 0;
  }
};

static ComposePermutationApplication theApplication;