1 #include "vektor.h"
2 #include "printer.h"
3 #include "parser.h"
4 #include "gfanapplication.h"
5 
6 typedef list<string> StringList;
7 
8 class SubstituteApplication : public GFanApplication
9 {
10 public:
helpText()11   const char *helpText()
12   {
13     return "This program changes the variable names of a polynomial ring. The input is a polynomial ring, a polynomial set in the ring and a new polynomial ring with the same coefficient field but different variable names. The output is the polynomial set written with the variable names of the second polynomial ring.\n"
14       "Example:\n"
15       "Input:\n"
16       "Q[a,b,c,d]{2a-3b,c+d}Q[b,a,c,x]\n"
17       "Output:\n"
18       "Q[b,a,c,x]{2*b-3*a,c+x}\n";
19   }
SubstituteApplication()20   SubstituteApplication()
21   {
22     registerOptions();
23   }
name()24   const char *name()
25   {
26     return "_substitute";
27   }
main()28   int main()
29   {
30     FileParser P(Stdin);
31     PolynomialRing r=P.parsePolynomialRing();
32     PolynomialSet s=P.parsePolynomialSet(r);
33     PolynomialRing r2=P.parsePolynomialRing();
34     AsciiPrinter(Stdout).printPolynomialRing(r2);
35     AsciiPrinter(Stdout).printNewLine();
36     AsciiPrinter(Stdout).printPolynomialSet(s.embeddedInto(r2));
37 
38     return 0;
39   }
40 };
41 
42 static SubstituteApplication theApplication;
43