polh.cpp
Go to the documentation of this file.00001 #include <SyFi.h>
00002 #include <fstream>
00003
00004 using namespace GiNaC;
00005 using namespace std;
00006 using namespace SyFi;
00007
00008 int main() {
00009
00010 archive ar;
00011 int order = 3;
00012
00013 initSyFi(1);
00014 cout <<"third order homogenous polynomial in 1D"<<endl;
00015 ex polh = homogenous_pol(order, nsd, "a");
00016 cout <<"polh "<<polh<<endl;
00017 ar.archive_ex(polh, "polh1_3");
00018
00019
00020 initSyFi(2);
00021 cout <<"third order homogenous polynomial in 2D"<<endl;
00022 polh = homogenous_pol(order, nsd, "a");
00023 cout <<"polh "<<polh<<endl;
00024 ar.archive_ex(polh, "polh2_3");
00025
00026 initSyFi(3);
00027 cout <<"third order homogenous polynomial in 3D"<<endl;
00028 polh = homogenous_pol(order, nsd, "a");
00029 cout <<"polh "<<polh<<endl;
00030 ar.archive_ex(polh, "polh3_3");
00031
00032 ofstream vfile("polh.gar.v");
00033 vfile << ar; vfile.close();
00034 if(!compare_archives("polh.gar.v", "polh.gar.r")) {
00035 cerr << "Failure!" << endl;
00036 return -1;
00037 }
00038
00039 return 0;
00040
00041
00042 }