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

« back to all changes in this revision

Viewing changes to app_polynomialsetunion.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:
28
28
public:
29
29
  const char *helpText()
30
30
  {
31
 
    return "This program computes the union of a list of polynomial sets given as input. The polynomials must all belong to the same ring. The ring is specified an the input. After this follows the list of polynomial sets.\n";
 
31
    return "This program computes the union of a list of polynomial sets given as input. The polynomials must all belong to the same ring. The ring is specified on the input. After this follows the list of polynomial sets.\n";
32
32
  }
33
33
  PolynomialSetUnionApplication():
34
34
    optionSpecialMode("-s","Sort output by degree.\n")
35
35
  {
36
36
    registerOptions();
37
37
  }
38
 
  char *name()
 
38
  const char *name()
39
39
  {
40
40
    return "_polynomialsetunion";
41
41
  }
42
42
  int main()
43
43
  {
44
 
    /*      SymmetryGroup g(16);
45
 
      //      g.computeClosure(StringParser("(1,2,3,0,5,6,7,4,9,10,11,8,13,14,15,12)").parseIntegerVector());
46
 
      //      g.computeClosure(StringParser("(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)").parseIntegerVector());
47
 
      g.computeClosure(StringParser("(1,0,2,3,5,4,6,7,9,8,10,11,13,12,14,15)").parseIntegerVector());
48
 
      g.computeClosure(StringParser("(0,2,1,3,4,6,5,7,8,10,9,11,12,14,13,15)").parseIntegerVector());
49
 
      g.computeClosure(StringParser("(0,1,3,2,4,5,7,6,8,9,11,10,12,13,15,14)").parseIntegerVector());
50
 
      g.computeClosure(StringParser("(0,2,1,3,4,6,5,7,8,10,9,11,12,14,13,15)").parseIntegerVector());
51
 
      
52
 
      g.computeClosure(StringParser("(4,5,6,7,0,1,2,3,8,9,10,11,12,13,14,15)").parseIntegerVector());
53
 
      g.computeClosure(StringParser("(8,9,10,11,4,5,6,7,0,1,2,3,12,13,14,15)").parseIntegerVector());
54
 
      g.computeClosure(StringParser("(12,13,14,15,4,5,6,7,8,9,10,11,0,1,2,3)").parseIntegerVector());
55
 
      g.computeClosure(StringParser("(8,9,10,11,4,5,6,7,0,1,2,3,12,13,14,15)").parseIntegerVector());
56
 
 
57
 
      g.print(Stderr);
58
 
*/
59
 
 
60
44
    FileParser P(Stdin);
61
45
    PolynomialRing r=P.parsePolynomialRing();
62
46
    int c=P.nextNonBlank();
63
47
    bool first=true;
64
48
    assert(P.isLeftBracket(c));
65
49
    PolynomialSet s=P.parsePolynomialSet(r);
 
50
    c=P.nextNonBlank();
66
51
    while(','==c || first)
67
52
      {
68
53
        PolynomialSet temp=P.parsePolynomialSet(r);
73
58
      }
74
59
    assert(P.isRightBracket(c));
75
60
 
76
 
    /*    PolynomialSet S;
77
 
 
78
 
    for(PolynomialSet::const_iterator i=s.begin();i!=s.end();i++)
79
 
      {
80
 
        S.unionPolynomial((*i));
81
 
        //      S.unionPolynomial(g.computeUniqueRepresentative(*i));
82
 
      }
83
 
    */
84
 
 
85
61
    if(optionSpecialMode.getValue())s.sort(PolynomialCmp());
86
62
 
87
63
    AsciiPrinter(Stdout).printPolynomialRing(r);
88
64
    AsciiPrinter(Stdout).printNewLine();
89
65
    AsciiPrinter(Stdout).printPolynomialSet(s);
90
 
    /*
91
 
    PolynomialSet total;
92
 
    for(PolynomialSet::const_iterator i=S.begin();i!=S.end();i++)
93
 
      {
94
 
        AsciiPrinter(Stdout).printPolynomial(*i);
95
 
        PolynomialSet a;
96
 
        for(SymmetryGroup::ElementContainer::const_iterator j=g.elements.begin();j!=g.elements.end();j++)
97
 
          {
98
 
            a.unionPolynomial(g.permutePolynomial(*i,*j));
99
 
            total.unionPolynomial(g.permutePolynomial(*i,*j));
100
 
          }
101
 
        fprintf(Stdout,"\nelments in class: %i\n",a.size());
102
 
        fprintf(Stdout,"Total so far: %i\n\n",total.size());
103
 
      }
104
 
    */
105
66
    return 0;
106
67
  }
107
68
};