Changeset a3432c in git
- Timestamp:
- Sep 24, 1998, 2:09:26 PM (25 years ago)
- Branches:
- (u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
- Children:
- 2386d98357886538fbc1e8f5e3e458fcb811ff1f
- Parents:
- 56c52a7879fbc6de62cefba1da86b2edf2aadd4c
- Location:
- Singular
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/primdec.lib
r56c52a7 ra3432c 1 // $Id: primdec.lib,v 1.2 6 1998-09-24 09:59:51Singular Exp $1 // $Id: primdec.lib,v 1.27 1998-09-24 12:09:26 Singular Exp $ 2 2 //////////////////////////////////////////////////////////////////////////////// 3 3 // primdec.lib // … … 11 11 //////////////////////////////////////////////////////////////////////////////// 12 12 13 version="$Id: primdec.lib,v 1.2 6 1998-09-24 09:59:51Singular Exp $";13 version="$Id: primdec.lib,v 1.27 1998-09-24 12:09:26 Singular Exp $"; 14 14 info=" 15 15 LIBRARY: primdec.lib: PROCEDURE FOR PRIMARY DECOMPOSITION … … 383 383 if(size(k1)==size(k2)) 384 384 { 385 for(j= size(k1);j>0;j--)385 for(j=ncols(k1);j>0;j--) 386 386 { 387 387 if(leadexp(k1[j])!=leadexp(k2[j])) … … 401 401 if(size(k1)==size(k2)) 402 402 { 403 for(j= size(k1);j>0;j--)403 for(j=ncols(k1);j>0;j--) 404 404 { 405 405 if(leadexp(k1[j])!=leadexp(k2[j])) … … 431 431 432 432 ideal i=maxideal(1); 433 int k= size(i);433 int k=ncols(i); 434 434 i[k]=0; 435 i=randomid(i, size(i),b);435 i=randomid(i,ncols(i),b); 436 436 ideal ires=maxideal(1); 437 437 ires[k]=i[1]+var(k); … … 472 472 else 473 473 { 474 475 { 476 477 478 474 while (lead(i[m])/var(n-1)==0) 475 { 476 m=m+1; 477 } 478 m=m-1; 479 479 } 480 480 //check whether i[m] =(c*var(n)+h)^e modulo prm for some … … 482 482 //if not (0) is returned, else var(n)+h is added to prm 483 483 484 485 486 487 488 489 490 491 492 493 494 484 e=deg(lead(i[m])); 485 t=leadcoef(i[m])*e*var(n)+(i[m]-lead(i[m]))/var(n)^(e-1); 486 487 i[m]=poly(e)^e*leadcoef(i[m])^(e-1)*i[m]; 488 489 if (reduce(i[m]-t^e,prm,1) !=0) 490 { 491 return(ideal(0)); 492 } 493 h=interred(t); 494 t=h[1]; 495 495 496 496 prm = prm,t; … … 530 530 continue; 531 531 } 532 533 532 534 533 if(size(l[2*i])==0) -
Singular/subexpr.cc
r56c52a7 ra3432c 94 94 if ((store!=NULL)&&(store!=this)) 95 95 store->CleanUp(); 96 96 97 97 switch (t /*=Typ()*/) 98 98 { … … 128 128 case RESOLUTION_CMD: 129 129 syPrint((syStrategy)d); 130 break; 130 break; 131 131 case STRING_CMD: 132 132 ::Print("%-*.*s%s",spaces,spaces," ",(char *)d); … … 138 138 { 139 139 procinfov pi=(procinfov)d; 140 141 142 143 144 145 146 //::Print("%-*.*s// ref : %s",spaces,spaces," ",147 148 140 ::Print("%-*.*s// libname : %s\n",spaces,spaces," ", 141 piProcinfo(pi, "libname")); 142 ::Print("%-*.*s// procname : %s\n",spaces,spaces," ", 143 piProcinfo(pi, "procname")); 144 ::Print("%-*.*s// type : %s",spaces,spaces," ", 145 piProcinfo(pi, "type")); 146 // ::Print("%-*.*s// ref : %s",spaces,spaces," ", 147 // piProcinfo(pi, "ref")); 148 break; 149 149 } 150 150 case POINTER_CMD: … … 213 213 { 214 214 PrintLn(); 215 } 215 } 216 216 #ifdef SIQ 217 217 if (rtyp!=COMMAND) … … 278 278 break; 279 279 case PROC_CMD: 280 281 280 piKill((procinfov)data); 281 break; 282 282 case LINK_CMD: 283 283 slKill((si_link)data); … … 313 313 #ifdef HAVE_RTIMER 314 314 case VRTIMER: 315 #endif 315 #endif 316 316 case VOICE: 317 317 case VMAXDEG: … … 327 327 default: 328 328 ::Print("CleanUp: unknown type %d\n",rtyp); /* DEBUG */ 329 #endif 329 #endif 330 330 } /* end switch: (rtyp) */ 331 331 data=NULL; … … 349 349 #ifdef HAVE_RTIMER 350 350 case VRTIMER: 351 #endif 351 #endif 352 352 case VOICE: 353 353 case VMAXDEG: … … 515 515 r->ref++; 516 516 data=d; 517 } 517 } 518 518 else 519 519 { 520 520 WerrorS("invalid ring description"); 521 } 521 } 522 522 break; 523 523 } … … 546 546 void * sleftv::CopyD(int t) 547 547 { 548 if (iiCheckRing(t))549 return NULL;550 548 if ((rtyp!=IDHDL)&&(e==NULL)) 551 549 { 550 if (iiCheckRing(t)) return NULL; 552 551 void *x=data; 553 552 if (rtyp==VNOETHER) x=(void *)pCopy(ppNoether); … … 559 558 return x; 560 559 } 561 void *d=Data(); 562 if ( !errorreported) return slInternalCopy(this,t,d,e);560 void *d=Data(); // will also do a iiCheckRing 561 if ((!errorreported) && (d!=NULL)) return slInternalCopy(this,t,d,e); 563 562 return NULL; 564 563 } … … 581 580 if ((a!=NULL) && (*a!=NULL)) 582 581 return (*a)->Copy(); 583 return NULL; 582 return NULL; 584 583 } 585 584 … … 664 663 { 665 664 return rString((ring)d); 666 } 665 } 667 666 default: 668 667 #ifdef TEST … … 694 693 #ifdef HAVE_RTIMER 695 694 case VRTIMER: 696 #endif 695 #endif 697 696 case VOICE: 698 697 case VMAXDEG: … … 702 701 return INT_CMD; 703 702 case LIB_CMD: 704 return STRING_CMD; 703 return STRING_CMD; 705 704 case VMINPOLY: 706 705 return NUMBER_CMD; … … 791 790 void * sleftv::Data() 792 791 { 793 if ( iiCheckRing(rtyp))792 if (rtyp!=IDHDL && iiCheckRing(rtyp)) 794 793 return NULL; 795 794 if (e==NULL) … … 823 822 if(h==NULL) return (void *)sNoName; 824 823 return IDSTRING(h); 825 } 824 } 826 825 case IDHDL: 827 826 return IDDATA((idhdl)data);
Note: See TracChangeset
for help on using the changeset viewer.