Changeset 7a5e7c in git for Singular/polys.cc


Ignore:
Timestamp:
Jun 12, 1998, 7:41:42 PM (26 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
Children:
069fcf4380789e4c2f33f5e235d901d02dd871ba
Parents:
60c7ad1963149772ccf27f5cca2b5ea93c1030d1
Message:
	* polys.cc: pComp for simple orderings based on only three
	routines (no variation for # of variables)

	* spolys0.cc (spGSpolyLoop): globally replaced by spSpolyLoop_General


git-svn-id: file:///usr/local/Singular/svn/trunk@2135 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/polys.cc

    r60c7ad r7a5e7c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys.cc,v 1.29 1998-06-12 10:13:36 Singular Exp $ */
     4/* $Id: polys.cc,v 1.30 1998-06-12 17:41:33 obachman Exp $ */
    55
    66/*
     
    164164}
    165165
    166 static int pComp_otEXP_nwONE(poly p1, poly p2);
    167 static int pComp_otCOMPEXP_nwONE(poly p1, poly p2);
    168 static int pComp_otEXPCOMP_nwONE(poly p1, poly p2);
    169 static int pComp_otEXP_nwTWO(poly p1, poly p2);
    170 static int pComp_otCOMPEXP_nwTWO(poly p1, poly p2);
    171 static int pComp_otEXPCOMP_nwTWO(poly p1, poly p2);
    172 static int pComp_otEXP_nwEVEN(poly p1, poly p2);
    173 static int pComp_otCOMPEXP_nwEVEN(poly p1, poly p2);
    174 static int pComp_otEXPCOMP_nwEVEN(poly p1, poly p2);
    175 static int pComp_otEXP_nwODD(poly p1, poly p2);
    176 static int pComp_otCOMPEXP_nwODD(poly p1, poly p2);
    177 static int pComp_otEXPCOMP_nwODD(poly p1, poly p2);
    178 
    179 
    180 // comp_nwONE is used if pVariables1W == 1 and component is compatible
    181 // with ordering
    182 static int pComp_otEXP_nwONE(poly p1, poly p2)
     166
     167static int pComp_otEXP(poly p1, poly p2);
     168static int pComp_otCOMPEXP(poly p1, poly p2);
     169static int pComp_otEXPCOMP(poly p1, poly p2);
     170
     171static int pComp_otEXP(poly p1, poly p2)
    183172{
    184173  register long d = pGetOrder(p1) - pGetOrder(p2);
    185 
    186174  if (d) Mreturn(d, pOrdSgn);
    187   _pMonComp_otEXP_nwONE(p1, p2, d, goto NotEqual, return 0);
    188 
     175
     176  _pMonComp_otEXP_nwGEN(p1, p2,  pVariables1W, d, goto NotEqual , return 0);
     177 
    189178  NotEqual:
    190179  Mreturn(d, pLexSgn);
    191180}
    192181
    193 // comp_otEXPCOMP_nwONE :  pVariables1W == 1, priority is
    194 // given to exponents, component is incompatible with ordering
    195 static int pComp_otEXPCOMP_nwONE(poly p1, poly p2)
    196 {
    197   register long d = pGetOrder(p1) - pGetOrder(p2);
    198 
    199   if (d) Mreturn(d, pOrdSgn);
    200   _pMonComp_otEXPCOMP_nwONE(p1, p2, d, goto NotEqual , return 0);
    201 
    202   NotEqual:
    203   Mreturn(d, pLexSgn)
    204 }
    205 
    206 // comp_otEXPCOMP_nwONE :  pVariables1W == 1, priority is given to component,
    207 // component is incompatible with ordering
    208 static int pComp_otCOMPEXP_nwONE(poly p1, poly p2)
     182static int pComp_otCOMPEXP(poly p1, poly p2)
    209183{
    210184  register long d = pGetComp(p2) - pGetComp(p1);
    211185  if (d) Mreturn(d, pComponentOrder);
     186
    212187  d = pGetOrder(p1) - pGetOrder(p2);
    213188  if (d) Mreturn(d, pOrdSgn);
    214   _pMonComp_otEXP_nwONE(p1, p2, d, goto NotEqual , return 0);
    215 
     189
     190  _pMonComp_otEXP_nwGEN(p1, p2,  pVariablesW, d, goto NotEqual , return 0);
     191 
    216192  NotEqual:
    217193  Mreturn(d, pLexSgn);
    218194}
    219195
    220 // comp_nwTWO :  pVariables1W == 2 and component is compatible with ordering
    221 static int pComp_otEXP_nwTWO(poly p1, poly p2)
     196static int pComp_otEXPCOMP(poly p1, poly p2)
    222197{
    223198  register long d = pGetOrder(p1) - pGetOrder(p2);
    224 
    225199  if (d) Mreturn(d, pOrdSgn);
    226   _pMonComp_otEXP_nwTWO(p1, p2, d, goto NotEqual , return 0);
    227 
     200
     201  _pMonComp_otEXPCOMP_nwGEN(p1, p2,  pVariables1W, d, goto NotEqual , return 0);
     202 
    228203  NotEqual:
    229204  Mreturn(d, pLexSgn);
    230205}
    231206
    232 // comp_otEXPCOMP_nwTWO :  pVariables1W == 2, priority is given to exponents,
    233 // component is incompatible with ordering
    234 static int pComp_otEXPCOMP_nwTWO(poly p1, poly p2)
    235 {
    236   register long d = pGetOrder(p1) - pGetOrder(p2);
    237 
    238   if (d) Mreturn(d, pOrdSgn);
    239   _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, goto NotEqual, return 0);
    240 
    241   NotEqual:
    242   Mreturn(d, pLexSgn);
    243 }
    244 
    245 // comp_otEXPCOMP_nwTWO :  pVariables1W == 2, priority is given to component,
    246 // component is incompatible with ordering
    247 static int pComp_otCOMPEXP_nwTWO(poly p1, poly p2)
    248 {
    249   register long d = pGetComp(p2) - pGetComp(p1);
    250   if (d) Mreturn(d, pComponentOrder);
    251   d = pGetOrder(p1) - pGetOrder(p2);
    252   if (d) Mreturn(d, pOrdSgn);
    253   _pMonComp_otEXP_nwTWO(p1, p2, d, goto NotEqual , return 0);
    254 
    255   NotEqual:
    256   Mreturn(d, pLexSgn);
    257 }
    258 
    259 // comp_nwEVEN :  pVariables1W == 2*i and component is compatible
    260 // with ordering
    261 static int pComp_otEXP_nwEVEN(poly p1, poly p2)
    262 {
    263   register long d = pGetOrder(p1) - pGetOrder(p2);
    264 
    265   if (d) Mreturn(d, pOrdSgn);
    266   _pMonComp_otEXP_nwEVEN(p1, p2, pVariables1W, d, goto NotEqual , return 0);
    267 
    268   NotEqual:
    269   Mreturn(d, pLexSgn);
    270 }
    271 
    272 // comp_otEXPCOMP_nwEVEN : pVariables1W == 2*i, priority is given to exponents,
    273 // component is incompatible with ordering
    274 static int pComp_otEXPCOMP_nwEVEN(poly p1, poly p2)
    275 {
    276   register long d = pGetOrder(p1) - pGetOrder(p2);
    277 
    278   if (d) Mreturn(d, pOrdSgn);
    279   _pMonComp_otEXPCOMP_nwEVEN(p1, p2, pVariables1W, d, goto NotEqual , return 0);
    280 
    281   NotEqual:
    282   Mreturn(d, pLexSgn);
    283 }
    284 
    285 // comp_otEXPCOMP_nwEVEN : pVariables1W == 2*i, priority is given to component,
    286 // component is incompatible with ordering
    287 static int pComp_otCOMPEXP_nwEVEN(poly p1, poly p2)
    288 {
    289   register long d = pGetComp(p2) - pGetComp(p1);
    290   if (d) Mreturn(d, pComponentOrder);
    291   d = pGetOrder(p1) - pGetOrder(p2);
    292   if (d) Mreturn(d, pOrdSgn);
    293   _pMonComp_otEXP_nwEVEN(p1, p2, pVariablesW, d, goto NotEqual, return 0);
    294 
    295   NotEqual:
    296   Mreturn(d, pLexSgn);
    297 }
    298 
    299 // comp_nwODD : pVariables1W == 2*i and component is compatible
    300 // with ordering
    301 static int pComp_otEXP_nwODD(poly p1, poly p2)
    302 {
    303   register long d = pGetOrder(p1) - pGetOrder(p2);
    304 
    305   if (d) Mreturn(d, pOrdSgn);
    306   _pMonComp_otEXP_nwODD(p1, p2, pVariables1W, d, goto NotEqual, return 0);
    307 
    308   NotEqual:
    309   Mreturn(d, pLexSgn);
    310 }
    311 
    312 // comp_otEXPCOMP_nwODD : pVariables1W == 2*i, priority is given to exponents,
    313 // component is incompatible with ordering
    314 static int pComp_otEXPCOMP_nwODD(poly p1, poly p2)
    315 {
    316   register long d = pGetOrder(p1) - pGetOrder(p2);
    317   if (d)
    318   {
    319     if (d > 0) return pOrdSgn;
    320     return -pOrdSgn;
    321   }
    322 
    323   _pMonComp_otEXPCOMP_nwODD(p1, p2, pVariables1W, d, goto NotEqual , return 0);
    324 
    325   NotEqual:
    326   Mreturn(d, pLexSgn);
    327 }
    328 
    329 // comp_otCOMPEXP_nwODD : pVariables1W == 2*i, priority is given to component,
    330 // component is incompatible with ordering
    331 static int pComp_otCOMPEXP_nwODD(poly p1, poly p2)
    332 {
    333   register long d = pGetComp(p2) - pGetComp(p1);
    334   if (d) Mreturn(d, pComponentOrder);
    335   d = pGetOrder(p1) - pGetOrder(p2);
    336   if (d) Mreturn(d, pOrdSgn);
    337   _pMonComp_otEXP_nwODD(p1, p2, pVariablesW, d, goto NotEqual, return 0);
    338 
    339   NotEqual:
    340   Mreturn(d, pLexSgn);
    341 }
     207/*---------------------------------------------------*/
     208
    342209/*2
    343210* compare the head monomial of p1 and p2 with weight vector
     
    353220}
    354221
    355 /*---------------------------------------------------*/
    356222
    357223/* These functions could be made faster if you use pointers to the
     
    1119985        if (comp_order == ringorder_C || o_r == ringorder_unspec)
    1120986        {
    1121           if (pVariables1W == 1)        *p = pComp_otEXPCOMP_nwONE;
    1122           else if (pVariables1W == 2)   *p = pComp_otEXPCOMP_nwTWO;
    1123           else if (pVariables1W & 1)    *p = pComp_otEXPCOMP_nwODD;
    1124           else                          *p = pComp_otEXPCOMP_nwEVEN;
     987          *p = pComp_otEXPCOMP;
    1125988        }
    1126989        else
    1127990        {
    1128991          // component is compatible with exponent vector
    1129           if (pVariables1W == 1)        *p = pComp_otEXP_nwONE;
    1130           else if (pVariables1W == 2)   *p = pComp_otEXP_nwTWO;
    1131           else if (pVariables1W & 1)    *p = pComp_otEXP_nwODD;
    1132           else                          *p = pComp_otEXP_nwEVEN;
     992          *p = pComp_otEXP;
    1133993        }
    1134994        break;
     
    11471007        if (comp_order == ringorder_c)
    11481008        {
    1149           if (pVariables1W == 1)        *p = pComp_otEXPCOMP_nwONE;
    1150           else if (pVariables1W == 2)   *p = pComp_otEXPCOMP_nwTWO;
    1151           else if (pVariables1W & 1)    *p = pComp_otEXPCOMP_nwODD;
    1152           else                          *p = pComp_otEXPCOMP_nwEVEN;
     1009          *p = pComp_otEXPCOMP;
    11531010        }
    11541011        else
    11551012        {
    11561013          // component is compatible with exponent vector
    1157           if (pVariables1W == 1)        *p = pComp_otEXP_nwONE;
    1158           else if (pVariables1W == 2)   *p = pComp_otEXP_nwTWO;
    1159           else if (pVariables1W & 1)    *p = pComp_otEXP_nwODD;
    1160           else                          *p = pComp_otEXP_nwEVEN;
     1014          *p = pComp_otEXP;
    11611015        }
    11621016#ifdef PDEBUG
     
    11921046        pSetVarIndicies_RevLex(pVariables);
    11931047        pLexSgn = -1;
    1194         if (pVariablesW == 1)
    1195           *p = pComp_otCOMPEXP_nwONE;
    1196         else if (pVariablesW == 2)
    1197           *p = pComp_otCOMPEXP_nwTWO;
    1198         else if (pVariablesW & 1)
    1199           *p = pComp_otCOMPEXP_nwODD;
    1200         else
    1201           *p = pComp_otCOMPEXP_nwEVEN;
     1048        *p = pComp_otCOMPEXP;
    12021049        break;
    12031050
     
    12131060        pSetVarIndicies_Lex(pVariables);
    12141061        pLexSgn = 1;
    1215         if (pVariablesW == 1)
    1216           *p = pComp_otCOMPEXP_nwONE;
    1217         else if (pVariablesW == 2)
    1218           *p = pComp_otCOMPEXP_nwTWO;
    1219         else if (pVariablesW & 1)
    1220           *p = pComp_otCOMPEXP_nwODD;
    1221         else
    1222           *p = pComp_otCOMPEXP_nwEVEN;
     1062        *p = pComp_otCOMPEXP;
    12231063#ifdef PDEBUG
    12241064        break;
Note: See TracChangeset for help on using the changeset viewer.