2 * Archiving code example from the tutorial
7 #include <ginac/ginac.h>
12 symbol x("x"), y("y"), z("z");
16 ex foo = sin(x + 2*y) + 3*z + 41;
22 a.archive_ex(foo, "foo");
23 a.archive_ex(bar, "the second one");
25 ofstream out("foobar.gar");
29 // read in the archive
32 ifstream in("foobar.gar");
38 ex ex1 = a2.unarchive_ex(syms, "foo");
39 ex ex2 = a2.unarchive_ex(syms, "the second one");
43 cout << ex1 << endl; // prints "41+sin(x+2*y)+3*z"
44 cout << ex2 << endl; // prints "42+sin(x+2*y)+3*z"
45 cout << ex1.subs(x == 2) << endl; // prints "41+sin(2+2*y)+3*z"