Changeset 3ce617 in git
 Timestamp:
 May 18, 2011, 11:04:25 AM (12 years ago)
 Branches:
 (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
 Children:
 3857cbd54ecdd34fa283e966babea53e8987186e
 Parents:
 2eb19e15c7ab2ab85c2f409c83aa5a1eb5941c2c
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

HOWTOlibsingular
r2eb19e r3ce617 4 4 make installlibsingular 5 5 6  7 how to compile and run the the example: 8 g++ I......include o tt tt.cc L..../Singular lsingular 9 export LD_LIBRARY_PATH=...../Singular 10 ./tt 11  12 the example: 13 #include <libsingular.h> 14 void main() 15 { 16 // init path names etc. 17 siInit((char *)"/home/hannes/singulargap/Singular/p_Procs_FieldZp.so"); 18 19 // construct the ring Z/32003[x,y,z] 20 // the variable names 21 char **n=(char**)omalloc(3*sizeof(char*)); 22 n[0]=omStrDup("x"); 23 n[1]=omStrDup("y"); 24 n[2]=omStrDup("z"); 25 26 ring R=rDefault(32003,3,n); 27 // make R the default ring: 28 rChangeCurrRing(R); 29 30 // create the polynomial 1 31 poly p1=p_ISet(1,R); 32 33 // create tthe polynomial 2*x^3*z^2 34 poly p2=p_ISet(2,R); 35 pSetExp(p2,1,3); 36 pSetExp(p2,3,2); 37 pSetm(p2); 38 39 // print p1 + p2 40 pWrite(p1); printf(" + \n"); pWrite(p2); printf("\n"); 41 42 // compute p1+p2 43 p1=p_Add_q(p1,p2,R); p2=NULL; 44 pWrite(p1); 45 46 // cleanup: 47 pDelete(&p1); 48 rKill(R); 49 }
Note: See TracChangeset
for help on using the changeset viewer.