Changeset 18ff4c in git


Ignore:
Timestamp:
Jul 25, 2007, 12:53:15 PM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
Children:
1da0b56138c1e89904888f80b4e46d2b5370e1e2
Parents:
19408ce627be07e5f06ea3acb902cb1deccb10af
Message:
*hannes: NF, code cleanup


git-svn-id: file:///usr/local/Singular/svn/trunk@10253 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/gring.cc

    r19408c r18ff4c  
    77 *  Author:  levandov (Viktor Levandovsky)
    88 *  Created: 8/00 - 11/00
    9  *  Version: $Id: gring.cc,v 1.47 2007-07-24 16:22:36 motsak Exp $
     9 *  Version: $Id: gring.cc,v 1.48 2007-07-25 10:53:14 Singular Exp $
    1010 *******************************************************************/
    1111#include "mod2.h"
     
    17271727  poly pp=nc_mm_Mult_pp(m,p,currRing);
    17281728  assume(pp!=NULL);
    1729  
     1729
    17301730  pDelete(&m);
    17311731  number n=nCopy(pGetCoeff(pp));
     
    17621762  PrintS(", ");
    17631763  pWrite0(p);
    1764   PrintS(", *c): "); 
    1765 #endif 
    1766  
     1764  PrintS(", *c): ");
     1765#endif
     1766
    17671767  // b will not by multiplied by any constant in this impl.
    17681768  // ==> *c=1
     
    17771777
    17781778//    poly pLmB = pHead(b);
    1779     poly m = pOne();   
     1779    poly m = pOne();
    17801780    pExpVectorDiff(m, b, p);
    17811781//    pDelete(&pLmB);
    17821782  //pSetm(m);
    1783    
     1783
    17841784#ifdef PDEBUG
    17851785    pTest(m);
     
    17871787#endif
    17881788
    1789     pp = nc_mm_Mult_pp(m, p, currRing); 
     1789    pp = nc_mm_Mult_pp(m, p, currRing);
    17901790
    17911791#if MYTEST
    1792     PrintS("\n{b': "); 
     1792    PrintS("\n{b': ");
    17931793    pWrite0(b);
    1794     PrintS(", m: "); 
     1794    PrintS(", m: ");
    17951795    pWrite0(m);
    1796     PrintS(", pp: "); 
    1797     pWrite0(pp); 
     1796    PrintS(", pp: ");
     1797    pWrite0(pp);
    17981798    PrintS(" }\n");
    1799 #endif     
     1799#endif
    18001800
    18011801    pDelete(&m); // one m for all tries!
    18021802
    18031803//    assume( pp != NULL );
    1804    
     1804
    18051805    if( pp == NULL )
    18061806    {
     
    18081808
    18091809      if( !p_DivisibleBy(p, b, currRing) )
    1810         return;     
    1811      
     1810        return;
     1811
    18121812    }
    18131813  }
    18141814
    18151815#if MYTEST
    1816   PrintS("{b': "); 
     1816  PrintS("{b': ");
    18171817  pWrite0(b);
    1818   PrintS(", pp: "); 
    1819   pWrite0(pp); 
     1818  PrintS(", pp: ");
     1819  pWrite0(pp);
    18201820  PrintS(" }\n");
    1821 #endif     
     1821#endif
    18221822
    18231823
     
    20772077        #endif
    20782078
    2079         q = kNF(J,currQuotient,q,0,4);
     2079        q = kNF(J,currQuotient,q,0,KSTD_NF_NONORM);
    20802080
    20812081        #ifdef PDEBUG
     
    24672467  pTest(DDN);
    24682468#endif
    2469  
     2469
    24702470  matrix CC = NULL;
    24712471  matrix DD = NULL;
     
    24932493  ring save = currRing;
    24942494  bool WeChangeRing = false;
    2495  
     2495
    24962496  if (currRing!=r)
    24972497  {
     
    25002500    WeChangeRing = true;
    25012501  }
    2502                    
     2502
    25032503  r->nc = (nc_struct *)omAlloc0(sizeof(nc_struct));
    25042504  r->nc->ref = 1;
     
    25172517  assume( (CCC != NULL) != (CCN != NULL) ); // exactly one data about coeffs (C).
    25182518  assume( !((DDD != NULL) && (DDN != NULL)) ); // at most one data about tails (D).
    2519  
     2519
    25202520  /* initialition of the matrix C */
    25212521  /* check the correctness of arguments */
     
    26102610        else
    26112611          qN = p_GetCoeff(MATELEM(C,i,j),r);
    2612        
     2612
    26132613        if ( qN == NULL )   /* check the consistency: Cij!=0 */
    26142614          // find also illegal pN
     
    26762676    return TRUE;
    26772677  }
    2678   r->nc->C = C; // if C and D were given by matrices at the beginning they are in r 
     2678  r->nc->C = C; // if C and D were given by matrices at the beginning they are in r
    26792679  r->nc->D = D; // otherwise they should be in r->nc->basering(polynomial * Id_{N})
    2680  
     2680
    26812681  if (WeChangeRing)
    26822682    rChangeCurrRing(save);
    2683  
     2683
    26842684  return nc_InitMultiplication(r);
    26852685}
  • kernel/kstd1.cc

    r19408c r18ff4c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd1.cc,v 1.25 2007-07-24 16:19:09 motsak Exp $ */
     4/* $Id: kstd1.cc,v 1.26 2007-07-25 10:53:14 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    14021402    }
    14031403  }
    1404   if ((lazyReduce & 1)==0)
     1404  if ((lazyReduce & KSTD_NF_LAZY)==0)
    14051405  {
    14061406    for (i=strat->sl; i>=0; i--)
     
    14231423  deleteHC(&p,&o,&j,strat);
    14241424  if (TEST_OPT_PROT) { PrintS("r"); mflush(); }
    1425   if (p!=NULL) p = redMoraNF(p,strat, lazyReduce & 2);
    1426   if ((p!=NULL)&&((lazyReduce & 1)==0))
     1425  if (p!=NULL) p = redMoraNF(p,strat, lazyReduce & KSTD_NF_ECART);
     1426  if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
    14271427  {
    14281428    if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
     
    15201520    }
    15211521  }
    1522   if (TEST_OPT_INTSTRATEGY && ((lazyReduce & 1)==0))
     1522  if (TEST_OPT_INTSTRATEGY && ((lazyReduce & KSTD_NF_LAZY)==0))
    15231523  {
    15241524    for (i=strat->sl; i>=0; i--)
     
    15481548        }
    15491549        if (TEST_OPT_PROT) { PrintS("r"); mflush(); }
    1550         p = redMoraNF(p,strat, lazyReduce & 2);
    1551         if ((p!=NULL)&&((lazyReduce & 1)==0))
     1550        p = redMoraNF(p,strat, lazyReduce & KSTD_NF_ECART);
     1551        if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
    15521552        {
    15531553          if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
     
    21362136  if(rIsSCA(currRing))
    21372137  {
    2138 
    21392138    const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
    21402139    const unsigned int m_iLastAltVar  = scaLastAltVar(currRing);
     
    21482147  }
    21492148#endif
    2150  
    2151 //  assume(!rIsSCA(currRing));
    2152  
     2149
    21532150//  if (TEST_OPT_PROT)
    21542151//  {
     
    22172214    id_Delete( &tempF, currRing);
    22182215#endif
    2219  
     2216
    22202217  return shdl;
    22212218}
  • kernel/kstd1.h

    r19408c r18ff4c  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: kstd1.h,v 1.1.1.1 2003-10-06 12:15:53 Singular Exp $ */
     6/* $Id: kstd1.h,v 1.2 2007-07-25 10:53:15 Singular Exp $ */
    77/*
    88* ABSTRACT
     
    1616*/
    1717ideal mora (ideal F, ideal Q,intvec *w,intvec *hilb,kStrategy strat);
     18
     19// lazy_reduce flags: can be combined by |
     20#define KSTD_NF_LAZY   1
     21  // do only a reduction of the leading term
     22#define KSTD_NF_ECART  2
     23  // only local: recude even with bad ecart
     24#define KSTD_NF_NONORM 4
     25  // only global: avoid normamlization, return a multiply of NF
    1826
    1927poly kNF1(ideal F, ideal Q, poly q, kStrategy strat, int lazyReduce);
  • kernel/kstd2.cc

    r19408c r18ff4c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.52 2007-07-25 10:03:20 Singular Exp $ */
     4/* $Id: kstd2.cc,v 1.53 2007-07-25 10:53:15 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    14161416  int max_ind;
    14171417  p = redNF(pCopy(q),max_ind,strat);
    1418   if ((p!=NULL)&&((lazyReduce & 1)==0))
     1418  if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
    14191419  {
    14201420    BITSET save=test;
    14211421    test &= ~Sy_bit(OPT_INTSTRATEGY);
    14221422    if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
    1423     p = redtailBba(p,max_ind,strat,(lazyReduce & 4)==0);
     1423    p = redtailBba(p,max_ind,strat,(lazyReduce & KSTD_NF_NONORM)==0);
    14241424    test=save;
    14251425  }
     
    14701470      if (TEST_OPT_PROT) { PrintS("r");mflush(); }
    14711471      p = redNF(pCopy(q->m[i]),max_ind,strat);
    1472       if ((p!=NULL)&&((lazyReduce & 1)==0))
     1472      if ((p!=NULL)&&((lazyReduce & KSTD_NF_LAZY)==0))
    14731473      {
    14741474        BITSET save=test;
    14751475        test &= ~Sy_bit(OPT_INTSTRATEGY);
    14761476        if (TEST_OPT_PROT) { PrintS("t"); mflush(); }
    1477         p = redtailBba(p,max_ind,strat,(lazyReduce & 4)==0);
     1477        p = redtailBba(p,max_ind,strat,(lazyReduce & KSTD_NF_NONORM)==0);
    14781478        test=save;
    14791479      }
  • kernel/kstdfac.cc

    r19408c r18ff4c  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstdfac.cc,v 1.10 2007-07-13 14:19:26 Singular Exp $ */
     4/* $Id: kstdfac.cc,v 1.11 2007-07-25 10:53:15 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: factorizing alg. of Buchberger
     
    433433          if (n->D->m[j]!=NULL)
    434434          {
    435             poly r=kNF(n->Shdl,NULL,n->D->m[j],0,TRUE);
     435            poly r=kNF(n->Shdl,NULL,n->D->m[j],0,KSTD_NF_LAZY | KSTD_NF_NONORM);
    436436            if (r==NULL)
    437437            {
     
    487487          if ((n->sl>=0)&&(n->S[0]!=NULL))
    488488          {
    489             ideal r=kNF(n->Shdl,NULL,Lj->d,0,TRUE);
     489            ideal r=kNF(n->Shdl,NULL,Lj->d,0,KSTD_NF_LAZY | KSTD_NF_NONORM);
    490490#ifndef NDEBUG
    491491              if(strat_fac_debug)
     
    749749            if (n->D->m[j]!=NULL)
    750750            {
    751               poly r=kNF(n->Shdl,NULL,n->D->m[j],0,TRUE);
     751              poly r=kNF(n->Shdl,NULL,n->D->m[j],0,KSTD_NF_LAZY | KSTD_NF_NONORM);
    752752              if (r==NULL)
    753753              {
     
    805805            if ((n->sl>=0)&&(n->S[0]!=NULL))
    806806            {
    807               ideal r=kNF(n->Shdl,NULL,Lj->d,0,TRUE);
     807              ideal r=kNF(n->Shdl,NULL,Lj->d,0,KSTD_NF_LAZY | KSTD_NF_NONORM);
    808808              if (idIs0(r))
    809809              {
     
    976976      while(Li!=Lj)
    977977      {
    978         ideal r=kNF(Lj->d,NULL,Li->d,0,TRUE);
     978        ideal r=kNF(Lj->d,NULL,Li->d,0,KSTD_NF_LAZY | KSTD_NF_NONORM);
    979979        if (idIs0(r))
    980980        {
  • kernel/sca.cc

    r19408c r18ff4c  
    77 *  Author:  motsak (Oleksandr Motsak)
    88 *  Created: 2006/12/18
    9  *  Version: $Id: sca.cc,v 1.12 2007-07-24 16:34:00 motsak Exp $
     9 *  Version: $Id: sca.cc,v 1.13 2007-07-25 10:53:15 Singular Exp $
    1010 *******************************************************************/
    1111
     
    976976#if MYTEST
    977977   PrintS("<sca_gr_bba>\n");
    978 #endif 
     978#endif
    979979
    980980  assume(rIsSCA(currRing));
     
    982982#ifndef NDEBUG
    983983  idTest(F);
    984   idTest(Q); 
     984  idTest(Q);
    985985#endif
    986986
    987987  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
    988988  const unsigned int m_iLastAltVar  = scaLastAltVar(currRing);
    989  
     989
    990990  ideal tempF = id_KillSquares(F, m_iFirstAltVar, m_iLastAltVar, currRing);
    991991  ideal tempQ = Q;
     
    11121112#endif
    11131113    assume( save != NULL );
    1114    
     1114
    11151115    // SCA Specials:
    11161116
    11171117    {
    11181118      const poly pNext = pNext(save);
    1119      
     1119
    11201120      if( pNext != NULL )
    11211121      for( unsigned int i = m_iFirstAltVar; i <= m_iLastAltVar; i++ )
     
    11231123      {
    11241124        assume(p_GetExp(save, i, currRing) == 1);
    1125        
     1125
    11261126        const poly tt = sca_pp_Mult_xi_pp(i, pNext, currRing);
    11271127
     
    12051205
    12061206  if (tempQ!=NULL) updateResult(strat->Shdl,tempQ,strat);
    1207  
     1207
    12081208  id_Delete(&tempF, currRing);
    12091209
     
    12331233//  1. rG is  a commutative polynomial ring \otimes anticommutative algebra
    12341234//  2. factor ideal rGR->qideal contains squares of all alternating variables.
    1235 // 
     1235//
    12361236// if yes, make rGR a super-commutative algebra!
    12371237// NOTE: Factors of SuperCommutative Algebras are supported this way!
     
    12751275      assume(MATELEM(C,i,j) != NULL); // after CallPlural!
    12761276      number c = p_GetCoeff(MATELEM(C,i,j), rBase);
    1277      
     1277
    12781278      if( n_IsMOne(c, rBase) )
    1279       {       
    1280         if( i < iAltVarStart) 
     1279      {
     1280        if( i < iAltVarStart)
    12811281          iAltVarStart = i;
    1282          
     1282
    12831283        if( j > iAltVarEnd)
    12841284          iAltVarEnd = j;
     
    12981298  if( (iAltVarEnd == -1) || (iAltVarStart == (N+1)) )
    12991299    return false; // either no alternating varables, or a single one => we are in commutative case!
    1300  
     1300
    13011301  for(int i = 1; i < N; i++)
    13021302  {
     
    13041304    {
    13051305      assume(MATELEM(C,i,j) != NULL); // after CallPlural!
    1306       number c = p_GetCoeff(MATELEM(C,i,j), rBase);     
     1306      number c = p_GetCoeff(MATELEM(C,i,j), rBase);
    13071307
    13081308      if( (iAltVarStart <= i) && (j <= iAltVarEnd) ) // S <= i < j <= E
     
    13441344  assume(rGR->qideal != NULL);
    13451345  assume(rG->qideal == NULL);
    1346  
     1346
    13471347  const ideal idQuotient = rGR->qideal;
    13481348
    1349   // check for 
    1350   // y_{iAltVarStart}^2, y_{iAltVarStart+1}^2, \ldots, y_{iAltVarEnd}^2  (iAltVarEnd > iAltVarStart) 
     1349  // check for
     1350  // y_{iAltVarStart}^2, y_{iAltVarStart+1}^2, \ldots, y_{iAltVarEnd}^2  (iAltVarEnd > iAltVarStart)
    13511351  // to be within quotient ideal.
    13521352
     
    13601360
    13611361    // square = NF( var(i)^2 | Q )
    1362     // NOTE: rSaveRing == currRing now! 
     1362    // NOTE: rSaveRing == currRing now!
    13631363    // NOTE: there is no better way to check this in general!
    1364     square = kNF(idQuotient, NULL, square, 0, 0); 
    1365    
     1364    square = kNF(idQuotient, NULL, square, 0, 0);
     1365
    13661366    if( square != NULL ) // var(i)^2 is not in Q?
    13671367    {
    13681368      p_Delete(&square, rSaveRing);
    1369       bSCA = false;     
    1370     }   
    1371   }
    1372  
     1369      bSCA = false;
     1370    }
     1371  }
     1372
    13731373
    13741374  if (bWeChangeRing)
     
    13781378
    13791379  if(!bSCA) return false;
    1380  
     1380
    13811381
    13821382
     
    13921392
    13931393  idSkipZeroes( tempQ );
    1394  
     1394
    13951395  if( idIs0(tempQ) )
    13961396    rGR->nc->SCAQuotient() = NULL;
     
    14071407  sca_p_ProcsSet(rGR, rGR->p_Procs);
    14081408
    1409  
     1409
    14101410  return true;
    14111411}
     
    14541454    tempQ = currRing->nc->SCAQuotient();
    14551455
    1456   // Q or tempQ will not be used below :((( 
     1456  // Q or tempQ will not be used below :(((
    14571457
    14581458  bool bIdHomog = id_IsSCAHomogeneous(tempF, NULL, NULL, currRing); // wCx == wCy == NULL!
     
    16851685      {
    16861686        assume(p_GetExp(pSave, i, currRing) == 1);
    1687        
     1687
    16881688        const poly pNew = sca_pp_Mult_xi_pp(i, pNext, currRing);
    16891689
     
    18661866  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
    18671867  const unsigned int m_iLastAltVar  = scaLastAltVar(currRing);
    1868  
     1868
    18691869  ideal tempF = id_KillSquares(F, m_iFirstAltVar, m_iLastAltVar, currRing);
    1870  
     1870
    18711871  ideal tempQ = Q;
    18721872
     
    21332133  if (tempQ!=NULL) updateResult(strat->Shdl,tempQ,strat);
    21342134  idTest(strat->Shdl);
    2135  
     2135
    21362136  id_Delete( &tempF, currRing);
    2137  
     2137
    21382138  return (strat->Shdl);
    21392139}
     
    22112211// x-es and y-s are weighted by wx and wy resp.
    22122212// [optional] components have weights by wCx and wCy.
    2213 inline void m_GetBiDegree(const poly m, 
    2214   const intvec *wx, const intvec *wy, 
    2215   const intvec *wCx, const intvec *wCy, 
     2213inline void m_GetBiDegree(const poly m,
     2214  const intvec *wx, const intvec *wy,
     2215  const intvec *wCx, const intvec *wCy,
    22162216  int& dx, int& dy, const ring r)
    22172217{
    22182218  const unsigned int N  = r->N;
    2219  
     2219
    22202220  p_Test(m, r);
    2221  
     2221
    22222222  assume( wx != NULL );
    22232223  assume( wy != NULL );
    2224  
     2224
    22252225  assume( wx->cols() == 1 );
    22262226  assume( wy->cols() == 1 );
     
    22312231  int x = 0;
    22322232  int y = 0;
    2233  
     2233
    22342234  for(int i = N; i > 0; i--)
    22352235  {
     
    22382238    y += d * (*wy)[i-1];
    22392239  }
    2240  
     2240
    22412241  if( (wCx != NULL) && (wCy != NULL) )
    22422242  {
     
    22472247
    22482248    if( wCy->range(c) )
    2249       x += (*wCy)[c];     
    2250   }
    2251  
     2249      x += (*wCy)[c];
     2250  }
     2251
    22522252  dx = x;
    22532253  dy = y;
     
    22562256// returns true if polynom p is bi-homogenous with respect to the given weights
    22572257// simultaneously sets bi-Degree
    2258 bool p_IsBiHomogeneous(const poly p, 
    2259   const intvec *wx, const intvec *wy, 
    2260   const intvec *wCx, const intvec *wCy, 
     2258bool p_IsBiHomogeneous(const poly p,
     2259  const intvec *wx, const intvec *wy,
     2260  const intvec *wCx, const intvec *wCy,
    22612261  int &dx, int &dy,
    22622262  const ring r)
    22632263{
    2264   if( p == NULL ) 
     2264  if( p == NULL )
    22652265  {
    22662266    dx = 0;
     
    22802280  for(; q != NULL; pIter(q) )
    22812281  {
    2282     int x, y;   
    2283    
     2282    int x, y;
     2283
    22842284    m_GetBiDegree( q, wx, wy, wCx, wCy, x, y, r); // get bi degree of q
    2285    
     2285
    22862286    if ( (x != ddx) || (y != ddy) ) return false;
    22872287  }
    2288  
     2288
    22892289  dx = ddx;
    22902290  dy = ddy;
     
    22952295
    22962296// returns true if id is bi-homogenous without respect to the given weights
    2297 bool id_IsBiHomogeneous(const ideal id, 
    2298   const intvec *wx, const intvec *wy, 
    2299   const intvec *wCx, const intvec *wCy, 
     2297bool id_IsBiHomogeneous(const ideal id,
     2298  const intvec *wx, const intvec *wy,
     2299  const intvec *wCx, const intvec *wCy,
    23002300  const ring r)
    23012301{
     
    23252325  const int CommutativeVariable = 1;
    23262326  const int AntiCommutativeVariable = 0;
    2327  
     2327
    23282328  intvec* w = new intvec(N, 1, CommutativeVariable);
    2329  
     2329
    23302330  if( rIsSCA(r) )
    23312331  {
    23322332    const unsigned int m_iFirstAltVar = scaFirstAltVar(r);
    2333     const unsigned int m_iLastAltVar  = scaLastAltVar(r); 
     2333    const unsigned int m_iLastAltVar  = scaLastAltVar(r);
    23342334
    23352335    for (unsigned int i = m_iFirstAltVar; i<= m_iLastAltVar; i++)
    23362336    {
    23372337      (*w)[i-1] = AntiCommutativeVariable;
    2338     } 
     2338    }
    23392339  }
    23402340  return w;
     
    23512351  const int CommutativeVariable = 0;
    23522352  const int AntiCommutativeVariable = 1;
    2353  
     2353
    23542354  intvec* w = new intvec(N, 1, CommutativeVariable);
    2355  
     2355
    23562356  if( rIsSCA(r) )
    23572357  {
    23582358    const unsigned int m_iFirstAltVar = scaFirstAltVar(r);
    2359     const unsigned int m_iLastAltVar  = scaLastAltVar(r); 
     2359    const unsigned int m_iLastAltVar  = scaLastAltVar(r);
    23602360
    23612361    for (unsigned int i = m_iFirstAltVar; i<= m_iLastAltVar; i++)
    23622362    {
    23632363      (*w)[i-1] = AntiCommutativeVariable;
    2364     } 
     2364    }
    23652365  }
    23662366  return w;
     
    23722372// reduce term lt(m) modulo <y_i^2> , i = iFirstAltVar .. iLastAltVar:
    23732373// either create a copy of m or return NULL
    2374 inline poly m_KillSquares(const poly m, 
    2375   const unsigned int iFirstAltVar, const unsigned int iLastAltVar, 
     2374inline poly m_KillSquares(const poly m,
     2375  const unsigned int iFirstAltVar, const unsigned int iLastAltVar,
    23762376  const ring r)
    2377 { 
     2377{
    23782378#ifdef PDEBUG
    23792379  p_Test(m, r);
     
    23892389  for(unsigned int k = iFirstAltVar; k <= iLastAltVar; k++)
    23902390    if( p_GetExp(m, k, r) > 1 )
    2391       return NULL; 
    2392  
     2391      return NULL;
     2392
    23932393  return p_Head(m, r);
    23942394}
     
    23962396
    23972397// reduce polynomial p modulo <y_i^2> , i = iFirstAltVar .. iLastAltVar
    2398 poly p_KillSquares(const poly p, 
    2399   const unsigned int iFirstAltVar, const unsigned int iLastAltVar, 
     2398poly p_KillSquares(const poly p,
     2399  const unsigned int iFirstAltVar, const unsigned int iLastAltVar,
    24002400  const ring r)
    2401 { 
     2401{
    24022402#ifdef PDEBUG
    24032403  p_Test(p, r);
     
    24222422#endif
    24232423
    2424     // terms will be in the same order because of quasi-ordering!   
     2424    // terms will be in the same order because of quasi-ordering!
    24252425    poly v = m_KillSquares(q, iFirstAltVar, iLastAltVar, r);
    24262426
     
    24432443  return(pResult);
    24442444}
    2445  
     2445
    24462446
    24472447
    24482448
    24492449// reduces ideal id modulo <y_i^2> , i = iFirstAltVar .. iLastAltVar
    2450 // returns the reduced ideal or zero ideal. 
    2451 ideal id_KillSquares(const ideal id, 
    2452   const unsigned int iFirstAltVar, const unsigned int iLastAltVar, 
     2450// returns the reduced ideal or zero ideal.
     2451ideal id_KillSquares(const ideal id,
     2452  const unsigned int iFirstAltVar, const unsigned int iLastAltVar,
    24532453  const ring r)
    24542454{
     
    24582458
    24592459  if (iSize == 0) return id;
    2460  
     2460
    24612461  ideal temp = idInit(iSize, id->rank);
    2462  
     2462
    24632463#if 0
    24642464   PrintS("<id_KillSquares>\n");
     
    24742474  }
    24752475#endif
    2476  
     2476
    24772477
    24782478  for (int j = 0; j < iSize; j++)
  • kernel/units.cc

    r19408c r18ff4c  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: units.cc,v 1.1.1.1 2003-10-06 12:16:04 Singular Exp $ */
     4/* $Id: units.cc,v 1.2 2007-07-25 10:53:15 Singular Exp $ */
    55/*
    66* ABSTRACT: procedures to compute with units
     
    3333  }
    3434  ideal M0=idInit(IDELEMS(M),M->rank);
    35   ideal M1=kNF(N,currQuotient,M,0,2);
     35  ideal M1=kNF(N,currQuotient,M,0,KSTD_NF_ECART);
    3636  while(idElem(M1)>0&&(d==-1||idMinDegW(M1,w)<=d))
    3737  {
     
    4646    }
    4747    idDelete(&M1);
    48     M1=kNF(N,currQuotient,M,0,2);
     48    M1=kNF(N,currQuotient,M,0,KSTD_NF_ECART);
    4949  }
    5050  idDelete(&M1);
Note: See TracChangeset for help on using the changeset viewer.