Changeset 9c19da in git
- Timestamp:
- Jul 24, 2007, 11:58:47 AM (17 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 94e04af50522d33463ebadf3874a50da60718e71
- Parents:
- c05b4689f61a550030ad7875a6d3867cac06ba4c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
rc05b46 r9c19da 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iparith.cc,v 1.45 2 2007-07-23 16:46:29 motsakExp $ */4 /* $Id: iparith.cc,v 1.453 2007-07-24 09:58:47 Singular Exp $ */ 5 5 6 6 /* … … 63 63 #endif 64 64 65 66 65 #include "ipshell.h" 67 68 66 #include "mpr_inout.h" 69 70 67 71 68 #ifdef HAVE_PLURAL … … 148 145 { 149 146 cmdnames *sCmds; /**< array of existing commands */ 150 151 147 #ifndef GENTABLE 152 148 struct sValCmd1 *psValCmd1; … … 155 151 struct sValCmdM *psValCmdM; 156 152 #endif /* GENTABLE */ 157 158 153 int nCmdUsed; /**< number of commands used */ 159 154 int nCmdAllocated; /**< number of commands-slots allocated */ … … 807 802 #ifdef HAVE_NS 808 803 idhdl packhdl; 809 810 804 switch(u->Typ()) 811 805 { … … 819 813 syMake(u,u->name,NULL); 820 814 // else: use next case !!! no break !!! 821 822 815 case PACKAGE_CMD: 823 816 packhdl = (idhdl)u->data; … … 840 833 memset(v, 0, sizeof(sleftv)); 841 834 break; 842 843 835 case DEF_CMD: 844 836 break; 845 846 837 default: 847 838 WerrorS("<package>::<id> expected"); … … 1009 1000 poly a; 1010 1001 poly b; 1011 1012 1002 if (v->next==NULL) 1013 1003 { … … 1393 1383 int i; 1394 1384 sleftv t; 1395 1396 1385 memset(&t,0,sizeof(t)); 1397 1386 t.rtyp=INT_CMD; … … 1721 1710 h=((poly)c->m[i].Data()); 1722 1711 if (pLmCmp(r,h)==0) 1723 { 1712 { 1724 1713 x[i]=pGetCoeff(h); 1725 1714 h=pLmFreeAndNext(h); … … 1752 1741 intvec* p=(intvec*)v->Data(); 1753 1742 int rl=p->length(); 1754 poly r=NULL,h; 1743 poly r=NULL,h; 1755 1744 ideal result; 1756 1745 ideal *x=(ideal *)omAlloc(rl*sizeof(ideal)); … … 1802 1791 poly p = pInit(); 1803 1792 int i; 1804 1805 1793 for (i=1; i<=pVariables; i++) 1806 1794 { … … 2125 2113 int p0=ABS(uu),p1=ABS(vv); 2126 2114 int r; 2127 2128 2115 while ( p1!=0 ) 2129 2116 { … … 2404 2391 return FALSE; 2405 2392 } 2406 2407 2393 #ifdef HAVE_PLURAL 2408 2394 static BOOLEAN jjPlural_num_poly(leftv res, leftv a, leftv b) … … 2410 2396 return nc_CallPlural(NULL,NULL,(poly)a->Data(),(poly)b->Data(),currRing); 2411 2397 } 2412 2413 2398 static BOOLEAN jjPlural_num_mat(leftv res, leftv a, leftv b) 2414 2399 { 2415 2400 return nc_CallPlural(NULL,(matrix)b->Data(),(poly)a->Data(),NULL,currRing); 2416 2401 } 2417 2418 2402 static BOOLEAN jjPlural_mat_poly(leftv res, leftv a, leftv b) 2419 2403 { 2420 2404 return nc_CallPlural((matrix)a->Data(),NULL,NULL,(poly)b->Data(),currRing); 2421 2405 } 2422 2423 2406 static BOOLEAN jjPlural_mat_mat(leftv res, leftv a, leftv b) 2424 2407 { 2425 2408 return nc_CallPlural((matrix)a->Data(),(matrix)b->Data(),NULL,NULL,currRing); 2426 2409 } 2427 2428 2410 static BOOLEAN jjBRACKET(leftv res, leftv a, leftv b) 2429 2411 { … … 2437 2419 return FALSE; 2438 2420 } 2439 2440 2421 static BOOLEAN jjOPPOSE(leftv res, leftv a, leftv b) 2441 2422 { … … 2548 2529 { 2549 2530 assumeStdFlag(v); 2550 ideal Q = currQuotient; 2551 2552 #ifdef HAVE_PLURAL 2553 // if(rIsSCA(currRing)) 2554 // Q = currRing->nc->SCAQuotient(); 2555 #endif 2556 2557 res->data = (char *)kNF((ideal)v->Data(),Q,(poly)u->Data()); 2531 res->data = (char *)kNF((ideal)v->Data(),currQuotient,(poly)u->Data()); 2558 2532 return FALSE; 2559 2533 } … … 2565 2539 ideal vi=(ideal)v->Data(); 2566 2540 idTest(vi); 2567 ideal Q = currQuotient; 2568 2569 #ifdef HAVE_PLURAL 2570 // if(rIsSCA(currRing)) 2571 // Q = currRing->nc->SCAQuotient(); 2572 #endif 2573 2574 res->data = (char *)kNF(vi,Q,ui); 2541 res->data = (char *)kNF(vi,currQuotient,ui); 2575 2542 return FALSE; 2576 2543 } … … 2611 2578 } 2612 2579 } 2613 2614 2580 intvec *ww=NULL; 2615 2581 int add_row_shift=0; … … 2737 2703 (*ww) -= add_row_shift; 2738 2704 } 2739 2740 2705 if ((iiOp == RES_CMD) || (iiOp == MRES_CMD)) 2741 2706 { … … 2979 2944 BITSET save_test=test; 2980 2945 test|=Sy_bit(OPT_SB_1); 2981 2982 ideal Q = currQuotient; 2983 2984 #ifdef HAVE_PLURAL 2985 // if(rIsSCA(currRing)) 2986 // Q = currRing->nc->SCAQuotient(); 2987 #endif 2988 2989 result=kStd(i1,Q,hom,&w,NULL,0,IDELEMS(i1)-ii0); 2946 result=kStd(i1,currQuotient,hom,&w,NULL,0,IDELEMS(i1)-ii0); 2990 2947 test=save_test; 2991 2948 idDelete(&i1); … … 3255 3212 ,{jjFIND2, FIND_CMD, INT_CMD, STRING_CMD, STRING_CMD ALLOW_PLURAL} 3256 3213 ,{jjFWALK, FWALK_CMD, IDEAL_CMD, RING_CMD, DEF_CMD NO_PLURAL} 3257 3258 3214 ,{jjGCD_I, GCD_CMD, INT_CMD, INT_CMD, INT_CMD ALLOW_PLURAL} 3259 3215 ,{jjGCD_N, GCD_CMD, NUMBER_CMD, NUMBER_CMD, NUMBER_CMD ALLOW_PLURAL} … … 3487 3443 nlDelete(&n,NULL); 3488 3444 return bo; 3489 } 3445 } 3490 3446 } 3491 3447 static BOOLEAN jjBI2P(leftv res, leftv u) … … 3899 3855 static BOOLEAN jjINTERRED(leftv res, leftv v) 3900 3856 { 3901 ideal Q = currQuotient; 3902 3903 #ifdef HAVE_PLURAL 3904 // if(rIsSCA(currRing)) 3905 // Q = currRing->nc->SCAQuotient(); 3906 #endif 3907 3908 ideal result=kInterRed((ideal)(v->Data()), Q); 3857 ideal result=kInterRed((ideal)(v->Data()), currQuotient); 3909 3858 if (TEST_OPT_PROT) { PrintLn(); mflush(); } 3910 3859 res->data = result; … … 4049 3998 res->data = (char *)jjLONG2N(om_Info.MaxBytesSystem); 4050 3999 break; 4051 4052 4000 default: 4053 4001 omPrintStats(stdout); … … 4082 4030 int t=v->Typ(); 4083 4031 ideal r,m; 4084 ideal Q = currQuotient; 4085 4086 #ifdef HAVE_PLURAL 4087 // if(rIsSCA(currRing)) 4088 // Q = currRing->nc->SCAQuotient(); 4089 #endif 4090 4091 r=kMin_std((ideal)v->Data(),Q,testHomog,NULL,m); 4032 r=kMin_std((ideal)v->Data(),currQuotient,testHomog,NULL,m); 4092 4033 lists l=(lists)omAllocBin(slists_bin); 4093 4034 l->Init(2); … … 4322 4263 #else 4323 4264 const bool bIsSCA = false; 4324 #endif 4325 4265 #endif 4266 4326 4267 if ((currQuotient!=NULL) && !bIsSCA) 4327 4268 { … … 4379 4320 } 4380 4321 } 4381 ideal Q = currQuotient; 4382 4383 #ifdef HAVE_PLURAL 4384 // if(rIsSCA(currRing)) 4385 // Q = currRing->nc->SCAQuotient(); 4386 #endif 4387 4388 result=kStd(v_id,Q,hom,&w); 4322 result=kStd(v_id,currQuotient,hom,&w); 4389 4323 idSkipZeroes(result); 4390 4324 res->data = (char *)result; … … 4446 4380 return FALSE; 4447 4381 } 4448 4449 4382 #ifdef HAVE_PLURAL 4450 4451 4383 static BOOLEAN jjOPPOSITE(leftv res, leftv a) 4452 4384 { … … 4459 4391 return FALSE; 4460 4392 } 4461 4462 4393 static BOOLEAN jjENVELOPE(leftv res, leftv a) 4463 4394 { … … 4483 4414 return FALSE; 4484 4415 } 4485 4486 4416 static BOOLEAN jjTWOSTD(leftv res, leftv a) 4487 4417 { … … 5804 5734 { 5805 5735 assumeStdFlag(v); 5806 ideal Q = currQuotient; 5807 5808 #ifdef HAVE_PLURAL 5809 // if(rIsSCA(currRing)) 5810 // Q = currRing->nc->SCAQuotient(); 5811 #endif 5812 5813 res->data = (char *)kNF((ideal)v->Data(),Q,(poly)u->Data(), 5736 res->data = (char *)kNF((ideal)v->Data(),currQuotient,(poly)u->Data(), 5814 5737 0,(int)(long)w->Data()); 5815 5738 return FALSE; … … 5818 5741 { 5819 5742 assumeStdFlag(v); 5820 ideal Q = currQuotient; 5821 5822 #ifdef HAVE_PLURAL 5823 // if(rIsSCA(currRing)) 5824 // Q = currRing->nc->SCAQuotient(); 5825 #endif 5826 5827 5828 res->data = (char *)kNF((ideal)v->Data(),Q,(ideal)u->Data(), 5743 res->data = (char *)kNF((ideal)v->Data(),currQuotient,(ideal)u->Data(), 5829 5744 0,(int)(long)w->Data()); 5830 5745 return FALSE; … … 7952 7867 memcpy(&d->arg2,a->next,sizeof(sleftv)); 7953 7868 a->next->Init(); 7954 7869 a->next->next=d->arg2.next; 7955 7870 d->arg2.next=NULL; 7956 7871 /* no break */ 7957 7872 case 1: 7958 7873 a->Init(); 7959 7874 a->next=d->arg1.next; 7960 7875 d->arg1.next=NULL; 7961 7876 } 7962 7877 if (d->argc>3) a->next=NULL; 7963 7878 a->name=NULL; 7964 7879 a->rtyp=0;
Note: See TracChangeset
for help on using the changeset viewer.