Changeset ac00e2f in git


Ignore:
Timestamp:
May 14, 2014, 4:02:50 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
Children:
0f74a1d360bc1f2c80ba740d66bcf0a755b6e43d
Parents:
8b5fff53b54b8c7889b6490e4871793cfd8e4efe
Message:
removed currQuotient
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • Singular/dyn_modules/syzextra/mod_main.cc

    r8b5fff rac00e2f  
    3030#include <Singular/attrib.h>
    3131
    32 #include <Singular/ipid.h> 
     32#include <Singular/ipid.h>
    3333#include <Singular/ipshell.h> // For iiAddCproc
    3434
     
    4545
    4646
    47 #if GOOGLE_PROFILE_ENABLED 
     47#if GOOGLE_PROFILE_ENABLED
    4848#include <google/profiler.h>
    49 #endif // #if GOOGLE_PROFILE_ENABLED 
     49#endif // #if GOOGLE_PROFILE_ENABLED
    5050
    5151
     
    8484
    8585  const char *usage = "'ClearContent' needs a (non-zero!) poly or vector argument...";
    86  
     86
    8787  if( h == NULL )
    8888  {
     
    100100
    101101  assume (h->Next() == NULL);
    102  
     102
    103103  poly ph = reinterpret_cast<poly>(h->Data());
    104  
     104
    105105  if( ph == NULL )
    106106  {
     
    108108    return TRUE;
    109109  }
    110  
     110
    111111  const ring r =  currRing;
    112112  assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf;
     
    185185  }
    186186
    187   return (_n); 
     187  return (_n);
    188188}
    189189
     
    201201  {
    202202    const char* name = (char*)(h->Data());
    203     assume( name != NULL );   
     203    assume( name != NULL );
    204204    ProfilerStart(name);
    205205  } else
    206     WerrorS("ProfilerStart requires a string [name] argument"); 
     206    WerrorS("ProfilerStart requires a string [name] argument");
    207207#else
    208208  WarnS("Sorry no google profiler support (GOOGLE_PROFILE_ENABLE!=1)...");
     
    249249}
    250250
    251                    
     251
    252252
    253253static BOOLEAN DetailedPrint(leftv __res, leftv h)
     
    263263  if( h->Typ() == NUMBER_CMD)
    264264  {
    265     number n = (number)h->Data(); 
     265    number n = (number)h->Data();
    266266
    267267    const ring r = currRing;
     
    278278    return FALSE;
    279279  }
    280  
     280
    281281  if( h->Typ() == RING_CMD)
    282282  {
     
    301301  if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
    302302  {
    303     const ideal id = (const ideal)h->Data(); h = h->Next(); 
     303    const ideal id = (const ideal)h->Data(); h = h->Next();
    304304
    305305    dPrint(id, currRing, currRing, getOptionalInteger(h, 3));
    306    
    307     return FALSE;           
     306
     307    return FALSE;
    308308  }
    309309
     
    344344    if (r == NULL)
    345345      Print("ring '%10s': NULL", "syRing");
    346     else 
     346    else
    347347      if (r == currRing)
    348348        Print("ring '%10s': currRing", "syRing");
     
    356356#endif
    357357          // rChangeCurrRing(r);
    358         }           
     358        }
    359359    PrintLn();
    360360
     
    489489
    490490    h = h->Next(); assume (h == NULL);
    491    
     491
    492492    return FALSE;
    493493  }
     
    495495  if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
    496496  {
    497     res->data = id_Tail( (const ideal)h->Data(), r );     
     497    res->data = id_Tail( (const ideal)h->Data(), r );
    498498    res->rtyp = h->Typ();
    499    
     499
    500500    h = h->Next(); assume (h == NULL);
    501    
     501
    502502    return FALSE;
    503503  }
     
    512512{
    513513  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
    514      
     514
    515515  const BOOLEAN __DEBUG__      = attributes.__DEBUG__;
    516516//  const BOOLEAN __SYZCHECK__   = attributes.__SYZCHECK__;
     
    528528  }
    529529
    530   assume( h != NULL ); 
     530  assume( h != NULL );
    531531
    532532  if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
     
    538538    if( __DEBUG__ )
    539539    {
    540       PrintS("ComputeLeadingSyzygyTerms::Input: \n");     
     540      PrintS("ComputeLeadingSyzygyTerms::Input: \n");
    541541      dPrint(id, r, r, 1);
    542542    }
    543    
     543
    544544    assume( !__LEAD2SYZ__ );
    545545
     
    547547
    548548    const ideal newid = ComputeLeadingSyzygyTerms(id,  attributes);
    549    
     549
    550550    res->data = newid; res->rtyp = MODUL_CMD;
    551551    return FALSE;
     
    580580  }
    581581
    582   assume( h != NULL ); 
     582  assume( h != NULL );
    583583
    584584  if(    (h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
    585585      && (h->rtyp  == IDHDL) // must be a variable!
    586586      && (h->e == NULL) // not a list element
    587       ) 
     587      )
    588588  {
    589589    const ideal id = (const ideal)h->Data();
     
    594594    {
    595595      PrintS("Sort_c_ds::Input: \n");
    596       dPrint(id, r, r, 1);     
     596      dPrint(id, r, r, 1);
    597597    }
    598598
     
    605605//    res->data = id;
    606606//    res->rtyp = h->Typ();
    607    
     607
    608608    if( __DEBUG__ )
    609609    {
     
    617617
    618618  WarnS("ComputeLeadingSyzygyTerms needs a single ideal/module argument (must be a variable!)...");
    619   return TRUE; 
     619  return TRUE;
    620620}
    621621
     
    640640  }
    641641
    642   assume( h != NULL ); 
     642  assume( h != NULL );
    643643
    644644  assume( __LEAD2SYZ__ ); // ???
    645  
     645
    646646  if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
    647647  {
     
    690690  {
    691691    WerrorS(usage);
    692     return TRUE;   
    693   }
    694    
     692    return TRUE;
     693  }
     694
    695695  const poly product = (poly) h->Data(); assume (product != NULL);
    696696
     
    700700  {
    701701    WerrorS(usage);
    702     return TRUE;   
     702    return TRUE;
    703703  }
    704704
    705705  poly syzterm = NULL;
    706706
    707   if(h->Typ()==VECTOR_CMD) 
     707  if(h->Typ()==VECTOR_CMD)
    708708    syzterm = (poly) h->Data();
    709709
     
    714714  {
    715715    WerrorS(usage);
    716     return TRUE;   
    717   }
    718  
     716    return TRUE;
     717  }
     718
    719719  const ideal L = (ideal) h->Data(); h = h->Next();
    720720
     
    758758    PrintS("FindReducer::Output: \n");
    759759    dPrint((poly)res->data, r, r, 2);
    760   }   
    761  
    762   return FALSE;   
    763  
     760  }
     761
     762  return FALSE;
     763
    764764}
    765765
     
    781781
    782782  assume( __HYBRIDNF__ ); // ???
    783  
     783
    784784  if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL))
    785785  {
    786786    WerrorS(usage);
    787     return TRUE;   
     787    return TRUE;
    788788  }
    789789
     
    795795  {
    796796    WerrorS(usage);
    797     return TRUE;   
     797    return TRUE;
    798798  }
    799799
     
    804804  {
    805805    WerrorS(usage);
    806     return TRUE;   
     806    return TRUE;
    807807  }
    808808
     
    814814  {
    815815    WerrorS(usage);
    816     return TRUE;   
     816    return TRUE;
    817817  }
    818818
     
    851851      PrintS("LS: "); dPrint(LS, r, r, 0);
    852852    }
    853   } 
    854  
     853  }
     854
    855855  res->rtyp = VECTOR_CMD;
    856856  res->data = SchreyerSyzygyNF(syz_lead,
     
    889889  {
    890890    WerrorS(usage);
    891     return TRUE;   
     891    return TRUE;
    892892  }
    893893
    894894  const poly multiplier = (poly) h->Data(); assume (multiplier != NULL);
    895895
    896  
     896
    897897  h = h->Next();
    898898  if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL))
    899899  {
    900900    WerrorS(usage);
    901     return TRUE;   
     901    return TRUE;
    902902  }
    903903
    904904  const poly term4reduction = (poly) h->Data(); assume( term4reduction != NULL );
    905905
    906  
     906
    907907  poly syztermCheck = NULL;
    908  
     908
    909909  h = h->Next();
    910910  if ((h==NULL) || !((h->Typ()==VECTOR_CMD) || (h->Data() == NULL)) )
    911911  {
    912912    WerrorS(usage);
    913     return TRUE;   
    914   }
    915 
    916   if(h->Typ()==VECTOR_CMD) 
     913    return TRUE;
     914  }
     915
     916  if(h->Typ()==VECTOR_CMD)
    917917    syztermCheck = (poly) h->Data();
    918918
    919  
     919
    920920  h = h->Next();
    921921  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
    922922  {
    923923    WerrorS(usage);
    924     return TRUE;   
     924    return TRUE;
    925925  }
    926926
    927927  const ideal L = (ideal) h->Data(); assume( IDELEMS(L) > 0 );
    928928
    929  
     929
    930930  h = h->Next();
    931931  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
    932932  {
    933933    WerrorS(usage);
    934     return TRUE;   
     934    return TRUE;
    935935  }
    936936
     
    960960    PrintS("t: "); dPrint(term4reduction, r, r, 2);
    961961    PrintS("syzterm: "); dPrint(syztermCheck, r, r, 2);
    962    
     962
    963963    PrintS("L: "); dPrint(L, r, r, 0);
    964964    PrintS("T: "); dPrint(T, r, r, 0);
     
    977977    const int c = p_GetComp(syztermCheck, r) - 1;
    978978    assume( c >= 0 && c < IDELEMS(L) );
    979    
     979
    980980    const poly p = L->m[c];
    981     assume( p != NULL ); assume( pNext(p) == NULL );   
     981    assume( p != NULL ); assume( pNext(p) == NULL );
    982982
    983983    assume( p_EqualPolys(term4reduction, p, r) ); // assume? TODO
     
    989989    assume( p_EqualPolys(multiplier, m, r) ); // assume? TODO
    990990
    991     p_Delete(&m, r);   
    992    
     991    p_Delete(&m, r);
     992
    993993// NOTE:   leadmonomial(syzterm) == m &&  L[leadcomp(syzterm)] == t
    994994  }
     
    10041004    dPrint((poly)res->data, r, r, 2);
    10051005  }
    1006  
    1007  
     1006
     1007
    10081008  return FALSE;
    10091009}
     
    10311031  {
    10321032    WerrorS(usage);
    1033     return TRUE;   
     1033    return TRUE;
    10341034  }
    10351035
     
    10401040  {
    10411041    WerrorS(usage);
    1042     return TRUE;   
    1043   }
    1044 
    1045   const poly tail = (poly) h->Data(); 
     1042    return TRUE;
     1043  }
     1044
     1045  const poly tail = (poly) h->Data();
    10461046
    10471047  h = h->Next();
     
    10501050  {
    10511051    WerrorS(usage);
    1052     return TRUE;   
     1052    return TRUE;
    10531053  }
    10541054
     
    10611061  {
    10621062    WerrorS(usage);
    1063     return TRUE;   
     1063    return TRUE;
    10641064  }
    10651065
     
    10691069
    10701070  h = h->Next();
    1071  
     1071
    10721072  ideal LS = NULL;
    10731073
     
    11181118{
    11191119  const SchreyerSyzygyComputationFlags attributes(currRingHdl);
    1120    
     1120
    11211121  const BOOLEAN __DEBUG__      = attributes.__DEBUG__;
    1122    
     1122
    11231123  const char* usage = "`ComputeResolution(<ideal/module>[,int])` expected";
    11241124  const ring r = attributes.m_rBaseRing;
     
    11301130  {
    11311131    WerrorS(usage);
    1132     return TRUE;   
     1132    return TRUE;
    11331133  }
    11341134
     
    11441144  {
    11451145    WerrorS(usage);
    1146     return TRUE;   
    1147   }
    1148  
     1146    return TRUE;
     1147  }
     1148
    11491149  ideal L = (ideal)(h->CopyD()); // no copy!
    11501150  assume( IDELEMS(L) == size );
    1151  
     1151
    11521152  h = h->Next();
    11531153  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
    11541154  {
    11551155    WerrorS(usage);
    1156     return TRUE;   
     1156    return TRUE;
    11571157  }
    11581158
    11591159  ideal T = (ideal)(h->CopyD()); // no copy!
    11601160  assume( IDELEMS(T) == size );
    1161  
     1161
    11621162  h = h->Next();
    11631163
    11641164  // length..?
    11651165  long length = 0;
    1166  
     1166
    11671167  if ((h!=NULL) && (h->Typ()==INT_CMD))
    11681168  {
     
    11701170    h = h->Next();
    11711171  }
    1172  
     1172
    11731173  assume( h == NULL );
    11741174
    11751175  if( length <= 0 )
    1176     length = 1 + rVar(r); 
     1176    length = 1 + rVar(r);
    11771177
    11781178  if( __DEBUG__ )
     
    11871187
    11881188  syStrategy _res=(syStrategy)omAlloc0(sizeof(ssyStrategy));
    1189  
     1189
    11901190//  class ssyStrategy; typedef ssyStrategy * syStrategy;
    11911191//  typedef ideal *            resolvente;
     
    11981198//  if (attributes.__TREEOUTPUT__)
    11991199//    Print("{ \"RESOLUTION: HYBRIDNF:%d, TAILREDSYZ: %d, LEAD2SYZ: %d, IGNORETAILS: %d\": [\n", attributes.__HYBRIDNF__, attributes.__TAILREDSYZ__, attributes.__LEAD2SYZ__, attributes.__IGNORETAILS__);
    1200    
     1200
    12011201  while( (!idIs0(L)) && (index < length))
    12021202  {
    12031203    attributes.nextSyzygyLayer();
    1204     ideal LL, TT; 
    1205      
     1204    ideal LL, TT;
     1205
    12061206    ComputeSyzygy(L, T, LL, TT, attributes);
    12071207
     
    12151215
    12161216    assume( size == IDELEMS(TT) );
    1217    
     1217
    12181218    id_Delete(&L, r); id_Delete(&T, r);
    12191219
    12201220    L = LL; T = TT;
    1221    
     1221
    12221222    // id_Add(T, L, r);
    12231223    M = idInit(size, 0);
     
    12271227    }
    12281228    M->rank = id_RankFreeModule(M, r);
    1229    
     1229
    12301230    if( __DEBUG__ )
    12311231    {
     
    12331233      PrintS("M = LL + TT: \n"); dPrint(M, r, r, 0);
    12341234    }
    1235  
     1235
    12361236    _res->fullres[index++] = M; // ???
    12371237  }
     
    12401240
    12411241  id_Delete(&L, r); id_Delete(&T, r);
    1242  
     1242
    12431243  res->data = _res;
    12441244  res->rtyp = RESOLUTION_CMD;
     
    12531253
    12541254//  omFreeSize(_res, sizeof(ssyStrategy));
    1255  
     1255
    12561256  return FALSE;
    12571257
     
    12801280  {
    12811281    WerrorS(usage);
    1282     return TRUE;   
     1282    return TRUE;
    12831283  }
    12841284
     
    12911291  {
    12921292    WerrorS(usage);
    1293     return TRUE;   
     1293    return TRUE;
    12941294  }
    12951295
     
    12981298
    12991299
    1300   h = h->Next(); assume( h == NULL ); 
     1300  h = h->Next(); assume( h == NULL );
    13011301
    13021302  if( __DEBUG__ )
     
    13171317
    13181318  l->m[1].rtyp = MODUL_CMD; l->m[1].data = reinterpret_cast<void *>(TT);
    1319  
     1319
    13201320  res->data = l; res->rtyp = LIST_CMD;
    1321  
     1321
    13221322  if( __DEBUG__ )
    13231323  {
     
    13741374    } else
    13751375      res->data = reinterpret_cast<void *>(jjLONG2N(0));
    1376      
     1376
    13771377
    13781378    res->rtyp = BIGINT_CMD;
     
    14321432  res->data = reinterpret_cast<void *>(rAssure_SyzComp(currRing, TRUE));
    14331433  res->rtyp = RING_CMD; // return new ring!
    1434   // QRING_CMD? 
     1434  // QRING_CMD?
    14351435
    14361436  return FALSE;
     
    14551455    }
    14561456
    1457     sign = s;           
     1457    sign = s;
    14581458  }
    14591459
     
    14611461  res->data = reinterpret_cast<void *>(rAssure_InducedSchreyerOrdering(currRing, TRUE, sign));
    14621462  res->rtyp = RING_CMD; // return new ring!
    1463   // QRING_CMD? 
     1463  // QRING_CMD?
    14641464  return FALSE;
    14651465}
     
    15211521
    15221522
    1523  
     1523
    15241524  lists l=(lists)omAllocBin(slists_bin);
    15251525  l->Init(2);
     
    15521552
    15531553
    1554 /* // the following turned out to be unnecessary...   
     1554/* // the following turned out to be unnecessary...
    15551555/// Finds p^th AM ordering, and returns its position in r->typ[] AND
    15561556/// corresponding &r->wvhdl[]
     
    16051605// {
    16061606//   NoReturn(res);
    1607 // 
     1607//
    16081608//   const ring r = currRing;
    1609 // 
     1609//
    16101610//   int p = 0; // which IS-block? p^th!
    1611 // 
     1611//
    16121612//   if ((h!=NULL) && (h->Typ()==INT_CMD))
    16131613//     p = (int)((long)(h->Data())); h=h->next;
    1614 // 
     1614//
    16151615//   assume(p >= 0);
    1616 // 
     1616//
    16171617//   int d, w;
    1618 //   
     1618//
    16191619//   if( !rGetAMPos(r, p, d, w, TRUE) )
    16201620//   {
     
    16221622//     return TRUE;
    16231623//   }
    1624 // 
     1624//
    16251625//   assume( r->typ[d].ord_typ == ro_am );
    16261626//   assume( r->order[w] == ringorder_am );
    1627 // 
    1628 // 
     1627//
     1628//
    16291629//   const short start = r->typ[d].data.am.start;  // bounds of ordering (in E)
    16301630//   const short end = r->typ[d].data.am.end;
     
    16321632//   const int *weights = r->typ[d].data.am.weights; // pointers into wvhdl field of length (end-start+1) + len_gen
    16331633//   // contents w_1,... w_n, len, mod_w_1, .. mod_w_len, 0
    1634 // 
     1634//
    16351635//   assume( weights == r->wvhdl[w] );
    1636 // 
    1637 //   
     1636//
     1637//
    16381638//   lists l=(lists)omAllocBin(slists_bin);
    16391639//   l->Init(2);
    1640 // 
     1640//
    16411641//   const short V = end-start+1;
    16421642//   intvec* ww_vars = new intvec(V);
    16431643//   intvec* ww_gens = new intvec(len_gen);
    1644 // 
     1644//
    16451645//   for (int i = 0; i < V; i++ )
    16461646//     (*ww_vars)[i] = weights[i];
    1647 // 
     1647//
    16481648//   assume( weights[V] == len_gen );
    1649 // 
     1649//
    16501650//   for (int i = 0; i < len_gen; i++ )
    16511651//     (*ww_gens)[i] = weights[i - V - 1];
    1652 //   
    1653 // 
     1652//
     1653//
    16541654//   l->m[0].rtyp = INTVEC_CMD;
    16551655//   l->m[0].data = reinterpret_cast<void *>(ww_vars);
    1656 // 
     1656//
    16571657//   l->m[1].rtyp = INTVEC_CMD;
    16581658//   l->m[1].data = reinterpret_cast<void *>(ww_gens);
    1659 // 
    1660 // 
     1659//
     1660//
    16611661//   return FALSE;
    1662 // 
     1662//
    16631663// }
    16641664*/
     
    17821782
    17831783  if ( ( (h!=NULL) && (h->Typ()== INT_CMD)  ) )
    1784     iLazyReduce = (int)((long)(h->Data())); 
    1785 
    1786   res->data = (void *)kNFLength(M, currQuotient, v, iSyzComp, iLazyReduce); // NOTE: currRing :(
     1784    iLazyReduce = (int)((long)(h->Data()));
     1785
     1786  res->data = (void *)kNFLength(M, currRing->qideal, v, iSyzComp, iLazyReduce); // NOTE: currRing :(
    17871787  return FALSE;
    17881788}
     
    18301830      iComp = id_RankFreeModule(r->typ[posIS].data.is.F, r); // ;
    18311831  }
    1832  
     1832
    18331833  assume(iComp >= 0);
    18341834
     
    18381838
    18391839  //           int add_row_shift = 0;
    1840   // 
     1840  //
    18411841  if (w!=NULL)
    18421842  {
    18431843    w = ivCopy(w);
    18441844  //             add_row_shift = ww->min_in();
    1845   // 
     1845  //
    18461846  //             (*ww) -= add_row_shift;
    1847   //             
    1848   //             if (idTestHomModule(I, currQuotient, ww))
     1847  //
     1848  //             if (idTestHomModule(I, currRing->qideal, ww))
    18491849  //             {
    18501850    hom = isHomog;
     
    18671867
    18681868  ideal J = // idPrepare( I, hom, iComp, &w);
    1869            kStd(I, currQuotient, hom, &w, NULL, iComp);
     1869           kStd(I, currRing->qideal, hom, &w, NULL, iComp);
    18701870
    18711871  idTest(J);
     
    18921892  const poly p = reinterpret_cast<poly>(h->Data());
    18931893
    1894  
     1894
    18951895  pTest(p);  pWrite(p); PrintLn();
    18961896
    1897  
    1898   p_Content( p, currRing);     
     1897
     1898  p_Content( p, currRing);
    18991899
    19001900  pTest(p);
    19011901  pWrite(p); PrintLn();
    1902  
     1902
    19031903  NoReturn(res);
    19041904  return FALSE;
     
    19081908{
    19091909  int ret = 0;
    1910  
     1910
    19111911  if ( (h!=NULL) && (h->Typ()!=INT_CMD) )
    19121912  {
     
    19221922}
    19231923
    1924    
     1924
    19251925
    19261926END_NAMESPACE
    19271927
    19281928
    1929 int SI_MOD_INIT(syzextra)(SModulFunctions* psModulFunctions) 
     1929int SI_MOD_INIT(syzextra)(SModulFunctions* psModulFunctions)
    19301930{
    19311931
     
    19851985  //  ADD("", FALSE, );
    19861986
    1987 #undef ADD 
     1987#undef ADD
    19881988  return 0;
    19891989}
    19901990
    19911991#ifndef EMBED_PYTHON
    1992 extern "C" { 
     1992extern "C" {
    19931993int mod_init(SModulFunctions* psModulFunctions)
    1994 { 
    1995   return SI_MOD_INIT(syzextra)(psModulFunctions); 
     1994{
     1995  return SI_MOD_INIT(syzextra)(psModulFunctions);
    19961996}
    19971997}
  • Singular/dyn_modules/syzextra/myNF.cc

    r8b5fff rac00e2f  
    11// -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    22/*****************************************************************************\
    3  * Computer Algebra System SINGULAR   
     3 * Computer Algebra System SINGULAR
    44\*****************************************************************************/
    55/** @file DebugPrint.cc
    6  * 
     6 *
    77 * Here we implement dPrint-s.
    88 *
     
    303303    pp = p_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing);
    304304
    305     if(Q == currQuotient)
     305    if(Q == currRing->qideal)
    306306      Q = SCAQuotient(currRing);
    307307  }
  • Singular/dyn_modules/syzextra/syzextra.cc

    r8b5fff rac00e2f  
    11// -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    22/*****************************************************************************\
    3  * Computer Algebra System SINGULAR   
     3 * Computer Algebra System SINGULAR
    44\*****************************************************************************/
    55/** @file syzextra.cc
    6  * 
     6 *
    77 * Here we implement the Computation of Syzygies
    88 *
     
    5050#include <Singular/attrib.h>
    5151
    52 #include <Singular/ipid.h> 
     52#include <Singular/ipid.h>
    5353#include <Singular/ipshell.h> // For iiAddCproc
    5454
     
    7373static int cmp_c_ds(const void *p1, const void *p2)
    7474{
    75   void *R = currRing; 
     75  void *R = currRing;
    7676#endif
    7777
     
    151151  }
    152152
    153   return 0; 
    154 }
    155 
    156    
     153  return 0;
     154}
     155
     156
    157157static int cmp_poly(const poly &a, const poly &b)
    158158{
     
    171171  assume( p_GetComp(a, r) == 0 );
    172172  assume( p_GetComp(b, r) == 0 );
    173    
     173
    174174#ifndef NDEBUG
    175175  const int __DEBUG__ = 0;
     
    198198  }
    199199
    200   return 0; 
    201 }
    202    
     200  return 0;
     201}
     202
    203203END_NAMESPACE
    204204/* namespace SORT_c_ds */
     
    213213    return;
    214214  }
    215    
     215
    216216  assume( r != NULL );
    217217  const coeffs C = r->cf; assume(C != NULL);
     
    221221
    222222  do {
    223   assume( p != NULL );   
    224        
     223  assume( p != NULL );
     224
    225225  // write coef...
    226226  number& n = p_GetCoeff(p, r);
    227227
    228228  n_Normalize(n, C);
    229      
     229
    230230  BOOLEAN writeMult = FALSE; ///< needs * before pp or module generator
    231231
    232232  BOOLEAN writeOne = FALSE; ///< need to write something after '-'!
    233      
     233
    234234  if( n_IsZero(n, C) )
    235235  {
     
    237237//    return; // yes?
    238238  }
    239  
     239
    240240  if (n_IsMOne(n, C))
    241   {     
     241  {
    242242    PrintS(" - "); writeOne = TRUE; writePlus = FALSE;
    243   }     
     243  }
    244244  else if (!n_IsOne(n, C))
    245245  {
    246246    if( writePlus && n_GreaterZero(n, C) )
    247247      PrintS(" + ");
    248    
    249     StringSetS(""); n_WriteLong(n, C); 
    250     if (true) 
     248
     249    StringSetS(""); n_WriteLong(n, C);
     250    if (true)
    251251    {
    252252      char *s = StringEndS(); PrintS(s); omFree(s);
    253253    }
    254      
    255      
     254
     255
    256256    writeMult = TRUE;
    257257    writePlus = TRUE;
    258258  } else
    259259     writeOne = TRUE;
    260    
     260
    261261  // missing '1' if no PP and gen...!?
    262262  // write monom...
     
    268268  {
    269269    const long ee = p_GetExp(p, i+1, r);
    270    
     270
    271271    if (ee!=0L)
    272272    {
     
    285285      else
    286286        Print(" %s ", rRingVar(i, r));
    287        
     287
    288288      writeOne = FALSE;
    289289      wrotePP = TRUE;
     
    292292
    293293  writePlus = writePlus || wrotePP;
    294   writeMult = writeMult || wrotePP; 
     294  writeMult = writeMult || wrotePP;
    295295
    296296  // write module gen...
    297297  const long comp = p_GetComp(p, r);
    298  
     298
    299299  if (comp > 0 )
    300300  {
    301301    if (writeMult)
    302302      PrintS(" \\\\cdot ");
    303      else 
     303     else
    304304      if( writePlus )
    305305        PrintS(" + ");
     
    309309    else
    310310      Print(" \\\\GENP{%ld} ", comp);
    311      
    312       writeOne = FALSE; 
    313   }
    314      
     311
     312      writeOne = FALSE;
     313  }
     314
    315315  if ( writeOne )
    316316    PrintS( writePlus? " + 1 " : " 1 " );
    317        
     317
    318318
    319319  pIter(p);
    320      
     320
    321321  writePlus = TRUE;
    322322  } while( (!bLTonly) && (p != NULL) );
    323    
    324 }
    325 
    326 
    327 
    328 
    329    
     323
     324}
     325
     326
     327
     328
     329
    330330/// return a new term: leading coeff * leading monomial of p
    331331/// with 0 leading component!
     
    346346    p_Setm(m, r);
    347347
    348    
     348
    349349    assume( m != NULL );
    350350    assume( pNext(m) == NULL );
    351351    assume( p_LmTest(m, r) );
    352    
     352
    353353    if( bSetZeroComp )
    354354      assume( p_GetComp(m, r) == 0 );
     
    359359
    360360
    361    
     361
    362362poly p_Tail(const poly p, const ring r)
    363363{
     
    375375
    376376  const ideal newid = idInit(IDELEMS(id),id->rank);
    377  
     377
    378378  for (int i=IDELEMS(id) - 1; i >= 0; i--)
    379379    newid->m[i] = p_Tail( id->m[i], r );
     
    381381  newid->rank = id_RankFreeModule(newid, currRing);
    382382
    383   return newid; 
     383  return newid;
    384384}
    385385
     
    395395#define qsort_my(m, s, ss, r, cmp) qsort_r(m, s, ss, cmp)
    396396#endif
    397  
     397
    398398  if( sizeNew >= 2 )
    399399    qsort_my(id->m, sizeNew, sizeof(poly), r, FROM_NAMESPACE(SORT_c_ds, cmp_c_ds));
     
    408408{
    409409  extern void id_Delete (ideal*, const ring);
    410    
     410
    411411  id_Delete(const_cast<ideal*>(&m_idTails), m_rBaseRing); // TODO!!!
    412412
     
    422422    m_spoly_bucket = NULL;
    423423  }
    424    
     424
    425425  for( TCache::iterator it = m_cache.begin(); it != m_cache.end(); it++ )
    426426  {
    427427    TP2PCache& T = it->second;
    428      
     428
    429429    for(TP2PCache::iterator vit = T.begin(); vit != T.end(); vit++ )
    430     {   
     430    {
    431431      p_Delete( (&(vit->second)), m_rBaseRing);
    432432      p_Delete( const_cast<poly*>(&(vit->first)), m_rBaseRing);
     
    465465  CReducersHash::const_iterator itr = m_hash.find(comp);
    466466
    467   if ( itr == m_hash.end() ) 
     467  if ( itr == m_hash.end() )
    468468    return 2; // no such leading component!!!
    469    
     469
    470470  assume( itr->first == comp );
    471    
    472   const bool bIdealCase = (comp == 0);   
     471
     472  const bool bIdealCase = (comp == 0);
    473473  const bool bSyzCheck = syzChecker.IsNonempty(); // need to check even in ideal case????? proof?  "&& !bIdealCase"
    474474
     
    485485      const poly p = (*vit)->m_lt;
    486486
    487       assume( p_GetComp(p, r) == comp ); 
     487      assume( p_GetComp(p, r) == comp );
    488488
    489489      // TODO: check if coprime with Leads... if __TAILREDSYZ__ !
    490490      for( int var = N; var > 0; --var )
    491491        if( (p_GetExp(p, var, r) != 0) && (p_GetExp(t, var, r) != 0) )
    492         {       
     492        {
    493493#ifndef NDEBUG
    494494          if( __DEBUG__ | 0)
    495           {         
     495          {
    496496            PrintS("CReducerFinder::PreProcessTerm, 't' is NOT co-prime with the following leading term: \n");
    497497            dPrint(p, r, r, 1);
    498498          }
    499 #endif     
     499#endif
    500500          coprime = false; // t not coprime with p!
    501501          break;
     
    513513#ifndef NDEBUG
    514514        if( __DEBUG__ && !coprime)
    515         {         
     515        {
    516516          PrintS("CReducerFinder::PreProcessTerm, 't' is co-prime with p but may lead to NOT divisible syz.term: \n");
    517517          dPrint(ss, r, r, 1);
    518518        }
    519519#endif
    520          
     520
    521521        p_LmDelete(&ss, r); // deletes coeff as well???
    522522      }
     
    528528      PrintS("CReducerFinder::PreProcessTerm, the following 't' is 'co-prime' with all of leading terms! \n");
    529529#endif
    530      
    531     return coprime? 3: 0; // t was coprime with all of leading terms!!! 
     530
     531    return coprime? 3: 0; // t was coprime with all of leading terms!!!
    532532
    533533  }
     
    536536  return 0;
    537537}
    538  
    539    
     538
     539
    540540void SchreyerSyzygyComputation::SetUpTailTerms()
    541541{
    542   const ideal idTails = m_idTails; 
     542  const ideal idTails = m_idTails;
    543543  assume( idTails != NULL );
    544544  assume( idTails->m != NULL );
     
    557557  for( int p = IDELEMS(idTails) - 1; p >= 0; --p )
    558558    for( poly* tt = &(idTails->m[p]); (*tt) != NULL;  )
    559     {   
     559    {
    560560      const poly t = *tt;
    561561      const int k = m_div.PreProcessTerm(t, m_checker); // 0..3
     
    565565      pp[k]++;
    566566#endif
    567        
     567
    568568      if( k )
    569569      {
    570570#ifndef NDEBUG
    571571        if( __DEBUG__)
    572         {         
     572        {
    573573          Print("SchreyerSyzygyComputation::SetUpTailTerms(): PP (%d) the following TT: \n", k);
    574574          dPrint(t, r, r, 1);
     
    577577
    578578        (*tt) = p_LmDeleteAndNext(t, r); // delete the lead and next...
    579       }   
    580       else 
     579      }
     580      else
    581581        tt = &pNext(t); // go next?
    582582
     
    588588    Print("%%      **!!**      SchreyerSyzygyComputation::SetUpTailTerms()::PreProcessing(): X: {c: %lu, C: %lu, P: %lu} + %lu\n", pp[1], pp[2], pp[3], pp[0]);
    589589#endif
    590    
     590
    591591#ifndef NDEBUG
    592592  if( !__TREEOUTPUT__ )
     
    597597  }
    598598#endif
    599    
    600 }
    601 /* 
     599
     600}
     601/*
    602602  m_idTailTerms.resize( IDELEMS(idTails) );
    603  
     603
    604604  for( unsigned int p = IDELEMS(idTails) - 1; p >= 0; p -- )
    605605  {
     
    609609
    610610    unsigned int pp = 0;
    611    
     611
    612612    while( t != NULL )
    613613    {
    614614      assume( t != NULL );
    615615      // TODO: compute L:t!
    616 //      ideal reducers;     
     616//      ideal reducers;
    617617//      CReducerFinder m_reducers
    618      
     618
    619619      CTailTerm* d = v[pp] = new CTailTerm();
    620      
     620
    621621      ++pp; pIter(t);
    622622    }
     
    649649  if( size < 2 )
    650650  {
    651     const ideal newid = idInit(1, 0); newid->m[0] = NULL; // zero ideal...       
     651    const ideal newid = idInit(1, 0); newid->m[0] = NULL; // zero ideal...
    652652    return newid;
    653653  }
     
    745745  const ring& r = m_rBaseRing;
    746746//  const SchreyerSyzygyComputationFlags& attributes = m_atttributes;
    747  
     747
    748748//   const BOOLEAN __DEBUG__      = attributes.__DEBUG__;
    749749//   const BOOLEAN __SYZCHECK__   = attributes.__SYZCHECK__;
     
    751751//   const BOOLEAN __HYBRIDNF__   = attributes.__HYBRIDNF__;
    752752//  const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__;
    753  
     753
    754754
    755755  // 1. set of components S?
     
    762762  if( size < 2 )
    763763  {
    764     const ideal newid = idInit(1, 1); newid->m[0] = NULL; // zero module...   
     764    const ideal newid = idInit(1, 1); newid->m[0] = NULL; // zero module...
    765765    return newid;
    766766  }
     
    768768
    769769  // TODO/NOTE: input is supposed to be sorted wrt "C,ds"!??
    770  
     770
    771771  // components should come in groups: count elements in each group
    772772  // && estimate the real size!!!
     
    863863      //      TEST_OPT_REDTAIL
    864864    assume( r == currRing );
    865  
     865
    866866    BITSET _save_test; SI_SAVE_OPT1(_save_test);
    867867    SI_RESTORE_OPT1(Sy_bit(OPT_REDTAIL) | Sy_bit(OPT_REDSB) | _save_test);
    868868
    869869    intvec* w=new intvec(IDELEMS(newid));
    870     ideal tmp = kStd(newid, currQuotient, isHomog, &w);
     870    ideal tmp = kStd(newid, currRing->qideal, isHomog, &w);
    871871    delete w;
    872872
     
    887887
    888888  Sort_c_ds(newid, r);
    889  
     889
    890890  return newid;
    891891}
     
    898898  const ring& R = m_rBaseRing;
    899899
    900   const int r = p_GetComp(a, R) - 1; 
     900  const int r = p_GetComp(a, R) - 1;
    901901
    902902  assume( r >= 0 && r < IDELEMS(T) );
    903903  assume( r >= 0 && r < IDELEMS(L) );
    904    
    905   assume( a != NULL );   
     904
     905  assume( a != NULL );
    906906
    907907  if( __TREEOUTPUT__ )
     
    909909     PrintS("{ \"nodelabel\": \""); writeLatexTerm(a, R); PrintS("\", \"children\": [");
    910910  }
    911    
     911
    912912
    913913  poly aa = leadmonom(a, R); assume( aa != NULL); // :(
    914914
    915   poly t = TraverseTail(aa, r); 
    916    
     915  poly t = TraverseTail(aa, r);
     916
    917917  if( a2 != NULL )
    918918  {
     
    929929    assume( r2 >= 0 && r2 < IDELEMS(T) );
    930930
    931     t = p_Add_q(a2, p_Add_q(t, TraverseTail(aa2, r2), R), R); 
     931    t = p_Add_q(a2, p_Add_q(t, TraverseTail(aa2, r2), R), R);
    932932
    933933    p_Delete(&aa2, R);
    934      
     934
    935935    if( __TREEOUTPUT__ )
    936936       PrintS("]},");
     
    946946  {
    947947     PrintS("], \"noderesult\": \""); writeLatexTerm(t, R, true, false); PrintS("\" },");
    948   }   
     948  }
    949949  return t;
    950950}
     
    971971  assume( IDELEMS(L) == IDELEMS(T) );
    972972#ifndef NDEBUG
    973   int t, r; 
     973  int t, r;
    974974#endif
    975975
    976976  if( __TREEOUTPUT__ )
    977977  {
    978     Print("\n{ \"syzygylayer\": \"%d\", \"hybridnf\": \"%d\", \"diagrams\": \n[", __SYZNUMBER__, __HYBRIDNF__ ); 
    979   } 
    980    
     978    Print("\n{ \"syzygylayer\": \"%d\", \"hybridnf\": \"%d\", \"diagrams\": \n[", __SYZNUMBER__, __HYBRIDNF__ );
     979  }
     980
    981981  if( m_syzLeads == NULL )
    982   {   
     982  {
    983983#ifndef NDEBUG
    984984    if( !__TREEOUTPUT__ )
     
    988988      Print("%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", r, t, r);
    989989    }
    990 #endif     
     990#endif
    991991    ComputeLeadingSyzygyTerms( __LEAD2SYZ__ && !__IGNORETAILS__ ); // 2 terms OR 1 term!
    992992#ifndef NDEBUG
     
    998998    }
    999999#endif
    1000      
     1000
    10011001  }
    10021002
     
    10101010  {
    10111011     if( __TREEOUTPUT__ )
    1012        PrintS("]},"); 
     1012       PrintS("]},");
    10131013     return;
    10141014  }
    1015    
     1015
    10161016
    10171017  // use hybrid method?
     
    10301030      }
    10311031#endif
    1032        
     1032
    10331033      SetUpTailTerms();
    10341034#ifndef NDEBUG
     
    10401040      }
    10411041#endif
    1042     }     
     1042    }
    10431043  }
    10441044
     
    10511051  }
    10521052#endif
    1053    
     1053
    10541054  for( int k = size - 1; k >= 0; k-- )
    10551055  {
    10561056    const poly a = LL->m[k]; assume( a != NULL );
    10571057
    1058     poly a2 = pNext(a);   
     1058    poly a2 = pNext(a);
    10591059
    10601060    // Splitting 2-terms Leading syzygy module
    10611061    if( a2 != NULL )
    10621062      pNext(a) = NULL;
    1063      
     1063
    10641064    if( __IGNORETAILS__ )
    10651065    {
     
    10891089    Print("%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: dt: %d, dr: %d\n", getRTimer(), t, r);
    10901090  }
    1091 #endif   
     1091#endif
    10921092
    10931093  TT->rank = id_RankFreeModule(TT, R);
    1094    
     1094
    10951095  if( __TREEOUTPUT__ )
    10961096    PrintS("\n]},");
     
    11151115  {
    11161116    assume( !__LEAD2SYZ__ );
    1117    
     1117
    11181118    m_syzLeads = Compute1LeadingSyzygyTerms();
    11191119  }
    11201120//    m_syzLeads = FROM_NAMESPACE(INTERNAL, _ComputeLeadingSyzygyTerms(m_idLeads, m_rBaseRing, m_atttributes));
    1121  
     1121
    11221122  // NOTE: set m_LS if tails are to be reduced!
    11231123  assume( m_syzLeads!= NULL );
     
    11271127    m_LS = m_syzLeads;
    11281128    m_checker.Initialize(m_syzLeads);
    1129 #ifndef NDEBUG   
     1129#ifndef NDEBUG
    11301130    if( __DEBUG__ )
    11311131    {
     
    11461146poly SchreyerSyzygyComputation::SchreyerSyzygyNF(const poly syz_lead, poly syz_2) const
    11471147{
    1148  
     1148
    11491149  assume( !__IGNORETAILS__ );
    11501150
     
    11601160    PrintS("{   \"nodelabel\": \""); writeLatexTerm(syz_lead, r); PrintS("\", \"children\": [");
    11611161  }
    1162    
     1162
    11631163  if( syz_2 == NULL )
    11641164  {
    1165     const int rr = p_GetComp(syz_lead, r) - 1; 
     1165    const int rr = p_GetComp(syz_lead, r) - 1;
    11661166
    11671167    assume( rr >= 0 && rr < IDELEMS(T) );
     
    11751175      PrintS("{ \"nodelabel\": \""); writeLatexTerm(syz_2, r); PrintS("\" },");
    11761176    }
    1177 #else   
     1177#else
    11781178    poly aa = leadmonom(syz_lead, r); assume( aa != NULL); // :(
    11791179    aa = p_Mult_mm(aa, L->m[rr], r);
     
    11831183      PrintS("{ \"nodelabel\": \""); writeLatexTerm(syz_2, r); PrintS("\", \"edgelable\": \""); writeLatexTerm(aa, r, false); PrintS("\" },");
    11841184    }
    1185      
     1185
    11861186    syz_2 = m_div.FindReducer(aa, syz_lead, m_checker);
    11871187
    11881188    p_Delete(&aa, r);
    11891189#endif
    1190    
    1191   }
    1192    
    1193   assume( syz_2 != NULL ); // by construction of S-Polynomial   
     1190
     1191  }
     1192
     1193  assume( syz_2 != NULL ); // by construction of S-Polynomial
    11941194
    11951195  assume( L != NULL );
     
    12131213
    12141214//  kBucketInit(bucket, NULL, 0); // not needed!?
    1215      
    1216   poly p = leadmonom(syz_lead, r); // :( 
    1217 //  poly spoly = pp_Mult_qq(p, T->m[c], r); 
    1218   kBucket_Plus_mm_Mult_pp(bucket, p, T->m[c], 0); // TODO: store pLength(T->m[c]) separately!? 
     1215
     1216  poly p = leadmonom(syz_lead, r); // :(
     1217//  poly spoly = pp_Mult_qq(p, T->m[c], r);
     1218  kBucket_Plus_mm_Mult_pp(bucket, p, T->m[c], 0); // TODO: store pLength(T->m[c]) separately!?
    12191219  p_Delete(&p, r);
    1220  
    1221   kbTest(bucket); 
     1220
     1221  kbTest(bucket);
    12221222
    12231223  c = p_GetComp(syz_2, r) - 1;
     
    12321232  // TODO: use bucket!?
    12331233//  const bool bUsePolynomial = TEST_OPT_NOT_BUCKETS; //  || (pLength(spoly) < MIN_LENGTH_BUCKET);
    1234 //  CPolynomialSummator tail(r, bUsePolynomial);                       
    1235   sBucket_Add_p(tail, syz_2, 1); // tail.AddAndDelete(syz_2, 1); 
    1236  
     1234//  CPolynomialSummator tail(r, bUsePolynomial);
     1235  sBucket_Add_p(tail, syz_2, 1); // tail.AddAndDelete(syz_2, 1);
     1236
    12371237  kbTest(bucket);
    12381238  for( poly spoly = kBucketExtractLm(bucket); spoly != NULL; p_LmDelete(&spoly, r), spoly = kBucketExtractLm(bucket))
    1239   {   
     1239  {
    12401240    kbTest(bucket);
    1241     poly t = m_div.FindReducer(spoly, NULL, m_checker);   
     1241    poly t = m_div.FindReducer(spoly, NULL, m_checker);
    12421242
    12431243    if( t != NULL )
     
    12471247
    12481248      assume( c >= 0 && c < IDELEMS(T) );
    1249        
     1249
    12501250      if( __TREEOUTPUT__ )
    12511251      {
     
    12701270  sBucketClearAdd(tail, &result, &len); // TODO: use Merge with sBucket???
    12711271  assume( pLength(result) == len );
    1272      
     1272
    12731273  if( __TREEOUTPUT__ )
    1274   {   
     1274  {
    12751275    PrintS("]},");
    12761276  }
    1277    
     1277
    12781278
    12791279  return result;
    12801280}
    12811281
    1282 // namespace     {   
     1282// namespace     {
    12831283
    12841284// };
     
    12911291{
    12921292  const ring& r = m_rBaseRing;
    1293    
     1293
    12941294  assume(m_idTails !=  NULL && m_idTails->m != NULL);
    12951295  assume( tail >= 0 && tail < IDELEMS(m_idTails) );
    1296    
     1296
    12971297/*  return ComputeImage(multiplier, tail); */
    1298  
     1298
    12991299  // TODO: store (multiplier, tail) -.-^-.-^-.--> !
    13001300  TCache::iterator top_itr = m_cache.find(tail);
    1301    
     1301
    13021302  if ( top_itr != m_cache.end() )
    13031303  {
     
    13051305
    13061306     TP2PCache& T = top_itr->second;
    1307      
     1307
    13081308     TP2PCache::iterator itr = T.find(multiplier);
    1309      
     1309
    13101310     if( itr != T.end() ) // Yey - Reuse!!!
    13111311     {
    13121312       assume( p_LmEqual(itr->first, multiplier, r) );
    1313        
     1313
    13141314       if( itr->second == NULL )
    1315         return (NULL);
    1316        
     1315        return (NULL);
     1316
    13171317       poly p = p_Copy(itr->second, r); // no copy???
    1318        
     1318
    13191319       if( __TREEOUTPUT__ )
    13201320       {
    1321 //         PrintS("{ \"nodelabel\": \""); writeLatexTerm(multiplier, r, false); 
     1321//         PrintS("{ \"nodelabel\": \""); writeLatexTerm(multiplier, r, false);
    13221322//         Print(" \\\\cdot \\\\GEN{%d}\", \"children\": [ ", tail + 1);
    1323           Print("{ \"lookedupnode\": \"1\", \"nodelabel\": \"");
    1324           writeLatexTerm(p, r, true, false);
     1323          Print("{ \"lookedupnode\": \"1\", \"nodelabel\": \"");
     1324          writeLatexTerm(p, r, true, false);
    13251325       }
    1326        
     1326
    13271327       if( !n_Equal( pGetCoeff(multiplier), pGetCoeff(itr->first), r) ) // normalize coeffs!?
    13281328       {
    1329          number n = n_Div( pGetCoeff(multiplier), pGetCoeff(itr->first), r); 
    1330          p = p_Mult_nn(p, n, r); 
     1329         number n = n_Div( pGetCoeff(multiplier), pGetCoeff(itr->first), r);
     1330         p = p_Mult_nn(p, n, r);
    13311331         n_Delete(&n, r);
    1332          
     1332
    13331333         if( __TREEOUTPUT__ )
    13341334           Print("\", \"RESCALEDRESULT\": \"1\" },");
     
    13381338           Print("\", \"RESCALEDRESULT\": \"0\" },");
    13391339       }
    1340        
     1340
    13411341       return p;
    13421342     }
     
    13451345     {
    13461346//        PrintS("{ \"nodelabel\": \""); writeLatexTerm(multiplier, r, false); Print(" \\\\cdot \\\\GEN{%d}\", \"children\": [", tail + 1);
    1347      }     
    1348      
     1347     }
     1348
    13491349     const poly p = ComputeImage(multiplier, tail);
    13501350     T.insert( TP2PCache::value_type(p_Copy(multiplier, r), p) ); //     T[ multiplier ] = p;
     
    13521352//     if( p == NULL )
    13531353//        return (NULL);
    1354      
     1354
    13551355     if( __TREEOUTPUT__ )
    13561356     {
    1357 //      PrintS("], \"storedResult\": \""); writeLatexTerm(p, r, true, false); PrintS("\" },");
     1357//        PrintS("], \"storedResult\": \""); writeLatexTerm(p, r, true, false); PrintS("\" },");
    13581358     }
    1359      
     1359
    13601360     return p_Copy(p, r);
    13611361  }
    1362    
     1362
    13631363  CCacheCompare o(r); TP2PCache T(o);
    13641364
     
    13671367//     PrintS("{ \"nodelabel\": \""); writeLatexTerm(multiplier, r, false); Print(" \\\\cdot \\\\GEN{%d}\", \"children\": [", tail + 1);
    13681368  }
    1369    
    1370    
     1369
     1370
    13711371  const poly p = ComputeImage(multiplier, tail);
    13721372
    13731373  T.insert( TP2PCache::value_type(p_Copy(multiplier, r), p) );
    1374    
     1374
    13751375  m_cache.insert( TCache::value_type(tail, T) );
    13761376
    13771377//  if( p == NULL )
    13781378//    return (NULL);
    1379    
     1379
    13801380  if( __TREEOUTPUT__ )
    13811381  {
    13821382//     PrintS("], \"storedResult\": \""); writeLatexTerm(p, r, true, false); PrintS("\" },");
    13831383  }
    1384    
     1384
    13851385  return p_Copy(p, r);
    13861386}
     
    13961396}
    13971397
    1398    
     1398
    13991399poly SchreyerSyzygyComputation::TraverseTail(poly multiplier, poly tail) const
    14001400{
     
    14191419    sBucket_pt& sum   = m_sum_bucket; assume( sum != NULL );
    14201420    poly s; int len;
    1421    
     1421
    14221422//    CPolynomialSummator sum(r, bUsePolynomial);
    14231423//    poly s = NULL;
     
    14311431      // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    14321432      // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    1433      
     1433
    14341434      const int lp = pLength(rt);
    14351435      if( rt != NULL && lp != 0 )
    1436         sBucket_Add_p(sum, rt, lp); 
     1436        sBucket_Add_p(sum, rt, lp);
    14371437    }
    14381438
     
    14741474    if( s == NULL ) // No Reducer?
    14751475     return s;
    1476      
     1476
    14771477    if( __TREEOUTPUT__ )
    14781478    {
    1479       PrintS("{ \"nodelabel\": \""); writeLatexTerm(s, r); 
    1480     }
    1481    
    1482 #else   
     1479      PrintS("{ \"nodelabel\": \""); writeLatexTerm(s, r);
     1480    }
     1481
     1482#else
    14831483    // NOTE: only LT(term4reduction) should be used in the following:
    14841484    poly product = pp_Mult_mm(multiplier, term4reduction, r);
     
    14871487    if( s == NULL ) // No Reducer?
    14881488     return s;
    1489      
     1489
    14901490    if( __TREEOUTPUT__ )
    14911491    {
    1492       PrintS("{ \"nodelabel\": \""); writeLatexTerm(s, r); PrintS("\", \"edgelable\": \""); writeLatexTerm(product, r, false); 
    1493     }
    1494      
     1492      PrintS("{ \"nodelabel\": \""); writeLatexTerm(s, r); PrintS("\", \"edgelable\": \""); writeLatexTerm(product, r, false);
     1493    }
     1494
    14951495    p_Delete(&product, r);
    14961496#endif
     
    14991499  if( s == NULL ) // No Reducer?
    15001500    return s;
    1501    
     1501
    15021502
    15031503  poly b = leadmonom(s, r);
     
    15061506  assume( c >= 0 && c < IDELEMS(T) );
    15071507
    1508    
     1508
    15091509  if( __TREEOUTPUT__ )
    15101510     PrintS("\", \"children\": [");
    1511    
     1511
    15121512  const poly t = TraverseTail(b, c); // T->m[c];
    15131513
    15141514  if( t != NULL )
    1515     s = p_Add_q(s, t, r); 
     1515    s = p_Add_q(s, t, r);
    15161516
    15171517  if( __TREEOUTPUT__ )
    15181518  {
    1519        
     1519
    15201520    PrintS("], \"noderesult\": \"");
    1521     writeLatexTerm(s, r, true, false); 
     1521    writeLatexTerm(s, r, true, false);
    15221522    PrintS("\" },");
    15231523  }
    1524    
     1524
    15251525  return s;
    15261526}
     
    15311531
    15321532BEGIN_NAMESPACE_NONAME
    1533    
     1533
    15341534static inline int atGetInt(idhdl rootRingHdl, const char* attribute, long def)
    15351535{
     
    15371537}
    15381538
    1539 END_NAMESPACE   
    1540 
    1541      
     1539END_NAMESPACE
     1540
     1541
    15421542SchreyerSyzygyComputationFlags::SchreyerSyzygyComputationFlags(idhdl rootRingHdl):
    15431543#ifndef NDEBUG
     
    15471547#endif
    15481548//    __SYZCHECK__( (BOOLEAN)atGetInt(rootRingHdl, "SYZCHECK", __DEBUG__) ),
    1549     __LEAD2SYZ__( atGetInt(rootRingHdl, "LEAD2SYZ", 1) ), 
    1550     __TAILREDSYZ__( atGetInt(rootRingHdl, "TAILREDSYZ", 1) ), 
     1549    __LEAD2SYZ__( atGetInt(rootRingHdl, "LEAD2SYZ", 1) ),
     1550    __TAILREDSYZ__( atGetInt(rootRingHdl, "TAILREDSYZ", 1) ),
    15511551    __HYBRIDNF__( atGetInt(rootRingHdl, "HYBRIDNF", 2) ),
    15521552    __IGNORETAILS__( atGetInt(rootRingHdl, "IGNORETAILS", 0) ),
     
    15541554    __TREEOUTPUT__( atGetInt(rootRingHdl, "TREEOUTPUT", 0) ),
    15551555    m_rBaseRing( rootRingHdl->data.uring )
    1556 {   
     1556{
    15571557#ifndef NDEBUG
    15581558  if( __DEBUG__ )
     
    15681568  }
    15691569#endif
    1570    
     1570
    15711571  // TODO: just current setting!
    15721572  assume( rootRingHdl == currRingHdl );
     
    15761576}
    15771577
    1578    
     1578
    15791579
    15801580CLeadingTerm::CLeadingTerm(unsigned int _label,  const poly _lt, const ring R):
     
    16011601
    16021602  assume( m_L == L );
    1603  
     1603
    16041604  if( L != NULL )
    16051605  {
    16061606    const ring& R = m_rBaseRing;
    16071607    assume( R != NULL );
    1608    
     1608
    16091609    for( int k = IDELEMS(L) - 1; k >= 0; k-- )
    16101610    {
     
    16851685  const unsigned long p_sev = m_sev;
    16861686
    1687   assume( p_sev == p_GetShortExpVector(p, r) );     
     1687  assume( p_sev == p_GetShortExpVector(p, r) );
    16881688
    16891689  return p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r);
     
    17041704
    17051705  const unsigned long p_sev = m_sev;
    1706   assume( p_sev == p_GetShortExpVector(p, r) );     
     1706  assume( p_sev == p_GetShortExpVector(p, r) );
    17071707
    17081708  if (p_sev & not_sev)
     
    17201720class CDivisorEnumerator: public SchreyerSyzygyComputationFlags
    17211721{
    1722   private: 
     1722  private:
    17231723    const CReducerFinder& m_reds;
    17241724    const poly m_product;
     
    17421742    {
    17431743      assume( m_comp >= 0 );
    1744       assume( m_reds.m_L != NULL ); 
     1744      assume( m_reds.m_L != NULL );
    17451745    }
    17461746
     
    17481748    {
    17491749      m_active = false;
    1750      
     1750
    17511751      m_itr = m_reds.m_hash.find(m_comp);
    17521752
     
    17631763
    17641764//      m_active = true;
    1765       return true;     
     1765      return true;
    17661766    }
    17671767
     
    17731773      return *(*m_current);
    17741774    }
    1775  
     1775
    17761776    inline bool MoveNext()
    17771777    {
     
    17821782      else
    17831783        m_active = true; // for Current()
    1784      
     1784
    17851785      // looking for the next good entry
    17861786      for( ; m_current != m_finish; ++m_current )
     
    18041804      // the end... :(
    18051805      assume( m_current == m_finish );
    1806      
     1806
    18071807      m_active = false;
    18081808      return false;
     
    18191819
    18201820  return itr.MoveNext();
    1821  
    1822 /* 
     1821
     1822/*
    18231823  const ring& r = m_rBaseRing;
    1824  
     1824
    18251825  const long comp = p_GetComp(product, r);
    18261826  const unsigned long not_sev = ~p_GetShortExpVector(product, r);
     
    18301830  CReducersHash::const_iterator it = m_hash.find(comp); // same module component
    18311831
    1832   assume( m_L != NULL ); 
     1832  assume( m_L != NULL );
    18331833
    18341834  if( it == m_hash.end() )
    18351835    return false;
    18361836  // assume comp!
    1837  
     1837
    18381838  const TReducers& reducers = it->second;
    18391839
     
    18551855
    18561856  return false;
    1857 */ 
     1857*/
    18581858}
    18591859
     
    18921892class CDivisorEnumerator2: public SchreyerSyzygyComputationFlags
    18931893{
    1894   private: 
     1894  private:
    18951895    const CReducerFinder& m_reds;
    18961896    const poly m_multiplier, m_term;
     
    19141914    {
    19151915      assume( m_comp >= 0 );
    1916       assume( m_reds.m_L != NULL ); 
    1917       assume( m_multiplier != NULL ); 
     1916      assume( m_reds.m_L != NULL );
     1917      assume( m_multiplier != NULL );
    19181918      assume( m_term != NULL );
    19191919//      assume( p_GetComp(m_multiplier, m_rBaseRing) == 0 );
     
    19231923    {
    19241924      m_active = false;
    1925      
    1926       m_itr = m_reds.m_hash.find(m_comp); 
     1925
     1926      m_itr = m_reds.m_hash.find(m_comp);
    19271927
    19281928      if( m_itr == m_reds.m_hash.end() )
     
    19371937        return false;
    19381938
    1939       return true;     
     1939      return true;
    19401940    }
    19411941
     
    19471947      return *(*m_current);
    19481948    }
    1949  
     1949
    19501950    inline bool MoveNext()
    19511951    {
     
    19541954      if( m_active )
    19551955        ++m_current;
    1956       else 
     1956      else
    19571957        m_active = true;
    1958    
    1959      
     1958
     1959
    19601960      // looking for the next good entry
    19611961      for( ; m_current != m_finish; ++m_current )
     
    19741974//          m_active = true;
    19751975          return true;
    1976          
     1976
    19771977        }
    19781978      }
     
    19801980      // the end... :(
    19811981      assume( m_current == m_finish );
    1982      
     1982
    19831983      m_active = false;
    19841984      return false;
    19851985    }
    19861986};
    1987    
     1987
    19881988poly CReducerFinder::FindReducer(const poly multiplier, const poly t,
    19891989                                 const poly syzterm,
     
    20182018
    20192019    poly pr = p_Mult_q( leadmonom(multiplier, r, false), leadmonom(t, r, false), r);
    2020    
     2020
    20212021    assume( p_EqualPolys(lm, pr, r) );
    20222022
     
    20242024    //  def @@product = leadmonomial(syzterm) * L[@@r];
    20252025
    2026     p_Delete(&lm, r);   
    2027     p_Delete(&pr, r);   
    2028   }
    2029    
    2030   const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ && 
     2026    p_Delete(&lm, r);
     2027    p_Delete(&pr, r);
     2028  }
     2029
     2030  const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ &&
    20312031
    20322032  const poly q = p_New(r); pNext(q) = NULL;
     
    20392039    const poly p = itr.Current().m_lt;
    20402040    const int k  = itr.Current().m_label;
    2041      
     2041
    20422042    p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t // TODO: do it once?
    20432043    p_ExpVectorDiff(q, q, p, r); // (LM(product) / LM(L[k]))
    2044    
     2044
    20452045    p_SetComp(q, k + 1, r);
    20462046    p_Setm(q, r);
     
    20552055          Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: ");
    20562056          dPrint(syzterm, r, r, 1);
    2057         }   
     2057        }
    20582058#endif
    20592059        continue;
    20602060      }
    20612061
    2062     // while the complement (the fraction) is not reducible by leading syzygies 
    2063     if( to_check && syz_checker.IsDivisible(q) ) 
     2062    // while the complement (the fraction) is not reducible by leading syzygies
     2063    if( to_check && syz_checker.IsDivisible(q) )
    20642064    {
    20652065#ifndef NDEBUG
     
    20752075    p_SetCoeff0(q, n_Neg( n_Div(n, p_GetCoeff(p, r), r), r), r);
    20762076    n_Delete(&n, r);
    2077    
     2077
    20782078    return q;
    20792079  }
    2080    
     2080
    20812081/*
    20822082  const long comp = p_GetComp(t, r); assume( comp >= 0 );
     
    20862086//   {
    20872087//     const poly p = L->m[k];
    2088 // 
     2088//
    20892089//     if ( p_GetComp(p, r) != comp )
    20902090//       continue;
    2091 // 
     2091//
    20922092//     const unsigned long p_sev = p_GetShortExpVector(p, r); // to be stored in m_hash!!!
    20932093
     
    20992099
    21002100  // assume comp!
    2101  
     2101
    21022102  assume( m_L != NULL );
    21032103
     
    21132113
    21142114//    const unsigned long p_sev = (*vit)->m_sev;
    2115 //    assume( p_sev == p_GetShortExpVector(p, r) );     
     2115//    assume( p_sev == p_GetShortExpVector(p, r) );
    21162116
    21172117//    if( !p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r) )
    2118 //      continue;     
     2118//      continue;
    21192119
    21202120    if( !(*vit)->DivisibilityCheck(multiplier, t, not_sev, r) )
    21212121      continue;
    2122    
    2123    
     2122
     2123
    21242124//    if (p_sev & not_sev) continue;
    2125 //    if( !_p_LmDivisibleByNoComp(p, multiplier, t, r) ) continue;     
    2126 
    2127 
    2128     p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t       
     2125//    if( !_p_LmDivisibleByNoComp(p, multiplier, t, r) ) continue;
     2126
     2127
     2128    p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t
    21292129    p_ExpVectorDiff(q, q, p, r); // (LM(product) / LM(L[k]))
    2130    
     2130
    21312131    p_SetComp(q, k + 1, r);
    21322132    p_Setm(q, r);
     
    21402140          Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: ");
    21412141          dPrint(syzterm, r, r, 1);
    2142         }   
     2142        }
    21432143
    21442144        continue;
    21452145      }
    21462146
    2147     // while the complement (the fraction) is not reducible by leading syzygies 
    2148     if( to_check && syz_checker.IsDivisible(q) ) 
     2147    // while the complement (the fraction) is not reducible by leading syzygies
     2148    if( to_check && syz_checker.IsDivisible(q) )
    21492149    {
    21502150      if( __DEBUG__ )
     
    21592159    p_SetCoeff0(q, n_Neg( n_Div(n, p_GetCoeff(p, r), r), r), r);
    21602160    n_Delete(&n, r);
    2161    
     2161
    21622162    return q;
    21632163  }
    2164 */ 
     2164*/
    21652165
    21662166  p_LmFree(q, r);
    21672167
    21682168  return NULL;
    2169  
     2169
    21702170}
    21712171
     
    22032203    //  def @@product = leadmonomial(syzterm) * L[@@r];
    22042204
    2205     p_Delete(&lm, r);   
    2206   }
    2207 
    2208 
    2209   const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ && 
     2205    p_Delete(&lm, r);
     2206  }
     2207
     2208
     2209  const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ &&
    22102210
    22112211  const poly q = p_New(r); pNext(q) = NULL;
     
    22182218    const poly p = itr.Current().m_lt;
    22192219    const int k  = itr.Current().m_label;
    2220      
     2220
    22212221    p_ExpVectorDiff(q, product, p, r); // (LM(product) / LM(L[k]))
    22222222    p_SetComp(q, k + 1, r);
     
    22322232          Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: ");
    22332233          dPrint(syzterm, r, r, 1);
    2234         }   
     2234        }
    22352235#endif
    22362236        continue;
    22372237      }
    22382238
    2239     // while the complement (the fraction) is not reducible by leading syzygies 
    2240     if( to_check && syz_checker.IsDivisible(q) ) 
     2239    // while the complement (the fraction) is not reducible by leading syzygies
     2240    if( to_check && syz_checker.IsDivisible(q) )
    22412241    {
    22422242#ifndef NDEBUG
     
    22502250
    22512251    p_SetCoeff0(q, n_Neg( n_Div( p_GetCoeff(product, r), p_GetCoeff(p, r), r), r), r);
    2252    
     2252
    22532253    return q;
    22542254  }
    2255    
    2256    
    2257    
    2258 /*   
     2255
     2256
     2257
     2258/*
    22592259  const long comp = p_GetComp(product, r);
    22602260  const unsigned long not_sev = ~p_GetShortExpVector(product, r);
     
    22652265//   {
    22662266//     const poly p = L->m[k];
    2267 // 
     2267//
    22682268//     if ( p_GetComp(p, r) != comp )
    22692269//       continue;
    2270 // 
     2270//
    22712271//     const unsigned long p_sev = p_GetShortExpVector(p, r); // to be stored in m_hash!!!
    2272  
     2272
    22732273   // looking for an appropriate diviser p = L[k]...
    22742274  CReducersHash::const_iterator it = m_hash.find(comp); // same module component
     
    22812281  const TReducers& reducers = it->second;
    22822282
    2283   const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ && 
     2283  const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ &&
    22842284
    22852285  const poly q = p_New(r); pNext(q) = NULL;
     
    22872287  if( __DEBUG__ )
    22882288    p_SetCoeff0(q, 0, r); // for printing q
    2289  
     2289
    22902290  for(TReducers::const_iterator vit = reducers.begin(); vit != reducers.end(); vit++ )
    22912291  {
     
    23002300    const unsigned long p_sev = (*vit)->m_sev;
    23012301
    2302     assume( p_sev == p_GetShortExpVector(p, r) );     
     2302    assume( p_sev == p_GetShortExpVector(p, r) );
    23032303
    23042304    if( !p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r) )
    2305       continue;     
     2305      continue;
    23062306
    23072307//     // ... which divides the product, looking for the _1st_ appropriate one!
     
    23212321          Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: ");
    23222322          dPrint(syzterm, r, r, 1);
    2323         }   
     2323        }
    23242324
    23252325        continue;
    23262326      }
    23272327
    2328     // while the complement (the fraction) is not reducible by leading syzygies 
    2329     if( to_check && syz_checker.IsDivisible(q) ) 
     2328    // while the complement (the fraction) is not reducible by leading syzygies
     2329    if( to_check && syz_checker.IsDivisible(q) )
    23302330    {
    23312331      if( __DEBUG__ )
     
    23332333        PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: ");
    23342334      }
    2335      
     2335
    23362336      continue;
    23372337    }
     
    23762376    }
    23772377
    2378     m_compute = true;   
     2378    m_compute = true;
    23792379  }
    23802380}
     
    23852385  assume( m != NULL );
    23862386  if( m_compute && (m != NULL))
    2387   { 
     2387  {
    23882388    const ring& R = m_rBaseRing;
    23892389
     
    24002400}
    24012401
    2402 CCacheCompare::CCacheCompare(): m_ring(currRing) {} 
     2402CCacheCompare::CCacheCompare(): m_ring(currRing) {}
    24032403
    24042404
  • Singular/fglm.cc

    r8b5fff rac00e2f  
    5353};
    5454
    55 // Has to be called, if currQuotient != NULL. ( i.e. qring-case )
     55// Has to be called, if currRing->qideal != NULL. ( i.e. qring-case )
    5656// Then a new ideal is build, consisting of the generators of sourceIdeal
    57 // and the generators of currQuotient, which are completely reduced by
     57// and the generators of currRing->qideal, which are completely reduced by
    5858// the sourceIdeal. This means: If sourceIdeal is reduced, then the new
    5959// ideal will be reduced as well.
     
    6363    int k, l, offset;
    6464    BOOLEAN found;
    65     ideal newSource= idInit( IDELEMS( sourceIdeal ) + IDELEMS( currQuotient ), 1 );
     65    ideal newSource= idInit( IDELEMS( sourceIdeal ) + IDELEMS( currRing->qideal ), 1 );
    6666    for ( k= IDELEMS( sourceIdeal )-1; k >=0; k-- )
    6767        (newSource->m)[k]= pCopy( (sourceIdeal->m)[k] );
    6868    offset= IDELEMS( sourceIdeal );
    69     for ( l= IDELEMS( currQuotient )-1; l >= 0; l-- )
    70     {
    71         if ( (currQuotient->m)[l] != NULL )
     69    for ( l= IDELEMS( currRing->qideal )-1; l >= 0; l-- )
     70    {
     71        if ( (currRing->qideal->m)[l] != NULL )
    7272        {
    7373            found= FALSE;
    7474            for ( k= IDELEMS( sourceIdeal )-1; (k >= 0) && (found == FALSE); k-- )
    75                 if ( pDivisibleBy( (sourceIdeal->m)[k], (currQuotient->m)[l] ) )
     75                if ( pDivisibleBy( (sourceIdeal->m)[k], (currRing->qideal->m)[l] ) )
    7676                    found= TRUE;
    7777            if ( ! found )
    7878            {
    79                 (newSource->m)[offset]= pCopy( (currQuotient->m)[l] );
     79                (newSource->m)[offset]= pCopy( (currRing->qideal->m)[l] );
    8080                offset++;
    8181            }
     
    8686}
    8787
    88 // Has to be called, if currQuotient != NULL, i.e. in qring-case.
     88// Has to be called, if currRing->qideal != NULL, i.e. in qring-case.
    8989// Gets rid of the elements of result which are contained in
    90 // currQuotient and skips Zeroes.
     90// currRing->qideal and skips Zeroes.
    9191// Assumes that currRing == destRing
    9292void
     
    100100        {
    101101            found= FALSE;
    102             for ( l= IDELEMS( currQuotient )-1; (l >= 0) && ( found == FALSE ); l-- )
    103                 if ( pDivisibleBy( (currQuotient->m)[l], (result->m)[k] ) )
     102            for ( l= IDELEMS( currRing->qideal )-1; (l >= 0) && ( found == FALSE ); l-- )
     103                if ( pDivisibleBy( (currRing->qideal->m)[l], (result->m)[k] ) )
    104104                    found= TRUE;
    105105            if ( found ) pDelete( & ((result->m)[k]) );
     
    302302        {
    303303            ideal sourceIdeal;
    304             if ( currQuotient != NULL )
     304            if ( currRing->qideal != NULL )
    305305                sourceIdeal= fglmUpdatesource( IDIDEAL( ih ) );
    306306            else
     
    311311                // Now the settings are compatible with FGLM
    312312                assumeStdFlag( (leftv)ih );
    313                 if ( fglmzero( IDRING(sourceRingHdl), sourceIdeal, IDRING(destRingHdl), destIdeal, FALSE, (currQuotient != NULL) ) == FALSE )
     313                if ( fglmzero( IDRING(sourceRingHdl), sourceIdeal, IDRING(destRingHdl), destIdeal, FALSE, (currRing->qideal != NULL) ) == FALSE )
    314314                    state= FglmNotReduced;
    315315            }
     
    321321    {
    322322        case FglmOk:
    323             if ( currQuotient != NULL ) fglmUpdateresult( destIdeal );
     323            if ( currRing->qideal != NULL ) fglmUpdateresult( destIdeal );
    324324            break;
    325325        case FglmHasOne:
  • Singular/iparith.cc

    r8b5fff rac00e2f  
    19811981  }
    19821982#endif
    1983   if(currQuotient==NULL)
     1983  if(currRing->qideal==NULL)
    19841984    res->data = (char *)((long)scDimInt((ideal)(v->Data()),(ideal)w->Data()));
    19851985  else
    19861986  {
    1987     ideal q=idSimpleAdd(currQuotient,(ideal)w->Data());
     1987    ideal q=idSimpleAdd(currRing->qideal,(ideal)w->Data());
    19881988    res->data = (char *)((long)scDimInt((ideal)(v->Data()),q));
    19891989    idDelete(&q);
     
    24082408    Print("//       performed for generic fibre, that is, over Q\n");
    24092409    intvec *module_w=(intvec*)atGet(&uuAsLeftv,"isHomog",INTVEC_CMD);
    2410     intvec *iv=hFirstSeries(uu,module_w,currQuotient);
     2410    intvec *iv=hFirstSeries(uu,module_w,currRing->qideal);
    24112411    int returnWithTrue = 1;
    24122412    switch((int)(long)v->Data())
     
    24332433  assumeStdFlag(u);
    24342434  intvec *module_w=(intvec*)atGet(u,"isHomog",INTVEC_CMD);
    2435   intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currQuotient);
     2435  intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currRing->qideal);
    24362436  switch((int)(long)v->Data())
    24372437  {
     
    24992499  kModW=w;
    25002500  pSetDegProcs(currRing,kHomModDeg);
    2501   res->data=(void *)(long)idHomModule(v_id,currQuotient,&w);
     2501  res->data=(void *)(long)idHomModule(v_id,currRing->qideal,&w);
    25022502  currRing->pLexOrder=save_pLexOrder;
    25032503  kHomW=NULL;
     
    25112511  assumeStdFlag(u);
    25122512  res->data=(void *)scIndIndset((ideal)(u->Data()),(int)(long)(v->Data()),
    2513                     currQuotient);
     2513                    currRing->qideal);
    25142514  return FALSE;
    25152515}
     
    25582558  intvec *w_u=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
    25592559  res->data = (char *)scKBase((int)(long)v->Data(),
    2560                               (ideal)(u->Data()),currQuotient, w_u);
     2560                              (ideal)(u->Data()),currRing->qideal, w_u);
    25612561  if (w_u!=NULL)
    25622562  {
     
    26462646     else
    26472647     {
    2648        if ((!idTestHomModule(u_id,currQuotient,w_v))
    2649        || (!idTestHomModule(v_id,currQuotient,w_v)))
     2648       if ((!idTestHomModule(u_id,currRing->qideal,w_v))
     2649       || (!idTestHomModule(v_id,currRing->qideal,w_v)))
    26502650       {
    26512651         WarnS("wrong weights");
     
    30003000{
    30013001  assumeStdFlag(v);
    3002   res->data = (char *)kNF((ideal)v->Data(),currQuotient,(poly)u->Data());
     3002  res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(poly)u->Data());
    30033003  return FALSE;
    30043004}
     
    30083008  ideal ui=(ideal)u->Data();
    30093009  ideal vi=(ideal)v->Data();
    3010   res->data = (char *)kNF(vi,currQuotient,ui);
     3010  res->data = (char *)kNF(vi,currRing->qideal,ui);
    30113011  return FALSE;
    30123012}
     
    30313031  {
    30323032    maxl = currRing->N-1+2*(iiOp==MRES_CMD);
    3033     if (currQuotient!=NULL)
     3033    if (currRing->qideal!=NULL)
    30343034    {
    30353035      Warn(
     
    30413041  if (weights!=NULL)
    30423042  {
    3043     if (!idTestHomModule(u_id,currQuotient,weights))
     3043    if (!idTestHomModule(u_id,currRing->qideal,weights))
    30443044    {
    30453045      WarnS("wrong weights given:");weights->show();PrintLn();
     
    30563056  }
    30573057  else
    3058     idHomModule(u_id,currQuotient,&ww);
     3058    idHomModule(u_id,currRing->qideal,&ww);
    30593059  weights=ww;
    30603060
     
    30693069  {
    30703070    int dummy;
    3071     if((currQuotient!=NULL)||
     3071    if((currRing->qideal!=NULL)||
    30723072    (!idHomIdeal (u_id,NULL)))
    30733073    {
     
    30813081  {
    30823082    int dummy;
    3083     if((currQuotient!=NULL)||
     3083    if((currRing->qideal!=NULL)||
    30843084    (!idHomIdeal (u_id,NULL)))
    30853085    {
     
    30933093  {
    30943094    int dummy;
    3095     if((currQuotient!=NULL)||
     3095    if((currRing->qideal!=NULL)||
    30963096    (!idHomIdeal (u_id,NULL)))
    30973097    {
     
    31463146  {
    31473147    maxl = currRing->N-1+2*(iiOp==MRES_CMD);
    3148     if (currQuotient!=NULL)
     3148    if (currRing->qideal!=NULL)
    31493149    {
    31503150      Warn(
     
    31563156  if (weights!=NULL)
    31573157  {
    3158     if (!idTestHomModule(u_id,currQuotient,weights))
     3158    if (!idTestHomModule(u_id,currRing->qideal,weights))
    31593159    {
    31603160      WarnS("wrong weights given:");weights->show();PrintLn();
     
    31803180  {
    31813181    int dummy;
    3182     if((currQuotient!=NULL)||
     3182    if((currRing->qideal!=NULL)||
    31833183    (!idHomIdeal (u_id,NULL)))
    31843184    {
     
    31943194  {
    31953195    int dummy;
    3196     if((currQuotient!=NULL)||
     3196    if((currRing->qideal!=NULL)||
    31973197    (!idHomIdeal (u_id,NULL)))
    31983198    {
     
    32063206  {
    32073207    int dummy;
    3208     if((currQuotient!=NULL)||
     3208    if((currRing->qideal!=NULL)||
    32093209    (!idHomIdeal (u_id,NULL)))
    32103210    {
     
    33993399  if (w!=NULL)
    34003400  {
    3401     if (!idTestHomModule(u_id,currQuotient,w))
     3401    if (!idTestHomModule(u_id,currRing->qideal,w))
    34023402    {
    34033403      WarnS("wrong weights:");w->show();PrintLn();
     
    34103410    }
    34113411  }
    3412   result=kStd(u_id,currQuotient,hom,&w,(intvec *)v->Data());
     3412  result=kStd(u_id,currRing->qideal,hom,&w,(intvec *)v->Data());
    34133413  idSkipZeroes(result);
    34143414  res->data = (char *)result;
     
    34793479    if (w!=NULL)
    34803480    {
    3481       if (!idTestHomModule(i1,currQuotient,w))
     3481      if (!idTestHomModule(i1,currRing->qideal,w))
    34823482      {
    34833483        // no warnung: this is legal, if i in std(i,p)
     
    34963496    /* ii0 appears to be the position of the first element of il that
    34973497       does not belong to the old SB ideal */
    3498     result=kStd(i1,currQuotient,hom,&w,NULL,0,ii0);
     3498    result=kStd(i1,currRing->qideal,hom,&w,NULL,0,ii0);
    34993499    SI_RESTORE_OPT1(save1);
    35003500    idDelete(&i1);
     
    38603860    Print("//       generic fibre, that is, over Q\n");
    38613861    intvec *module_w=(intvec*)atGet(&vvAsLeftv,"isHomog",INTVEC_CMD);
    3862     scDegree(vv,module_w,currQuotient);
     3862    scDegree(vv,module_w,currRing->qideal);
    38633863    idDelete(&vv);
    38643864    rChangeCurrRing(origR);
     
    38683868  assumeStdFlag(v);
    38693869  intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
    3870   scDegree((ideal)v->Data(),module_w,currQuotient);
     3870  scDegree((ideal)v->Data(),module_w,currRing->qideal);
    38713871  char *s=SPrintEnd();
    38723872  int l=strlen(s)-1;
     
    39873987    /* drop degree zero generator from vv (if any) */
    39883988    if (i != -1) pDelete(&vv->m[i]);
    3989     long d = (long)scDimInt(vv, currQuotient);
     3989    long d = (long)scDimInt(vv, currRing->qideal);
    39903990    if (rField_is_Ring_Z(currRing) && (i == -1)) d++;
    39913991    res->data = (char *)d;
     
    39963996  }
    39973997#endif
    3998   res->data = (char *)(long)scDimInt((ideal)(v->Data()),currQuotient);
     3998  res->data = (char *)(long)scDimInt((ideal)(v->Data()),currRing->qideal);
    39993999  return FALSE;
    40004000}
     
    41804180    Print("//       performed for generic fibre, that is, over Q\n");
    41814181    intvec *module_w=(intvec*)atGet(&vvAsLeftv,"isHomog",INTVEC_CMD);
    4182     //scHilbertPoly(vv,currQuotient);
    4183     hLookSeries(vv,module_w,currQuotient);
     4182    //scHilbertPoly(vv,currRing->qideal);
     4183    hLookSeries(vv,module_w,currRing->qideal);
    41844184    idDelete(&vv);
    41854185    rChangeCurrRing(origR);
     
    41904190  assumeStdFlag(v);
    41914191  intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
    4192   //scHilbertPoly((ideal)v->Data(),currQuotient);
    4193   hLookSeries((ideal)v->Data(),module_w,currQuotient);
     4192  //scHilbertPoly((ideal)v->Data(),currRing->qideal);
     4193  hLookSeries((ideal)v->Data(),module_w,currRing->qideal);
    41944194  return FALSE;
    41954195}
     
    42124212  if (w==NULL)
    42134213  {
    4214     res->data=(void *)(long)idHomModule(v_id,currQuotient,&w);
     4214    res->data=(void *)(long)idHomModule(v_id,currRing->qideal,&w);
    42154215    if (res->data!=NULL)
    42164216    {
     
    42284228  else
    42294229  {
    4230     res->data=(void *)(long)idTestHomModule(v_id,currQuotient,w);
     4230    res->data=(void *)(long)idTestHomModule(v_id,currRing->qideal,w);
    42314231    if((res->data==NULL) && (v->rtyp==IDHDL))
    42324232    {
     
    43054305{
    43064306  assumeStdFlag(v);
    4307   res->data=(void *)scIndIntvec((ideal)(v->Data()),currQuotient);
     4307  res->data=(void *)scIndIntvec((ideal)(v->Data()),currRing->qideal);
    43084308  return FALSE;
    43094309}
    43104310static BOOLEAN jjINTERRED(leftv res, leftv v)
    43114311{
    4312   ideal result=kInterRed((ideal)(v->Data()), currQuotient);
     4312  ideal result=kInterRed((ideal)(v->Data()), currRing->qideal);
    43134313  #ifdef HAVE_RINGS
    43144314  if(rField_is_Ring(currRing))
     
    43914391{
    43924392  assumeStdFlag(v);
    4393   res->data = (char *)scKBase(-1,(ideal)(v->Data()),currQuotient);
     4393  res->data = (char *)scKBase(-1,(ideal)(v->Data()),currRing->qideal);
    43944394  return FALSE;
    43954395}
     
    45724572  int t=v->Typ();
    45734573  ideal r,m;
    4574   r=kMin_std((ideal)v->Data(),currQuotient,testHomog,NULL,m);
     4574  r=kMin_std((ideal)v->Data(),currRing->qideal,testHomog,NULL,m);
    45754575  lists l=(lists)omAllocBin(slists_bin);
    45764576  l->Init(2);
     
    45864586{
    45874587  assumeStdFlag(v);
    4588   res->data = (char *)(long)scMultInt((ideal)(v->Data()),currQuotient);
     4588  res->data = (char *)(long)scMultInt((ideal)(v->Data()),currRing->qideal);
    45894589  return FALSE;
    45904590}
     
    47444744  if (w!=NULL)
    47454745  {
    4746     if (!idTestHomModule(v_id,currQuotient,w))
     4746    if (!idTestHomModule(v_id,currRing->qideal,w))
    47474747    {
    47484748      WarnS("wrong weights");
     
    48514851#endif
    48524852
    4853   if ((currQuotient!=NULL) && !bIsSCA)
     4853  if ((currRing->qideal!=NULL) && !bIsSCA)
    48544854  {
    48554855    WerrorS("qring not supported by slimgb at the moment");
     
    48664866  if (w!=NULL)
    48674867  {
    4868     if (!idTestHomModule(u_id,currQuotient,w))
     4868    if (!idTestHomModule(u_id,currRing->qideal,w))
    48694869    {
    48704870      WarnS("wrong weights");
     
    48954895  if (w!=NULL)
    48964896  {
    4897     if (!idTestHomModule(v_id,currQuotient,w))
     4897    if (!idTestHomModule(v_id,currRing->qideal,w))
    48984898    {
    48994899      WarnS("wrong weights");
     
    49064906    }
    49074907  }
    4908   result=kSba(v_id,currQuotient,hom,&w,1,0);
     4908  result=kSba(v_id,currRing->qideal,hom,&w,1,0);
    49094909  idSkipZeroes(result);
    49104910  res->data = (char *)result;
     
    49214921  if (w!=NULL)
    49224922  {
    4923     if (!idTestHomModule(v_id,currQuotient,w))
     4923    if (!idTestHomModule(v_id,currRing->qideal,w))
    49244924    {
    49254925      WarnS("wrong weights");
     
    49324932    }
    49334933  }
    4934   result=kSba(v_id,currQuotient,hom,&w,(int)(long)u->Data(),0);
     4934  result=kSba(v_id,currRing->qideal,hom,&w,(int)(long)u->Data(),0);
    49354935  idSkipZeroes(result);
    49364936  res->data = (char *)result;
     
    49474947  if (w!=NULL)
    49484948  {
    4949     if (!idTestHomModule(v_id,currQuotient,w))
     4949    if (!idTestHomModule(v_id,currRing->qideal,w))
    49504950    {
    49514951      WarnS("wrong weights");
     
    49584958    }
    49594959  }
    4960   result=kSba(v_id,currQuotient,hom,&w,(int)(long)u->Data(),(int)(long)t->Data());
     4960  result=kSba(v_id,currRing->qideal,hom,&w,(int)(long)u->Data(),(int)(long)t->Data());
    49614961  idSkipZeroes(result);
    49624962  res->data = (char *)result;
     
    49734973  if (w!=NULL)
    49744974  {
    4975     if (!idTestHomModule(v_id,currQuotient,w))
     4975    if (!idTestHomModule(v_id,currRing->qideal,w))
    49764976    {
    49774977      WarnS("wrong weights");
     
    49844984    }
    49854985  }
    4986   result=kStd(v_id,currQuotient,hom,&w);
     4986  result=kStd(v_id,currRing->qideal,hom,&w);
    49874987  idSkipZeroes(result);
    49884988  res->data = (char *)result;
     
    50345034    add_row_shift=w->min_in();
    50355035    (*w)-=add_row_shift;
    5036     if (idTestHomModule(v_id,currQuotient,w))
     5036    if (idTestHomModule(v_id,currRing->qideal,w))
    50375037      hom=isHomog;
    50385038    else
     
    51965196{
    51975197  assumeStdFlag(v);
    5198   res->data = (char *)(long)scMult0Int((ideal)v->Data(),currQuotient);
     5198  res->data = (char *)(long)scMult0Int((ideal)v->Data(),currRing->qideal);
    51995199  return FALSE;
    52005200}
     
    59085908    Print("//       performed for generic fibre, that is, over Q\n");
    59095909    intvec *module_w=(intvec*)atGet(&uuAsLeftv,"isHomog",INTVEC_CMD);
    5910     intvec *iv=hFirstSeries(uu,module_w,currQuotient,wdegree);
     5910    intvec *iv=hFirstSeries(uu,module_w,currRing->qideal,wdegree);
    59115911    int returnWithTrue = 1;
    59125912    switch((int)(long)v->Data())
     
    59335933  assumeStdFlag(u);
    59345934  intvec *module_w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
    5935   intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currQuotient,wdegree);
     5935  intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currRing->qideal,wdegree);
    59365936  switch((int)(long)v->Data())
    59375937  {
     
    65536553{
    65546554  assumeStdFlag(v);
    6555   res->data = (char *)kNF((ideal)v->Data(),currQuotient,(poly)u->Data(),
     6555  res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(poly)u->Data(),
    65566556    0,(int)(long)w->Data());
    65576557  return FALSE;
     
    65606560{
    65616561  assumeStdFlag(v);
    6562   res->data = (char *)kNF((ideal)v->Data(),currQuotient,(ideal)u->Data(),
     6562  res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(ideal)u->Data(),
    65636563    0,(int)(long)w->Data());
    65646564  return FALSE;
     
    65826582    {
    65836583      l=1;
    6584       if (!idTestHomModule(u_id,currQuotient,iv))
     6584      if (!idTestHomModule(u_id,currRing->qideal,iv))
    65856585      {
    65866586        WarnS("wrong weights");
     
    66316631  if (ww!=NULL)
    66326632  {
    6633     if (!idTestHomModule(u_id,currQuotient,ww))
     6633    if (!idTestHomModule(u_id,currRing->qideal,ww))
    66346634    {
    66356635      WarnS("wrong weights");
     
    66436643  }
    66446644  result=kStd(u_id,
    6645               currQuotient,
     6645              currRing->qideal,
    66466646              hom,
    66476647              &ww,                  // module weights
     
    77597759  if (ww!=NULL)
    77607760  {
    7761     if (!idTestHomModule(i1,currQuotient,ww))
     7761    if (!idTestHomModule(i1,currRing->qideal,ww))
    77627762    {
    77637763      WarnS("wrong weights");
     
    77747774  si_opt_1|=Sy_bit(OPT_SB_1);
    77757775  result=kStd(i1,
    7776               currQuotient,
     7776              currRing->qideal,
    77777777              hom,
    77787778              &ww,                  // module weights
  • Singular/ipassign.cc

    r8b5fff rac00e2f  
    471471    res->data=(void*)p;
    472472    jiAssignAttr(res,a);
    473     if (TEST_V_QRING && (currQuotient!=NULL) && (!hasFlag(res,FLAG_QRING))) jjNormalizeQRingP(res);
     473    if (TEST_V_QRING && (currRing->qideal!=NULL) && (!hasFlag(res,FLAG_QRING))) jjNormalizeQRingP(res);
    474474  }
    475475  else
     
    643643    setFlag(res,FLAG_STD);
    644644  }
    645   if (TEST_V_QRING && (currQuotient!=NULL)&& (!hasFlag(res,FLAG_QRING))) jjNormalizeQRingId(res);
     645  if (TEST_V_QRING && (currRing->qideal!=NULL)&& (!hasFlag(res,FLAG_QRING))) jjNormalizeQRingId(res);
    646646  return FALSE;
    647647}
     
    661661  pNormalize(I->m[0]);
    662662  res->data=(void *)I;
    663   if (TEST_V_QRING && (currQuotient!=NULL))
     663  if (TEST_V_QRING && (currRing->qideal!=NULL))
    664664  {
    665665    if (hasFlag(a,FLAG_QRING)) setFlag(res,FLAG_QRING);
     
    677677  id_Normalize((ideal)m, currRing);
    678678  res->data=(void *)m;
    679   if (TEST_V_QRING && (currQuotient!=NULL)) jjNormalizeQRingId(res);
     679  if (TEST_V_QRING && (currRing->qideal!=NULL)) jjNormalizeQRingId(res);
    680680  return FALSE;
    681681}
     
    11721172  l1->CleanUp();
    11731173  r->CleanUp();
    1174   //if (TEST_V_QRING && (currQuotient!=NULL)) jjNormalizeQRingP(l);
     1174  //if (TEST_V_QRING && (currRing->qideal!=NULL)) jjNormalizeQRingP(l);
    11751175  return FALSE;
    11761176}
     
    19091909void jjNormalizeQRingId(leftv I)
    19101910{
    1911   if ((currQuotient!=NULL) && (!hasFlag(I,FLAG_QRING)))
     1911  if ((currRing->qideal!=NULL) && (!hasFlag(I,FLAG_QRING)))
    19121912  {
    19131913    if (I->e==NULL)
     
    19201920        {
    19211921          ideal F=idInit(1,1);
    1922           ideal II=kNF(F,currQuotient,I0);
     1922          ideal II=kNF(F,currRing->qideal,I0);
    19231923          idDelete(&F);
    19241924          if (I->rtyp!=IDHDL)
     
    19441944void jjNormalizeQRingP(leftv I)
    19451945{
    1946   if ((currQuotient!=NULL) && (!hasFlag(I,FLAG_QRING)))
     1946  if ((currRing->qideal!=NULL) && (!hasFlag(I,FLAG_QRING)))
    19471947  {
    19481948    poly p=(poly)I->Data();
     
    19501950    {
    19511951      ideal F=idInit(1,1);
    1952       poly II=kNF(F,currQuotient,p);
     1952      poly II=kNF(F,currRing->qideal,p);
    19531953      idDelete(&F);
    19541954      if ((I->rtyp==POLY_CMD)
  • Singular/ipid.h

    r8b5fff rac00e2f  
    9090
    9191/*extern ring     currRing;  in ring.h */
    92 /*extern ideal      currQuotient; in structs.h */
    9392
    9493idhdl enterid(const char * a, int lev, int t, idhdl* root, BOOLEAN init=TRUE, BOOLEAN serach=TRUE);
  • Singular/ipshell.cc

    r8b5fff rac00e2f  
    14631463  if (rHasLocalOrMixedOrdering_currRing())
    14641464  {
    1465     scComputeHC(I,currQuotient,ak,po);
     1465    scComputeHC(I,currRing->qideal,ak,po);
    14661466    if (po!=NULL)
    14671467    {
     
    34443444  #endif
    34453445
    3446   ideal stdJ = kStd(J,currQuotient,isNotHomog,NULL);
     3446  ideal stdJ = kStd(J,currRing->qideal,isNotHomog,NULL);
    34473447  idSkipZeroes( stdJ );
    34483448
     
    35113511  poly hc = (poly)NULL;
    35123512
    3513   scComputeHC( stdJ,currQuotient, 0,hc );
     3513  scComputeHC( stdJ,currRing->qideal, 0,hc );
    35143514
    35153515  if( hc!=(poly)NULL )
     
    55555555    {
    55565556      // all dependend stuff is done, clean global vars:
    5557       if (r->qideal!=NULL)
    5558       {
    5559         currQuotient=NULL;
    5560       }
    55615557      if ((currRing->ppNoether)!=NULL) pDelete(&(currRing->ppNoether));
    55625558      if (sLastPrinted.RingDependend())
  • Singular/subexpr.cc

    r8b5fff rac00e2f  
    139139        case MODUL_CMD:
    140140        case IDEAL_CMD:
    141           if ((TEST_V_QRING)  &&(currQuotient!=NULL)
     141          if ((TEST_V_QRING)  &&(currRing->qideal!=NULL)
    142142          &&(!hasFlag(this,FLAG_QRING)))
    143143          {
     
    151151        case POLY_CMD:
    152152        case VECTOR_CMD:
    153           if ((TEST_V_QRING)  &&(currQuotient!=NULL)
     153          if ((TEST_V_QRING)  &&(currRing->qideal!=NULL)
    154154          &&(!hasFlag(this,FLAG_QRING)))
    155155          {
  • kernel/GBEngine/f5gb.cc

    r8b5fff rac00e2f  
    128128    //Print("%p\n",gPrev->getFirst());
    129129    //pWrite(gPrev->getFirst()->getPoly());
    130     poly tempNF =   kNF(gbPrev,currQuotient,f_i);
     130    poly tempNF =   kNF(gbPrev,currRing->qideal,f_i);
    131131    f_i         =   tempNF;
    132132    //gPrev->insert(ONE,i,f_i);
     
    642642            testNode        =   testNode->getNext();
    643643        }
    644         poly temp   =   kNF(testId,currQuotient,u1);
     644        poly temp   =   kNF(testId,currRing->qideal,u1);
    645645        //pWrite(temp);
    646646        for(i=0;i<IDELEMS(testId);i++) {
     
    10961096        //sPolyList->print();
    10971097        sPolyList->setFirst(temp->getNext());
    1098         poly tempNF = kNF(gbPrev,currQuotient,temp->getPoly());
     1098        poly tempNF = kNF(gbPrev,currRing->qideal,temp->getPoly());
    10991099        if(NULL != tempNF) {
    11001100            pNorm(tempNF);
     
    11491149        //}
    11501150        //pWrite(temp->getPoly());
    1151         //poly tempNF = kNF(gbPrev,currQuotient,temp->getPoly());
     1151        //poly tempNF = kNF(gbPrev,currRing->qideal,temp->getPoly());
    11521152        //Print("!!!\n");
    11531153        //if(NULL != tempNF) {
     
    17581758                    pNorm(temp);
    17591759                    //pWrite(temp);
    1760                     poly tempNF =   kNF(gbPrev,currQuotient,temp);
     1760                    poly tempNF =   kNF(gbPrev,currRing->qideal,temp);
    17611761                    pNorm(tempNF);
    17621762                    if(NULL == tempNF) {
     
    19621962    gbPrev->m[0]    =   gPrev->getFirst()->getPoly();
    19631963    //idShow(gbPrev);
    1964     //idShow(currQuotient);
     1964    //idShow(currRing->qideal);
    19651965    for(i=2; i<=IDELEMS(id); i++) {
    19661966        LNode* gPrevTag =   gPrev->getLast();
  • kernel/GBEngine/kstd1.cc

    r8b5fff rac00e2f  
    26542654    pp = p_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing);
    26552655
    2656     if(Q == currQuotient)
     2656    if(Q == currRing->qideal)
    26572657      Q = SCAQuotient(currRing);
    26582658  }
     
    27042704    pp = id_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing, false);
    27052705
    2706     if(Q == currQuotient)
     2706    if(Q == currRing->qideal)
    27072707      Q = SCAQuotient(currRing);
    27082708  }
     
    27702770    //    tempQ = SCAQuotient(currRing);
    27712771
    2772     if(Q == currQuotient)
     2772    if(Q == currRing->qideal)
    27732773      tempQ = SCAQuotient(currRing);
    27742774  }
  • kernel/GBEngine/nc.cc

    r8b5fff rac00e2f  
    2222ideal twostd(ideal I) // works in currRing only!
    2323{
    24   ideal J = kStd(I, currQuotient, testHomog, NULL, NULL, 0, 0, NULL); // in currRing!!!
     24  ideal J = kStd(I, currRing->qideal, testHomog, NULL, NULL, 0, 0, NULL); // in currRing!!!
    2525  idSkipZeroes(J); // ring independent!
    2626
     
    9595
    9696//          if( q != NULL)
    97           q = kNF(J, currQuotient, q, 0, KSTD_NF_NONORM); // in currRing!!!
     97          q = kNF(J, currRing->qideal, q, 0, KSTD_NF_NONORM); // in currRing!!!
    9898
    9999#ifdef PDEBUG
    100100          p_Test(q, currRing);
    101101#if 0
    102           Print("NF(J/currQuotient)=> q: "); // !
     102          Print("NF(J/currRing->qideal)=> q: "); // !
    103103          p_Write(q, currRing);
    104104#endif
     
    179179    SI_SAVE_OPT1(save1);
    180180    si_opt_1|=Sy_bit(OPT_SB_1); // ring independent
    181     J = kStd(id_tmp, currQuotient, testHomog, NULL, NULL, 0, iSize); // J = J + K, J - std // in currRing!
     181    J = kStd(id_tmp, currRing->qideal, testHomog, NULL, NULL, 0, iSize); // J = J + K, J - std // in currRing!
    182182    SI_RESTORE_OPT1(save1);
    183183#else
    184     J=kStd(id_tmp, currQuotient,testHomog,NULL,NULL,0,0,NULL);
     184    J=kStd(id_tmp, currRing->qideal,testHomog,NULL,NULL,0,0,NULL);
    185185#endif
    186186
     
    258258  int flag, flagcnt=0, syzcnt=0;
    259259  int syzcomp = 0;
    260   ideal I = kStd(L, currQuotient,testHomog,NULL,NULL,0,0,NULL);
     260  ideal I = kStd(L, currRing->qideal,testHomog,NULL,NULL,0,0,NULL);
    261261  idSkipZeroes(I);
    262262  ideal s_I;
    263263  int idI = idElem(I);
    264264  ideal trickyQuotient;
    265   if (currQuotient !=NULL)
    266   {
    267     trickyQuotient = idSimpleAdd(currQuotient,I);
     265  if (currRing->qideal !=NULL)
     266  {
     267    trickyQuotient = idSimpleAdd(currRing->qideal,I);
    268268  }
    269269  else
     
    295295    {
    296296      q = pp_Mult_mm(I->m[j],var[i],currRing);
    297       q = kNF(I,currQuotient,q,0,0);
     297      q = kNF(I,currRing->qideal,q,0,0);
    298298      if (q!=0)
    299299      {
     
    345345      idDelete(&s_h3);
    346346      Print("...computing Syz");
    347       s_h3 = kStd(s_h2, currQuotient,(tHomog)FALSE,NULL,NULL,syzcomp,idI);
     347      s_h3 = kStd(s_h2, currRing->qideal,(tHomog)FALSE,NULL,NULL,syzcomp,idI);
    348348      SI_RESTORE_OPT1(save1);
    349349      //idShow(s_h3);
     
    369369      }
    370370      idTest(s_h3);
    371       S[syzcnt]=kStd(s_h3,currQuotient,(tHomog)FALSE,NULL,NULL);
     371      S[syzcnt]=kStd(s_h3,currRing->qideal,(tHomog)FALSE,NULL,NULL);
    372372      syzcnt++;
    373373      idDelete(&s_h3);
     
    408408    }
    409409    Print("final std");
    410     res = kStd(res, currQuotient,testHomog,NULL,NULL,0,0,NULL);
     410    res = kStd(res, currRing->qideal,testHomog,NULL,NULL,0,0,NULL);
    411411    idSkipZeroes(res);
    412412    return(res);
  • kernel/GBEngine/sca.cc

    r8b5fff rac00e2f  
    139139  ideal tempQ = Q;
    140140
    141   if(Q == currQuotient)
     141  if(Q == currRing->qideal)
    142142    tempQ = SCAQuotient(currRing);
    143143
     
    413413  ideal tempQ = Q;
    414414
    415   if(Q == currQuotient)
     415  if(Q == currRing->qideal)
    416416    tempQ = SCAQuotient(currRing);
    417417
     
    912912  ideal tempQ = Q;
    913913
    914   if(Q == currQuotient)
     914  if(Q == currRing->qideal)
    915915    tempQ = SCAQuotient(currRing);
    916916
  • kernel/GBEngine/syz.cc

    r8b5fff rac00e2f  
    364364
    365365  if (syzIndex<1) syzIndex=1;
    366   if ((syzIndex==1) && (idHomModule(res[0],currQuotient,&dummy)) && (!rIsPluralRing(currRing)))
     366  if ((syzIndex==1) && (idHomModule(res[0],currRing->qideal,&dummy)) && (!rIsPluralRing(currRing)))
    367367  {
    368368    syMinStep1(res,length);
     
    438438  if ((weights!=NULL) && (*weights!=NULL)&& ((*weights)[0]!=NULL))
    439439  {
    440     if (!idTestHomModule(res[0],currQuotient,(*weights)[0]))
     440    if (!idTestHomModule(res[0],currRing->qideal,(*weights)[0]))
    441441    {
    442442      WarnS("wrong weights given(1):"); (*weights)[0]->show();PrintLn();
    443       idHomModule(res[0],currQuotient,&w);
     443      idHomModule(res[0],currRing->qideal,&w);
    444444      w->show();PrintLn();
    445445      *weights=NULL;
     
    449449  if ((weights==NULL) || (*weights==NULL) || ((*weights)[0]==NULL))
    450450  {
    451     hom=(tHomog)idHomModule(res[0],currQuotient,&w);
     451    hom=(tHomog)idHomModule(res[0],currRing->qideal,&w);
    452452    if (hom==isHomog)
    453453    {
     
    523523    if (minim || (syzIndex!=0))
    524524    {
    525       temp = kInterRedOld(res[syzIndex],currQuotient);
     525      temp = kInterRedOld(res[syzIndex],currRing->qideal);
    526526      idDelete(&res[syzIndex]);
    527527      idSkipZeroes(temp);
     
    530530    temp = NULL;
    531531/*--- computing the syzygy modules --------------------------------*/
    532     if ((currQuotient==NULL)&&(syzIndex==0)&& (!TEST_OPT_DEGBOUND))
     532    if ((currRing->qideal==NULL)&&(syzIndex==0)&& (!TEST_OPT_DEGBOUND))
    533533    {
    534534      res[/*syzIndex+*/1] = idSyzygies(res[0/*syzIndex*/],hom,&w,FALSE,setRegularity,&Kstd1_deg);
     
    629629#ifdef HAVE_PLURAL
    630630
    631   const ideal idSaveCurrQuotient = currQuotient;
    632631  const ideal idSaveCurrRingQuotient = currRing->qideal;
    633632
     
    642641    if( ncExtensions(TESTSYZSCAMASK) )
    643642    {
    644       currQuotient = SCAQuotient(currRing);
    645       currRing->qideal = currQuotient;
     643      currRing->qideal = SCAQuotient(currRing);
    646644    }
    647645
     
    655653  syStrategy result=(syStrategy)omAlloc0(sizeof(ssyStrategy));
    656654
    657   if ((w!=NULL) && (!idTestHomModule(arg,currQuotient,w))) // is this right in SCA case???
     655  if ((w!=NULL) && (!idTestHomModule(arg,currRing->qideal,w))) // is this right in SCA case???
    658656  {
    659657    WarnS("wrong weights given(2):");w->show();PrintLn();
    660     idHomModule(arg,currQuotient,&w);
     658    idHomModule(arg,currRing->qideal,&w);
    661659    w->show();PrintLn();
    662660    w=NULL;
     
    694692    if( ncExtensions(TESTSYZSCAMASK) )
    695693    {
    696       currQuotient     = idSaveCurrQuotient;
    697694      currRing->qideal = idSaveCurrRingQuotient;
    698695    }
     
    828825  if (weights!=NULL)
    829826  {
    830     if (!idTestHomModule(res[0],currQuotient,weights))
     827    if (!idTestHomModule(res[0],currRing->qideal,weights))
    831828    {
    832829      WarnS("wrong weights given(3):");weights->show();PrintLn();
    833       idHomModule(res[0],currQuotient,&w);
     830      idHomModule(res[0],currRing->qideal,&w);
    834831      if (w!=NULL) { w->show();PrintLn();}
    835832      weights=NULL;
     
    837834  }
    838835#if 0
    839   if (idHomModule(res[0],currQuotient,&w)!=isHomog)
     836  if (idHomModule(res[0],currRing->qideal,&w)!=isHomog)
    840837  {
    841838    Warn("betti-command: Input is not homogeneous!");
  • kernel/GBEngine/syz0.cc

    r8b5fff rac00e2f  
    7979
    8080  while (((k<wend) && (pGetComp(F[k]) == i)) ||
    81          ((currQuotient!=NULL) && (k<regularPairs+IDELEMS(currQuotient))))
     81         ((currRing->qideal!=NULL) && (k<regularPairs+IDELEMS(currRing->qideal))))
    8282  {
    8383    p = pOne();
    8484    if ((k<wend) && (pGetComp(F[k]) == i) && (k!=j))
    8585      pLcm(F[j],F[k],p);
    86     else if (ii<IDELEMS(currQuotient))
     86    else if (ii<IDELEMS(currRing->qideal))
    8787    {
    8888      q = pHead(F[j]);
     
    9393        pSetm(q);
    9494      }
    95       pLcm(q,currQuotient->m[ii],p);
     95      pLcm(q,currRing->qideal->m[ii],p);
    9696      if (mW!=NULL)
    9797      {
     
    472472      pSetExp(p,j,pGetExp(p,j) -pGetExp(mW->m[pGetComp(p)-1],j));
    473473  }
    474   while ((p!=NULL) && (i<IDELEMS(currQuotient)))
    475   {
    476     if (pDivisibleBy(currQuotient->m[i],p))
     474  while ((p!=NULL) && (i<IDELEMS(currRing->qideal)))
     475  {
     476    if (pDivisibleBy(currRing->qideal->m[i],p))
    477477    {
    478478      //pNorm(toNorm);
    479       toNorm = ksOldSpolyRed(currQuotient->m[i],toNorm);
     479      toNorm = ksOldSpolyRed(currRing->qideal->m[i],toNorm);
    480480      pDelete(&p);
    481481      if (toNorm==NULL) return NULL;
     
    530530  //for (j=0;j<Fl;j++) pWrite(F[j]);
    531531  //PrintLn();
    532   if (currQuotient==NULL)
     532  if (currRing->qideal==NULL)
    533533    pairs=(polyset)omAlloc0(Fl*sizeof(poly));
    534534  else
    535535  {
    536     gencQ = IDELEMS(currQuotient);
     536    gencQ = IDELEMS(currRing->qideal);
    537537    pairs=(polyset)omAlloc0((Fl+gencQ)*sizeof(poly));
    538538  }
     
    564564    }
    565565    syCreatePairs(F,lini,wend,k,j,i,pairs,Fl,mW);
    566     if (currQuotient!=NULL) wend = Fl+gencQ;
     566    if (currRing->qideal!=NULL) wend = Fl+gencQ;
    567567    for (k=lini;k<wend;k++)
    568568    {
     
    593593        {
    594594          syz = pairs[k];
    595           syz->coef = nCopy(currQuotient->m[k-Fl]->coef);
     595          syz->coef = nCopy(currRing->qideal->m[k-Fl]->coef);
    596596          syz->coef = nNeg(syz->coef);
    597597          lastmonom = syz;
    598598          multWith = pDivide(syz,F[j]);
    599           multWith->coef = nCopy(currQuotient->m[k-Fl]->coef);
     599          multWith->coef = nCopy(currRing->qideal->m[k-Fl]->coef);
    600600        }
    601601        pSetComp(syz,j+1);
     
    611611          else
    612612          {
    613             PrintS("pair: ");pWrite0(F[j]);PrintS("  ");pWrite(currQuotient->m[k-Fl]);
     613            PrintS("pair: ");pWrite0(F[j]);PrintS("  ");pWrite(currRing->qideal->m[k-Fl]);
    614614          }
    615615        }
     
    646646          if (l<kkk)
    647647          {
    648             if ((currQuotient!=NULL) && (isNotReduced))
     648            if ((currRing->qideal!=NULL) && (isNotReduced))
    649649            {
    650650              kBucketClear(sy0buck,&toRed,&ltR);
     
    727727  }
    728728  (*newmodcomp)[Fl+1] = Sl;
    729   if (currQuotient==NULL)
     729  if (currRing->qideal==NULL)
    730730    omFreeSize((ADDRESS)pairs,Fl*sizeof(poly));
    731731  else
    732     omFreeSize((ADDRESS)pairs,(Fl+IDELEMS(currQuotient))*sizeof(poly));
     732    omFreeSize((ADDRESS)pairs,(Fl+IDELEMS(currRing->qideal))*sizeof(poly));
    733733  omFreeSize((ADDRESS)Flength,Fl*sizeof(int));
    734734  delete *modcomp;
     
    10301030      fr[i] = NULL;
    10311031  }
    1032   if (currQuotient!=NULL)
     1032  if (currRing->qideal!=NULL)
    10331033  {
    10341034    for (int i=0; i<rl; i++)
     
    10361036      if (result->fullres[i]!=NULL)
    10371037      {
    1038         ideal t=kNF(currQuotient,NULL,result->fullres[i]);
     1038        ideal t=kNF(currRing->qideal,NULL,result->fullres[i]);
    10391039        idDelete(&result->fullres[i]);
    10401040        result->fullres[i]=t;
  • kernel/GBEngine/syz3.cc

    r8b5fff rac00e2f  
    18521852    if (temp->m[i]!=NULL)
    18531853    {
    1854       new_generators->m[0] = kNF(syzstr->res[0],currQuotient,temp->m[i]);
     1854      new_generators->m[0] = kNF(syzstr->res[0],currRing->qideal,temp->m[i]);
    18551855      if (!nIsOne(pGetCoeff(new_generators->m[0])))
    18561856        pNorm(new_generators->m[0]);
  • kernel/GBEngine/test.cc

    r8b5fff rac00e2f  
    267267
    268268  {
    269     ideal G = kStd(I, currQuotient, testHomog, NULL);
     269    ideal G = kStd(I, currRing->qideal, testHomog, NULL);
    270270
    271271#ifdef PDEBUG
  • kernel/GBEngine/units.cc

    r8b5fff rac00e2f  
    3434  }
    3535  ideal M0=idInit(IDELEMS(M),M->rank);
    36   ideal M1=kNF(N,currQuotient,M,0,KSTD_NF_ECART);
     36  ideal M1=kNF(N,currRing->qideal,M,0,KSTD_NF_ECART);
    3737  while(idElem(M1)>0&&(d==-1||id_MinDegW(M1,w,currRing)<=d))
    3838  {
     
    4747    }
    4848    idDelete(&M1);
    49     M1=kNF(N,currQuotient,M,0,KSTD_NF_ECART);
     49    M1=kNF(N,currRing->qideal,M,0,KSTD_NF_ECART);
    5050  }
    5151  idDelete(&M1);
  • kernel/fglm/fglmhom.cc

    r8b5fff rac00e2f  
    109109{
    110110    int numelems;
    111     intvec * newhilb = hHstdSeries( current, NULL, currQuotient );
     111    intvec * newhilb = hHstdSeries( current, NULL, currRing->qideal );
    112112
    113113    loop
     
    351351    rChangeCurrRing( sourceRing );
    352352
    353     intvec * hilb = hHstdSeries( sourceIdeal, NULL, currQuotient );
     353    intvec * hilb = hHstdSeries( sourceIdeal, NULL, currRing->qideal );
    354354    int s;
    355355    dat.sourceIdeal= sourceIdeal;
  • kernel/ideals.cc

    r8b5fff rac00e2f  
    6868  }
    6969  #endif
    70   homog = idHomModule(h1,currQuotient,&wth);
     70  homog = idHomModule(h1,currRing->qideal,&wth);
    7171  if (rHasGlobalOrdering(currRing))
    7272  {
     
    7979    else
    8080    {
    81       ideal re=kMin_std(h1,currQuotient,(tHomog)homog,&wth,h2,NULL,0,3);
     81      ideal re=kMin_std(h1,currRing->qideal,(tHomog)homog,&wth,h2,NULL,0,3);
    8282      idDelete(&re);
    8383      return h2;
     
    9191  pEnlargeSet(&(e->m),IDELEMS(e),15);
    9292  IDELEMS(e) = 16;
    93   h2 = kStd(h1,currQuotient,isNotHomog,NULL);
     93  h2 = kStd(h1,currRing->qideal,isNotHomog,NULL);
    9494  h3 = idMaxIdeal(1);
    9595  h4=idMult(h2,h3);
    9696  idDelete(&h3);
    97   h3=kStd(h4,currQuotient,isNotHomog,NULL);
     97  h3=kStd(h4,currRing->qideal,isNotHomog,NULL);
    9898  k = IDELEMS(h3);
    9999  while ((k > 0) && (h3->m[k-1] == NULL)) k--;
     
    124124  idDelete(&h3);
    125125  idDelete(&h4);
    126   if (currQuotient!=NULL)
     126  if (currRing->qideal!=NULL)
    127127  {
    128128    h3=idInit(1,e->rank);
    129     h2=kNF(h3,currQuotient,e);
     129    h2=kNF(h3,currRing->qideal,e);
    130130    idDelete(&h3);
    131131    idDelete(&e);
     
    236236  if (length==0)
    237237  {
    238     if ((currQuotient==NULL)
     238    if ((currRing->qideal==NULL)
    239239    && (currRing->OrdSgn==1)
    240240    && (!rIsPluralRing(currRing))
     
    284284  }
    285285  intvec *w=NULL;
    286   temp1 = kStd(temp,currQuotient,testHomog,&w,NULL,length);
     286  temp1 = kStd(temp,currRing->qideal,testHomog,&w,NULL,length);
    287287  if (w!=NULL) delete w;
    288288  idDelete(&temp);
     
    336336  {
    337337     w=NULL;
    338      temp1=kStd(result,currQuotient,testHomog,&w);
     338     temp1=kStd(result,currRing->qideal,testHomog,&w);
    339339     if (w!=NULL) delete w;
    340340     idDelete(&result);
     
    342342     return temp1;
    343343  }
    344   else //temp1=kInterRed(result,currQuotient);
     344  else //temp1=kInterRed(result,currRing->qideal);
    345345    return result;
    346346}
     
    424424  }
    425425  /* std computation --------------------------------------------*/
    426   tempstd = kStd(bigmat,currQuotient,testHomog,&w,NULL,syzComp);
     426  tempstd = kStd(bigmat,currRing->qideal,testHomog,&w,NULL,syzComp);
    427427  if (w!=NULL) delete w;
    428428  idDelete(&bigmat);
     
    491491  //if (hom==testHomog)
    492492  //{
    493   //  if(idHomIdeal(h1,currQuotient))
     493  //  if(idHomIdeal(h1,currRing->qideal))
    494494  //  {
    495495  //    hom=TRUE;
     
    531531
    532532  Print("Prepare::currQuotient: ");
    533   idPrint(currQuotient);
     533  idPrint(currRing->qideal);
    534534#endif
    535535#endif
     
    539539  idTest(h2);
    540540
    541   h3 = kStd(h2,currQuotient,hom,w,NULL,syzcomp);
     541  h3 = kStd(h2,currRing->qideal,hom,w,NULL,syzcomp);
    542542
    543543#if MYTEST
     
    700700  }
    701701  idTest(s_h3);
    702   if (currQuotient != NULL)
    703   {
    704     ideal ts_h3=kStd(s_h3,currQuotient,h,w);
     702  if (currRing->qideal != NULL)
     703  {
     704    ideal ts_h3=kStd(s_h3,currRing->qideal,h,w);
    705705    idDelete(&s_h3);
    706706    s_h3 = ts_h3;
     
    10411041    }
    10421042  }
    1043   ideal s_result = kNF(s_h3,currQuotient,s_temp,k);
     1043  ideal s_result = kNF(s_h3,currRing->qideal,s_temp,k);
    10441044  s_result->rank = s_h3->rank;
    10451045  ideal s_rest = idInit(IDELEMS(s_result),k);
     
    12251225  if ((k2==0) && (k>1)) *addOnlyOne = FALSE;
    12261226  intvec * weights;
    1227   hom = (tHomog)idHomModule(h1,currQuotient,&weights);
     1227  hom = (tHomog)idHomModule(h1,currRing->qideal,&weights);
    12281228  if /**addOnlyOne &&*/ (/*(*/ !h1IsStb /*)*/)
    1229     temph1 = kStd(h1,currQuotient,hom,&weights,NULL);
     1229    temph1 = kStd(h1,currRing->qideal,hom,&weights,NULL);
    12301230  else
    12311231    temph1 = idCopy(h1);
     
    13431343  ideal s_h4 = idInitializeQuot (h1,h2,h1IsStb,&addOnlyOne,&kmax);
    13441344
    1345   hom = (tHomog)idHomModule(s_h4,currQuotient,&weights1);
     1345  hom = (tHomog)idHomModule(s_h4,currRing->qideal,&weights1);
    13461346
    13471347  ring orig_ring=currRing;
     
    13631363  if (addOnlyOne)
    13641364  {
    1365     s_h3 = kStd(s_h4,currQuotient,hom,&weights1,NULL,0/*kmax-1*/,IDELEMS(s_h4)-1);
     1365    s_h3 = kStd(s_h4,currRing->qideal,hom,&weights1,NULL,0/*kmax-1*/,IDELEMS(s_h4)-1);
    13661366  }
    13671367  else
    13681368  {
    1369     s_h3 = kStd(s_h4,currQuotient,hom,&weights1,NULL,kmax-1);
     1369    s_h3 = kStd(s_h4,currRing->qideal,hom,&weights1,NULL,kmax-1);
    13701370  }
    13711371  SI_RESTORE_OPT1(old_test1);
     
    14281428    return idCopy(h1);
    14291429  }
    1430   if ((currQuotient!=NULL) && rIsPluralRing(origR))
     1430  if ((currRing->qideal!=NULL) && rIsPluralRing(origR))
    14311431  {
    14321432    WerrorS("cannot eliminate in a qring");
     
    16981698          {
    16991699            q = p;
    1700             p = kNF(R,currQuotient,q);
     1700            p = kNF(R,currRing->qideal,q);
    17011701            p_Delete(&q,currRing);
    17021702          }
     
    17621762        {
    17631763          q = p;
    1764           p = kNF(R,currQuotient,q);
     1764          p = kNF(R,currRing->qideal,q);
    17651765          p_Delete(&q,currRing);
    17661766        }
     
    18341834    //if (ar>1) // otherwise done in mpMinorToResult
    18351835    //{
    1836     //  matrix bb=(matrix)kNF(R,currQuotient,(ideal)b);
     1836    //  matrix bb=(matrix)kNF(R,currRing->qideal,(ideal)b);
    18371837    //  bb->rank=b->rank; bb->nrows=b->nrows; bb->ncols=b->ncols;
    18381838    //  idDelete((ideal*)&b); b=bb;
     
    18661866    if (id1->m[i] != NULL)
    18671867    {
    1868       p = kNF(id2,currQuotient,id1->m[i]);
     1868      p = kNF(id2,currRing->qideal,id1->m[i]);
    18691869      if (p != NULL)
    18701870      {
     
    19891989    s_temp=arg;
    19901990
    1991   ideal s_temp1 = kStd(s_temp,currQuotient,testHomog,&w,NULL,length);
     1991  ideal s_temp1 = kStd(s_temp,currRing->qideal,testHomog,&w,NULL,length);
    19921992  if (w!=NULL) delete w;
    19931993
     
    21212121
    21222122  idTest(s_temp);
    2123   ideal s_temp1 = kStd(s_temp,currQuotient,hom,&wtmp,NULL,length);
     2123  ideal s_temp1 = kStd(s_temp,currRing->qideal,hom,&wtmp,NULL,length);
    21242124
    21252125  //if (wtmp!=NULL)  Print("output weights:");wtmp->show(1);PrintLn();
  • kernel/ideals.h

    r8b5fff rac00e2f  
    1616typedef ideal *            resolvente;
    1717
    18 extern ideal currQuotient;
    19 
    20 
    2118inline ideal idCopyFirstK (const ideal ide, const int k, ring R = currRing)
    2219{
  • kernel/polys.cc

    r8b5fff rac00e2f  
    1111
    1212ring  currRing = NULL;
    13 ideal currQuotient = NULL;
    1413
    1514void rChangeCurrRing(ring r)
     
    2726    //------------ set global ring vars --------------------------------
    2827    currRing = r;
    29     currQuotient = r->qideal;
     28    currRing->qideal = r->qideal;
    3029    //------------ global variables related to coefficients ------------
    3130    assume( r->cf!= NULL );
     
    3837  {
    3938    currRing = NULL;
    40     currQuotient = NULL;
     39    currRing->qideal = NULL;
    4140  }
    4241}
     
    5352  //------------ set global ring vars --------------------------------
    5453  //currRing = r;
    55   //currQuotient=NULL;
    5654  if (r != NULL)
    5755  {
    5856    rTest(r);
    5957    //------------ set global ring vars --------------------------------
    60     //currQuotient=r->qideal;
    6158
    6259    //------------ global variables related to coefficients ------------
  • kernel/test.cc

    r8b5fff rac00e2f  
    378378
    379379  {
    380     ideal G = kStd(I, currQuotient, testHomog, NULL);
     380    ideal G = kStd(I, currRing->qideal, testHomog, NULL);
    381381
    382382#ifdef PDEBUG
  • libpolys/polys/matpol.cc

    r8b5fff rac00e2f  
    14231423      //for (j=c-1;j>=0;j--)
    14241424      //{
    1425       //  if (q1[j]!=NULL) q1[j] = kNF(R,currQuotient,q1[j]);
     1425      //  if (q1[j]!=NULL) q1[j] = kNF(R,currRing->qideal,q1[j]);
    14261426      //}
    14271427    }
     
    14631463      for (j=c-1;j>=0;j--)
    14641464      {
    1465         if (q1[j]!=NULL) q1[j] = kNF(R,currQuotient,q1[j]);
     1465        if (q1[j]!=NULL) q1[j] = kNF(R,currRing->qideal,q1[j]);
    14661466      }
    14671467    }
  • libpolys/polys/monomials/ring.cc

    r8b5fff rac00e2f  
    46494649   {
    46504650      new_r->qideal = idrCopyR(old_r->qideal, old_r, new_r);
    4651       //currQuotient = new_r->qideal;
    46524651   }
    46534652
Note: See TracChangeset for help on using the changeset viewer.