pol.cpp

Go to the documentation of this file.
00001 #include <SyFi.h>
00002 
00003 int main() {
00004   int order = 2; 
00005   int nsd   = 2; 
00006 
00007   ex p = pol(order,nsd, "a"); 
00008   cout <<"polynom p = "<<p<<endl; 
00009   EQUAL_OR_DIE(p,"y^2*a5+x^2*a3+a2*y+y*x*a4+a0+a1*x"); 
00010 
00011   ex dpdx = diff(p,x);   
00012   cout <<"dpdx = "<<dpdx<<endl; 
00013   EQUAL_OR_DIE(dpdx, "y*a4+a1+2*x*a3"); 
00014 
00015   Triangle triangle(lst(0,0), lst(1,0), lst(0,1)); 
00016   ex intp = triangle.integrate(p); 
00017   cout <<"integral of p over reference triangle = "<<intp<<endl;  
00018   EQUAL_OR_DIE(intp, "1/6*a2+1/6*a1+1/12*a5+1/2*a0+1/24*a4+1/12*a3"); 
00019  
00020 
00021 }

Generated on Tue Nov 22 11:10:22 2005 for SyFi by  doxygen 1.4.4