Changeset 3939bc in git for Singular/LIB/standard.lib
- Timestamp:
- May 29, 1998, 5:02:06 PM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 1d4300694bf8c8b67ec71e837ab58b13264fedf7
- Parents:
- 311499b3c35b89d435a5b5b44c51e0ace5b13c6c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/standard.lib
r311499 r3939bc 1 // $Id: standard.lib,v 1.1 6 1998-05-25 21:28:33 obachmanExp $1 // $Id: standard.lib,v 1.17 1998-05-29 15:02:02 Singular Exp $ 2 2 ////////////////////////////////////////////////////////////////////////////// 3 3 4 version="$Id: standard.lib,v 1.1 6 1998-05-25 21:28:33 obachmanExp $";4 version="$Id: standard.lib,v 1.17 1998-05-29 15:02:02 Singular Exp $"; 5 5 info=" 6 6 LIBRARY: standard.lib PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP … … 8 8 stdfglm(ideal[,ord]) standard basis of the ideal via fglm [and ordering ord] 9 9 stdhilb(ideal) standard basis of the ideal using the Hilbert function 10 groebner(ideal/module) standard basis of ideal or module using a 11 heuristically choosen method 10 groebner(ideal/module) standard basis of ideal or module using a 11 heuristically choosen method 12 12 "; 13 13 … … 126 126 proc groebner(def i, list #) 127 127 "USAGE: groebner(i[, wait]) i -- ideal/module; wait -- int 128 RETURNS: Standard basis of ideal or module which is computed using a 129 heuristically choosen method: 128 RETURNS: Standard basis of ideal or module which is computed using a 129 heuristically choosen method: 130 130 If the ordering of the current ring is a local ordering, or 131 131 if it is a non-block ordering and the current ring has no 132 parameters, then std(i) is returned. 132 parameters, then std(i) is returned. 133 133 Otherwise, i is mapped into a ring with no parameters and 134 134 ordering dp, where its Hilbert series is computed. This is … … 136 136 original ring. 137 137 NOTE: If a 2nd argument 'wait' is given, then the computation proceeds 138 at most 'wait' seconds. That is, if no result could be computed in 139 'wait' seconds, then the computation is interrupted, 0 is returned, 140 a warning message is displayed, and the global variable 141 'groebner_error' is defined. 138 at most 'wait' seconds. That is, if no result could be computed in 139 'wait' seconds, then the computation is interrupted, 0 is returned, 140 a warning message is displayed, and the global variable 141 'groebner_error' is defined. 142 142 EXAMPLE: example groebner; shows an example" 143 143 { … … 153 153 int wait = #[1]; 154 154 int j = 10; 155 155 156 156 string bs = nameof(basering); 157 157 link l_fork = "MPtcp:fork"; … … 160 160 int pid = read(l_fork); 161 161 write(l_fork, quote(groebner(eval(i)))); 162 162 163 163 // sleep in small intervalls for appr. one second 164 164 if (wait > 0) … … 170 170 } 171 171 } 172 172 173 173 // sleep in intervalls of one second from now on 174 174 j = 1; … … 178 178 j = j + 1; 179 179 } 180 180 181 181 if (status(l_fork, "read", "ready")) 182 182 { … … 226 226 return(std(i)); 227 227 } 228 228 229 229 int IsSimple_P; 230 230 if (system("nblocks") <= 2) … … 265 265 option(mem); 266 266 } 267 267 268 268 // construct ring in which first std computation is done 269 269 string varstr_P = varstr(P); 270 270 string parstr_P = parstr(P); 271 int is_homog = (homog(i) && (npars_P == 0)); 272 271 int is_homog = (homog(i) && (npars_P == 0)); 272 273 273 string ri = "ring Phelp =" + string(char(P)) + ",(" + varstr_P; 274 274 // parameters are converted to ring variables … … 287 287 // change the ring 288 288 execute(ri); 289 289 290 290 // get ideal from previous ring 291 291 if (is_homog) … … 298 298 ideal qh=homog(imap(P,i),@t); 299 299 } 300 300 301 301 // compute std and hilbert series 302 302 if (p_opt) … … 322 322 // additional variables were introduced 323 323 // need another intermediate ring 324 ri = "ring Phelp1 =" + string(char(P)) 324 ri = "ring Phelp1 =" + string(char(P)) 325 325 + ",(" + varstr(Phelp) + "),(" + ordstr_P; 326 326 327 327 // for lp without parameters, we do not need a block ordering 328 328 if ( ! (IsSimple_P && (npars_P + is_homog < 2) && find(ordstr_P, "l"))) … … 332 332 } 333 333 ri = ri + ");"; 334 334 335 335 // change to intermediate ring 336 336 execute(ri); … … 348 348 qh = subst(qh, @t, 1); 349 349 } 350 350 351 351 // go back to original ring 352 352 setring P; … … 370 370 "EXAMPLE: "; echo = 2; 371 371 ring r = 0, (a,b,c,d), lp; 372 option(prot); 372 option(prot); 373 373 ideal i = a+b+c+d, ab+ad+bc+cd, abc+abd+acd+bcd, abcd-1; // cyclic 4 374 374 groebner(i); … … 384 384 385 385 ////////////////////////////////////////////////////////////////////////// 386 proc res u(list #)386 proc res(list #) 387 387 { 388 388 def P=basering; 389 389 list result; 390 390 def m=#[1]; //the ideal or module 391 391 392 392 int i=#[2]; //the length of the resolution 393 393 //if size(#)>2 a minimal resolution is computed … … 414 414 setring P; 415 415 result=imap(Phelp,re); 416 return(result); 416 return(result); 417 417 } 418 418 … … 439 439 setring P; 440 440 result=imap(Phelp,re); 441 return(result); 441 return(result); 442 442 } 443 443 444 444 proc minresu(list #) 445 445 { 446 return(res u(#[1],#[2],1));447 } 446 return(res(#[1],#[2],1)); 447 }
Note: See TracChangeset
for help on using the changeset viewer.