Changeset 3360fb in git for Singular/LIB/sing4ti2.lib
- Timestamp:
- Apr 14, 2009, 2:00:15 PM (15 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- 334c21f9e573112667d39f4cd9dcad9c7b19a50c
- Parents:
- 2c3a5db391a25c28449b80c5f27e1dd77ed2c30f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/sing4ti2.lib
r2c3a5d r3360fb 1 1 /////////////////////////////////////////////////////////////////// 2 version="$Id: sing4ti2.lib,v 1. 2 2009-04-07 16:18:06 seelischExp $";2 version="$Id: sing4ti2.lib,v 1.3 2009-04-14 12:00:15 Singular Exp $"; 3 3 category="Commutative Algebra"; 4 4 info=" … … 12 12 @* the returned result 13 13 14 REQUIRES: External programs 4ti2, sed and awk to be installed 14 REQUIRES: External programs 4ti2, sed and awk to be installed 15 15 16 16 PROCEDURES: … … 88 88 89 89 //---------------------------------------------------------------------- 90 // calling 4ti2 and converting output 90 // calling 4ti2 and converting output 91 91 // Singular's string is too clumsy for this, hence we first prepare 92 92 // using standard unix commands 93 93 //---------------------------------------------------------------------- 94 94 j=system("sh","markov sing4ti2"); 95 j=system("sh","awk \'BEGIN{ORS=\",\";}{print $0;}\' sing4ti2.mar | sed s/[\\\ \\\t\\\v\\\f]/,/g | sed s/,+/,/g|sed s/,,/,/g|sed s/,,/,/g > sing4ti2.converted"); 95 j=system("sh","awk \'BEGIN{ORS=\",\";}{print $0;}\' sing4ti2.mar | sed s/[\\\ \\\t\\\v\\\f]/,/g | sed s/,+/,/g|sed s/,,/,/g|sed s/,,/,/g > sing4ti2.converted"); 96 96 if(!defined(keepfiles)) 97 97 { 98 98 j=system("sh",("rm -f sing4ti2.mar sing4ti2."+fileending)); 99 } 99 } 100 100 //---------------------------------------------------------------------- 101 101 // reading output of 4ti2 … … 115 115 { 116 116 if(erglist[2+(i-1)*erglist[2]+j]>=0) 117 { 117 { 118 118 //--- positive exponents 119 119 temppol1=temppol1*(var(j)^erglist[2+(i-1)*erglist[2]+j]); … … 125 125 } 126 126 } 127 toric=toric,temppol1-temppol2; 127 toric=toric,temppol1-temppol2; 128 128 } 129 129 //--- get rid of leading entry 0; … … 210 210 211 211 //---------------------------------------------------------------------- 212 // calling 4ti2 and converting output 212 // calling 4ti2 and converting output 213 213 // Singular's string is too clumsy for this, hence we first prepare 214 214 // using standard unix commands 215 215 //---------------------------------------------------------------------- 216 216 j=system("sh","graver sing4ti2"); 217 j=system("sh","awk \'BEGIN{ORS=\",\";}{print $0;}\' sing4ti2.gra | sed s/[\\\ \\\t\\\v\\\f]/,/g | sed s/,+/,/g |sed s/,,/,/g|sed s/,,/,/g > sing4ti2.converted"); 217 j=system("sh","awk \'BEGIN{ORS=\",\";}{print $0;}\' sing4ti2.gra | sed s/[\\\ \\\t\\\v\\\f]/,/g | sed s/,+/,/g |sed s/,,/,/g|sed s/,,/,/g > sing4ti2.converted"); 218 218 if(!defined(keepfiles)) 219 219 { 220 220 j=system("sh",("rm -f sing4ti2.gra sing4ti2."+fileending)); 221 } 221 } 222 222 //---------------------------------------------------------------------- 223 223 // reading output of 4ti2 … … 237 237 { 238 238 if(erglist[2+(i-1)*erglist[2]+j]>=0) 239 { 239 { 240 240 //--- positive exponents 241 241 temppol1=temppol1*(var(j)^erglist[2+(i-1)*erglist[2]+j]); … … 247 247 } 248 248 } 249 toric=toric,temppol1-temppol2; 249 toric=toric,temppol1-temppol2; 250 250 } 251 251 //--- get rid of leading entry 0; … … 272 272 @* - number of variables of basering equals number of columns of A 273 273 @* (for ker(A)) resp. of rows of A (for Im(A)) 274 CREATE: temporary files sing4ti2.mat, sing4ti2.lat, sing4ti2.mar 274 CREATE: temporary files sing4ti2.mat, sing4ti2.lat, sing4ti2.mar 275 275 @* in the current directory (I/O files for communication with 4ti2) 276 276 NOTE: input rules for 4ti2 also apply to input to this procedure … … 330 330 331 331 //---------------------------------------------------------------------- 332 // calling 4ti2 and converting output 332 // calling 4ti2 and converting output 333 333 // Singular's string is too clumsy for this, hence we first prepare 334 334 // using standard unix commands 335 335 //---------------------------------------------------------------------- 336 336 j=system("sh","hilbert sing4ti2"); 337 j=system("sh","awk \'BEGIN{ORS=\",\";}{print $0;}\' sing4ti2.hil | sed s/[\\\ \\\t\\\v\\\f]/,/g | sed s/,+/,/g |sed s/,,/,/g|sed s/,,/,/g > sing4ti2.converted"); 337 j=system("sh","awk \'BEGIN{ORS=\",\";}{print $0;}\' sing4ti2.hil | sed s/[\\\ \\\t\\\v\\\f]/,/g | sed s/,+/,/g |sed s/,,/,/g|sed s/,,/,/g > sing4ti2.converted"); 338 338 if(!defined(keepfiles)) 339 339 { 340 340 j=system("sh",("rm -f sing4ti2.hil sing4ti2."+fileending)); 341 } 341 } 342 342 //---------------------------------------------------------------------- 343 343 // reading output of 4ti2 … … 357 357 { 358 358 if(erglist[2+(i-1)*erglist[2]+j]>=0) 359 { 359 { 360 360 //--- positive exponents 361 361 temppol1=temppol1*(var(j)^erglist[2+(i-1)*erglist[2]+j]); … … 367 367 } 368 368 } 369 toric=toric,temppol1-temppol2; 369 toric=toric,temppol1-temppol2; 370 370 } 371 371 //--- get rid of leading entry 0;
Note: See TracChangeset
for help on using the changeset viewer.