SyFi  0.3
simple2.cpp
Go to the documentation of this file.
00001 #include <SyFi.h>
00002 
00003 using namespace GiNaC; 
00004 using namespace SyFi; 
00005 using namespace std; 
00006 
00007 int main() {
00008 
00009     initSyFi(1); 
00010 
00011     // initialization (f = x^2 + y^2) 
00012     ex f = x*x + y*y; 
00013     cout <<"f "<<f<<endl; 
00014 
00015     // differentiation (dfdx = df/dx = 2x) 
00016     ex dfdx = f.diff(x,1);  
00017     cout <<"dfdx "<<dfdx<<endl; 
00018 
00019     // integration (intf = 1/3+y^2, integral of f(x,y) from x=0 to x=1) 
00020     ex intf = integral(x,0,1,f); 
00021     cout <<"intf "<<intf<<endl; 
00022     intf = eval_integ(intf); 
00023     cout <<"intf "<<intf<<endl; 
00024 
00025     return 0; 
00026 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator