SyFi
0.3
|
00001 #include <SyFi.h> 00002 #include <fstream> 00003 00004 using namespace GiNaC; 00005 using namespace SyFi; 00006 using namespace std; 00007 00008 int main() { 00009 00010 initSyFi(3); 00011 00012 archive ar; 00013 00014 symbol x0("x0"), x1("x1"), y0("y0"), y1("y1"), z0("z0"), z1("z1"); 00015 00016 ex p0 = lst(x0,y0,z0); 00017 ex p1 = lst(x1,y0,z0); 00018 ex p2 = lst(x0,y1,z0); 00019 ex p3 = lst(x0,y0,z1); 00020 00021 Tetrahedron tetrahedron(p0,p1,p2,p3); 00022 00023 ex repr = tetrahedron.repr(); 00024 cout <<"t.repr "<<repr<<endl; 00025 ar.archive_ex(repr, "repr"); 00026 00027 ex f = x*y*z; 00028 ex intf = tetrahedron.integrate(f); 00029 cout <<"intf "<<intf<<endl; 00030 ar.archive_ex(intf, "intf"); 00031 00032 /* 00033 ofstream vfile("tetrahedron_ex2.gar.v"); 00034 vfile << ar; vfile.close(); 00035 if(!compare_archives("tetrahedron_ex2.gar.v", "tetrahedron_ex2.gar.r")) { 00036 cerr << "Failure!" << endl; 00037 return -1; 00038 } 00039 */ 00040 00041 return 0; 00042 } 00043