integral_ex1.cpp

Go to the documentation of this file.
00001 #include <SyFi.h>
00002 #include <ginac/ginac.h>
00003 
00004 using namespace std; 
00005 using namespace GiNaC; 
00006 
00007 void check_integral(ex& f){
00008 }
00009 
00010 int main() {
00011   ReferenceLine line; 
00012   LagrangeFE fe; 
00013   fe.set(line);
00014   fe.set(3); 
00015   fe.compute_basis_functions(); 
00016   symbol a("a"); 
00017   ex integrand = fe.N(0)*pow(fe.N(1),-1.0); 
00018   ex integrand2 = collect_common_factors(integrand); 
00019 //  cout <<csrc<<endl; 
00020   cout <<integrand2<<endl; 
00021   cout <<integrand<<endl; 
00022   ex integral1 = line.integrate(integrand2); 
00023   cout <<integral1<<endl; 
00024   cout <<integral1.eval_integ()<<endl; 
00025   cout <<"numeric "<<endl; 
00026   cout <<integral1.evalf()<<endl; 
00027   cout <<integrand.op(0)<<endl; 
00028 
00029   ex f = pow((x+1),a); 
00030   ex intf = integral(x,0,1,f).eval_integ();  
00031   cout <<intf<<endl; 
00032 
00033 
00034 
00035 }
00036 
00037 
00038 
00039 
00040 

Generated on Tue Jun 13 13:18:38 2006 for SyFi by  doxygen 1.4.4