Changeset f4b74e2 in git


Ignore:
Timestamp:
Feb 1, 2007, 6:24:03 PM (17 years ago)
Author:
Motsak Oleksandr <motsak@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
ec69aa9f2368fd5481b412fc4b4a37844f40d997
Parents:
c903a38865fcce626ced071280b6bf975d3d60f8
Message:
*motsak: found the twostd's bug in kStd with SB_1


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

Legend:

Unmodified
Added
Removed
  • kernel/gring.cc

    rc903a3 rf4b74e2  
    77 *  Author:  levandov (Viktor Levandovsky)
    88 *  Created: 8/00 - 11/00
    9  *  Version: $Id: gring.cc,v 1.39 2007-01-31 23:51:23 motsak Exp $
     9 *  Version: $Id: gring.cc,v 1.40 2007-02-01 17:24:03 motsak Exp $
    1010 *******************************************************************/
    1111#include "mod2.h"
     
    19471947  int j;
    19481948  int s;
    1949   int flag;
     1949  bool flag;
    19501950  poly p=NULL;
    19511951  poly q=NULL;
     
    19581958  int rN=currRing->N;
    19591959  int iSize=0;
     1960
    19601961  loop
    19611962  {
    1962     flag=0;
    1963     K=NULL;
    1964     s=idElem(J);
     1963    flag = true; // nothing new!
     1964    K    = NULL;
     1965    s    = idElem(J);
     1966   
    19651967    for (i=0;i<=s-1;i++)
    19661968    {
    19671969      p=J->m[i];
    1968       for (j=1;j<=rN;j++)
     1970
     1971        #ifdef PDEBUG
     1972          p_Test(p, currRing);
     1973        #if 0
     1974          Print("p: "); // !
     1975          p_Write(p, currRing);
     1976        #endif
     1977        #endif
     1978
     1979      for (j=1;j<=rN;j++) // for all j = 1..N
    19691980      {
    19701981        varj = pOne();
    19711982        pSetExp(varj,j,1);
    19721983        pSetm(varj);
    1973         q = pp_Mult_mm(p,varj,currRing);
     1984        q = pp_Mult_mm(p,varj,currRing); // q = J[i] * var(j),
    19741985        pDelete(&varj);
     1986
     1987        #ifdef PDEBUG
     1988          p_Test(p, currRing);
     1989          p_Test(q, currRing);
     1990        #if 0
     1991          Print("Reducing p: "); // !
     1992          p_Write(p, currRing);
     1993
     1994          Print("With q: "); // !
     1995          p_Write(q, currRing);
     1996        #endif
     1997        #endif
     1998       
    19751999        q = nc_ReduceSPoly(p,q,currRing);
     2000
     2001        #ifdef PDEBUG
     2002          p_Test(q, currRing);
     2003        #if 0
     2004          Print("Reducing q: "); // !
     2005          p_Write(q, currRing);
     2006
     2007          Print("With J!\n");
     2008        #endif
     2009        #endif
     2010
    19762011        q = kNF(J,currQuotient,q,0,0);
     2012
     2013        #ifdef PDEBUG
     2014          p_Test(q, currRing);
     2015        #if 0
     2016          Print("=> q: "); // !
     2017          p_Write(q, currRing);
     2018        #endif
     2019        #endif
     2020
    19772021        if (q!=NULL)
    19782022        {
    1979           if (pIsConstant(q))
     2023          if (pIsConstant(q)) // => return (1)!
    19802024          {
    19812025            Q=idInit(1,1);
     
    19862030            return(Q);
    19872031          }
    1988           flag=1;
     2032         
     2033          flag=false;
    19892034          Q=idInit(1,1);
    19902035          Q->m[0]=q;
     
    19962041      }
    19972042    }
    1998     if (flag==0)
     2043    if (flag) // nothing new!
    19992044      /* i.e. all elements are two-sided */
    20002045    {
    2001       idDelete(&K);
     2046//      idDelete(&K);
    20022047      return(J);
    20032048    }
    20042049    /* now we update GrBasis J with K */
    20052050    //    iSize=IDELEMS(J);
     2051  #ifdef PDEBUG
     2052    idTest(J);
     2053  #if 0
     2054    Print("J:");
     2055    idPrint(J);
     2056    PrintLn();
     2057  #endif // debug
     2058  #endif 
     2059
     2060
     2061
     2062  #ifdef PDEBUG
     2063    idTest(K);
     2064  #if 0
     2065    Print("+K:");
     2066    idPrint(K);
     2067    PrintLn();
     2068  #endif // debug
     2069  #endif 
     2070
     2071
    20062072    iSize=idElem(J);
    20072073    id_tmp=idSimpleAdd(J,K);
    20082074    idDelete(&K);
    20092075    idDelete(&J);
     2076   
    20102077    BITSET save_test=test;
    2011     test|=Sy_bit(OPT_SB_1);
    2012     J=kStd(id_tmp, currQuotient, testHomog,NULL,NULL,0,iSize);
    2013     test=save_test;
     2078
     2079    #if 1
     2080      test|=Sy_bit(OPT_SB_1);
     2081      J = kStd(id_tmp, currQuotient, testHomog, NULL, NULL, 0, iSize); // J = J + K, J - std   
     2082    #else
     2083      J=kStd(id_tmp, currQuotient,testHomog,NULL,NULL,0,0,NULL);
     2084    #endif
     2085    test = save_test;
     2086   
     2087    idDelete(&id_tmp); // !!!
     2088
    20142089    idSkipZeroes(J);
     2090       
     2091  #ifdef PDEBUG
     2092    idTest(J);
     2093  #if 0
     2094    Print("J:");
     2095    idPrint(J);
     2096    PrintLn();
     2097  #endif // debug
     2098  #endif 
     2099
     2100// bug:
     2101
     2102//J:Module of rank 1,real rank 0 and 4 generators.
     2103//generator 0: f
     2104//generator 1: h2+h
     2105//generator 2: eh+e
     2106//generator 3: e2
     2107
     2108//+K:Module of rank 1,real rank 0 and 2 generators.
     2109//generator 0: h
     2110//generator 1: e
     2111
     2112// =>>>>
     2113
     2114//J:Module of rank 1,real rank 0 and 6 generators.
     2115//generator 0: h
     2116//generator 1: f
     2117//generator 2: e
     2118//generator 3: h2+h
     2119//generator 4: eh+e
     2120//generator 5: e2
     2121
     2122
     2123
     2124   
    20152125  }
    20162126}
Note: See TracChangeset for help on using the changeset viewer.