Changeset a2c96e in git
- Timestamp:
- Sep 24, 2008, 9:54:59 AM (15 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- a1268301053fa4acc4bf30c8f2e760fe2df2bb7f
- Parents:
- 040d28cacce3a8a9665322d46de21e8b0b452c8a
- Location:
- Singular/LIB
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/hnoether.lib
r040d28 ra2c96e 1 version="$Id: hnoether.lib,v 1.57 2008-07-08 12:33:46 Singular Exp $"; 1 version="$Id: hnoether.lib,v 1.58 2008-09-24 07:54:59 Singular Exp $"; 2 // (GMG, last modified 08.06.08: comments to Newton non-degenerate added) 3 /////////////////////////////////////////////////////////////////////////////// 4 2 5 category="Singularities"; 3 6 info=" … … 270 273 { 271 274 //----------------- Wechsel in geeigneten Ring & Variablendefinition --------- 275 if (nvars(basering)!=2) 276 { ERROR("basering must have exactly 2 variables for Hnoether::squarefree"); } 272 277 def altring = basering; 273 278 int e; 274 279 int gcd_ok=1; 275 280 string mipl="0"; 276 if (nvars(basering)!=2)277 { ERROR("basering must have exactly 2 variables for Hnoether::squarefree"); }278 281 if (size(parstr(altring))==1) { mipl=string(minpoly); } 279 282 //---- test: char = (p^k,a) (-> gcd not implemented) or (p,a) (gcd works) ---- … … 2294 2297 if(mu==nN) 2295 2298 { // the Newton-polygon is non-degenerate 2299 // REFERENCE? (tfuer mehr als 2 Variable gilt nicht, dass mu=nu impliziert, 2300 // dass NP nicht ausgeartet ist!, Siehe KOMMENTAR in equising.lib in esIdeal) 2296 2301 return(1); 2297 2302 } -
Singular/LIB/inout.lib
r040d28 ra2c96e 1 // (GMG/BM, last modified 22.06.96) 2 /////////////////////////////////////////////////////////////////////////////// 3 version="$Id: inout.lib,v 1.30 2007-11-29 13:27:48 king Exp $"; 1 //(GMG/BM, last modified 22.06.96) 2 //(GMG, last modified 21.07.2008: Argument von show von id in @@id geaendert) 3 /////////////////////////////////////////////////////////////////////////////// 4 version="$Id: inout.lib,v 1.31 2008-09-24 07:54:59 Singular Exp $"; 4 5 category="General purpose"; 5 6 info=" … … 111 112 proc pmat (matrix m, list #) 112 113 "USAGE: pmat(M[,n]); M matrix, n integer 113 RETURN: A string representing M in array format if it fits into 114 pagewidth; if n is given, only the first n characters of 115 each column are shown (n>1 required), where a truncation 116 of a column is indicated by two dots (\'..\') 114 DISPLAY: display M in array format if it fits into pagewidth; if n is given, 115 only the first n characters of each colum are shown 116 RETURN: no return value 117 117 EXAMPLE: example pmat; shows an example 118 118 " 119 119 { 120 120 //------------- main case: input is a matrix, no second argument--------------- 121 string OUT = "";122 121 if ( size(#)==0) 123 122 { … … 145 144 elems = elems + nrows(m); 146 145 } 147 OUT=OUT+aus+newline;146 aus; 148 147 } 149 148 //--------------- print last row (no comma after last entry) --------------- … … 155 154 } 156 155 aus = aus + string(m[nrows(m),ncols(m)]); 157 OUT=OUT+aus; return(OUT);156 aus; return(); 158 157 } 159 158 //---------- second case: second argument is given and of type int ------------ 160 if ( typeof(#[1])=="int" and #[1]>1) 161 { string aus,tmp; int c,r; 162 //---------------------- print all - except last - rows -------------------- 163 for ( r=1; r<nrows(m); r=r+1) 159 if ( typeof(#[1])=="int" ) 160 { string aus,tmp; int ll,c,r; 161 for ( r=1; r<=nrows(m); r=r+1) 164 162 { aus = ""; 165 163 for (c=1; c<=ncols(m); c=c+1) 166 164 { 167 165 tmp=string(m[r,c]); 168 if (size(tmp)>#[1]) 169 { tmp[#[1]-1]="."; 170 tmp[#[1]] ="."; 171 aus=aus+tmp[1,#[1]]+", "; 172 } 173 else 174 { tmp=tmp+","; 175 aus=aus+tmp[1,#[1]+1]+" "; 176 } 177 } 178 OUT=OUT+aus+newline; 179 } 180 //--------------- print last row (no comma after last entry) --------------- 181 aus = ""; 182 for (c=1; c<ncols(m); c=c+1) 183 { tmp=string(m[r,c]); 184 if (size(tmp)>#[1]) 185 { tmp[#[1]-1]="."; 186 tmp[#[1]] ="."; 187 aus=aus+tmp[1,#[1]]+", "; 188 } 189 else 190 { tmp=tmp+","; 191 aus=aus+tmp[1,#[1]+1]+" "; 192 } 193 } 194 tmp=string(m[nrows(m),ncols(m)]); 195 if (size(tmp)>#[1]) 196 { tmp[#[1]-1]="."; 197 tmp[#[1]] ="."; 198 } 199 aus = aus + tmp[1,#[1]]; 200 OUT=OUT+aus; return(OUT); 166 aus=aus+tmp[1,#[1]]+" "; 167 } 168 aus; 169 } 170 return(); 201 171 } 202 172 } … … 207 177 matrix m[3][3]=i^2; 208 178 pmat(m); 209 pmat(m, 5);179 pmat(m,3); 210 180 } 211 181 /////////////////////////////////////////////////////////////////////////////// … … 333 303 /////////////////////////////////////////////////////////////////////////////// 334 304 335 proc show ( id, list #)305 proc show (@@id, list #) 336 306 "USAGE: show(id); id any object of basering or of type ring/qring 337 307 @* show(R,s); R=ring, s=string (s = name of an object belonging to R) … … 355 325 if( typeof(#[1])=="int" ) { @li@=#[1]; } 356 326 } 357 if ( typeof( id)!="list" )327 if ( typeof(@@id)!="list" ) 358 328 { 359 329 if( size(#)==0 ) 360 330 { 361 def @id@ = id;331 def @id@ = @@id; 362 332 } 363 333 if( size(#)==1 ) … … 365 335 if( typeof(#[1])=="int" ) 366 336 { 367 def @id@ = id;337 def @id@ = @@id; 368 338 } 369 339 if( typeof(#[1])=="string" ) 370 340 { 371 if( typeof( id)=="ring" or typeof(id)=="qring")341 if( typeof(@@id)=="ring" or typeof(@@id)=="qring") 372 342 { 373 def @R@ = id;343 def @R@ = @@id; 374 344 setring @R@; 375 345 def @id@=`#[1]`; … … 378 348 } 379 349 } 380 //----------------------- case: id is of type list ----------------------------381 if ( typeof( id)=="list" )382 { 383 // @@s = tab(@li@)+"// list, "+string(size( id))+" element(s):";384 @@s = tab((3*(voice-2)))+"// list, "+string(size( id))+" element(s):";350 //----------------------- case: @@id is of type list ------------------------- 351 if ( typeof(@@id)=="list" ) 352 { 353 // @@s = tab(@li@)+"// list, "+string(size(@@id))+" element(s):"; 354 @@s = tab((3*(voice-2)))+"// list, "+string(size(@@id))+" element(s):"; 385 355 @@s; 386 for ( @ii=1; @ii<=size( id); @ii++ )387 { 388 if( typeof( id[@ii])!="none" )389 { 390 def @id(@ii) = id[@ii];356 for ( @ii=1; @ii<=size(@@id); @ii++ ) 357 { 358 if( typeof(@@id[@ii])!="none" ) 359 { 360 def @id(@ii) = @@id[@ii]; 391 361 tab(3*(voice-2))+"["+string(@ii)+"]:"; 392 362 // show(@id(@ii),@li@+3*(voice-1)); … … 396 366 { 397 367 "["+string(@ii)+"]:"; 398 tab(@li@+2),"//", id[@ii];368 tab(@li@+2),"//",@@id[@ii]; 399 369 } 400 370 } … … 487 457 { 488 458 list na@me@s=names(@id@); 489 kill @id@;459 //kill @id@; 490 460 @@s = tab(@li@)+"// ring:"; @@s,s; 491 461 @@s = tab(@li@)+"// minpoly ="; @@s,minpoly; -
Singular/LIB/sing.lib
r040d28 ra2c96e 1 // $Id: sing.lib,v 1.30 2006-08-02 15:40:52 Singular Exp $ 2 //(GMG/BM, last modified 26.06.96) 3 /////////////////////////////////////////////////////////////////////////////// 4 version="$Id: sing.lib,v 1.30 2006-08-02 15:40:52 Singular Exp $"; 1 // $Id: sing.lib,v 1.31 2008-09-24 07:54:59 Singular Exp $ 2 //(GMG/BM, last modified 26.06.96, 3 //GMG, 27.7.08: in milnor printlevel und Ausschrift gendert) 4 /////////////////////////////////////////////////////////////////////////////// 5 version="$Id: sing.lib,v 1.31 2008-09-24 07:54:59 Singular Exp $"; 5 6 category="Singularities"; 6 7 info=" … … 264 265 singularity) in generic form, resp. -1 if not 265 266 NOTE: use proc nf_icis to put generators in generic form 266 printlevel >= 0: display comments (default)267 printlevel >=1: display comments 267 268 EXAMPLE: example milnor; shows an example 268 269 " … … 271 272 int n = size(i); 272 273 int l,q,m_nr; ideal t; intvec disc; 273 int p = printlevel-voice+ 3; // p=printlevel+1 (default: p=1)274 int p = printlevel-voice+2; // p=printlevel+1 (default: p=0) 274 275 //---------------------------- hypersurface case ------------------------------ 275 276 if( n==1 or i==0 ) … … 277 278 i = std(jacob(i[1])); 278 279 m_nr = vdim(i); 279 if( m_nr<0 and p>=1 ) { "// no isolated singularity"; }280 if( m_nr<0 and p>=1 ) { "// Milnor number is infinite"; } 280 281 return(m_nr); 281 282 } … … 302 303 { "EXAMPLE:"; echo = 2; 303 304 int p = printlevel; 304 printlevel = 1;305 printlevel = 2; 305 306 ring r = 32003,(x,y,z),ds; 306 307 ideal j = x5+y6+z6,x2+2y2+3z2,xyz+yx; … … 799 800 "USAGE: codim(id1,id2); id1,id2 ideal or module, both must be standard bases 800 801 RETURN: int, which is: 801 1. the codimension of id2 in id1, i.e. the vectorspace dimension of802 id1/id2 if id2 is contained in id1and if this number is finite@*802 1. the vectorspace dimension of id1/id2 if id2 is contained in id1 803 and if this number is finite@* 803 804 2. -1 if the dimension of id1/id2 is infinite@* 804 3. -2 if id2 is not contained in id1, 805 COMPUTE: consider the two Hilbert series iv1(t) and iv2(t), then, in case 1., 806 q(t)=(iv2(t)-iv1(t))/(1-t)^n must be rational, and the result is the 807 sum of the coefficients of q(t) (n dimension of basering) 805 3. -2 if id2 is not contained in id1 806 COMPUTE: consider the Hilbert series iv1(t) of id1 and iv2(t) of id2. 807 If codim(id1,id2) is finite, q(t)=(iv2(t)-iv1(t))/(1-t)^n is 808 rational, and the codimension is the sum of the coefficients of q(t) 809 (n = dimension of basering). 808 810 EXAMPLE: example codim; shows an example 809 811 " … … 824 826 if (i1 < 0) 825 827 { 828 if ( i2 < 0 ) 829 { 830 return(0); 831 } 826 832 if (i2 == 0) 827 833 { 828 return vdim(id2);834 return (vdim(id2)); 829 835 } 830 836 else
Note: See TracChangeset
for help on using the changeset viewer.