Changeset f6c459 in git


Ignore:
Timestamp:
May 5, 2014, 5:52:53 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
fe35f2639131fac3e627cc45a86e0395522c0853
Parents:
d353e4f49eb4e1747ded689e6bdea5765a057c75
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-05 17:52:53+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-07 04:41:44+02:00
Message:
Cleanup and minor changes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/schreyer.lib

    rd353e4f rf6c459  
    486486/* static */
    487487proc MySort(def M)
     488"
     489   Sorts the given ideal or module wrt >_{(c, ds)}  (.<.<.<.<)
     490   NOTE: inplace??
     491"
    488492{
    489493  if( typeof( attrib(basering, "DEBUG") ) == "int" )
     
    500504  } else
    501505  {
    502     int @KERCHECK = @DEBUG; // TODO: @SYZCHECK:(
     506    int @KERCHECK = @DEBUG;
    503507  }
    504508
     
    550554
    551555
    552 /* static */ proc SSinit(def M)
     556static proc SSinit(def M)
    553557{
    554558  if( (typeof(M) != "module") && (typeof(M) != "ideal") )
     
    574578  }
    575579
    576   int @KERCHECK = @SYZCHECK;
     580  int @KERCHECK = @DEBUG;
    577581
    578582  if( typeof( attrib(SSinit, "KERCHECK") ) == "int" )
     
    608612  def LEAD = lead(@N);
    609613
    610   if( @SYZCHECK )
     614  if( @KERCHECK )
    611615  {
    612616    def @LEAD = lead(M);
     
    618622    @LEAD = @LEAD[iv_ds];
    619623
    620     // 0^th syz. property
    621624    if( size(module( matrix(@N) - matrix(M) )) > 0 )
    622625    {
     
    631634    }
    632635
    633     // 0^th syz. property
    634636    if( size(module( matrix(@LEAD) - matrix(LEAD) )) > 0 )
    635637    {
     
    647649
    648650  M = @N;
    649  
    650  
    651  
    652651 
    653652  def TAIL = Tail(M);
     
    829828  } else
    830829  {
    831     int @KERCHECK = @SYZCHECK;
     830    int @KERCHECK = @DEBUG;
    832831  }
    833832
     
    892891        "ERROR: SSComputeLeadingSyzygyTerms: S != SS ";
    893892
    894         "basering: ";
    895         DetailedPrint(basering);
     893        "basering: "; basering;
     894//        DetailedPrint(basering);
    896895
    897896        "S: ";  S;
    898         DetailedPrint(S, 1);
     897//        DetailedPrint(_, 1);
    899898        "SS: "; SS;
    900         DetailedPrint(SS, 1);
     899//        DetailedPrint(_, 1);
    901900
    902901        "DIFF: ";
     902        module(matrix(S) - matrix(SS));
     903//        DetailedPrint(_, 2);     
    903904        print(matrix(S) - matrix(SS));
    904         DetailedPrint(module(matrix(S) - matrix(SS)), 2);     
    905905        $
    906906    }
     
    948948  } else
    949949  {
    950     int @KERCHECK = @SYZCHECK;
    951   }
    952 
    953   int @TAILREDSYZ = 1;
    954   if( typeof( attrib(basering, "TAILREDSYZ") ) == "int" )
    955   {
    956     @TAILREDSYZ = attrib(basering, "TAILREDSYZ");
    957   }
    958  
    959  
     950    int @KERCHECK = @DEBUG;
     951  }
     952
    960953  if( @DEBUG )
    961954  {
     
    986979  if( @KERCHECK )
    987980  {
     981    int @TAILREDSYZ = 1;
     982    if( typeof( attrib(basering, "TAILREDSYZ") ) == "int" )
     983    {
     984      @TAILREDSYZ = attrib(basering, "TAILREDSYZ");
     985    }
    988986
    989987    int i, j, r;
     
    10851083
    10861084/// TODO: save shortcut (syz: |-.->) LM(LM(m) * "t") -> syz?
    1087 proc SSFindReducer(def product, def syzterm, def L/*, def T*/, list #)
     1085proc SSFindReducer(def product, def syzterm, def L, list #)
    10881086{
    10891087  if( typeof( attrib(basering, "DEBUG") ) == "int" )
     
    10931091  {
    10941092    int @DEBUG = !system("with", "ndebug");
     1093  }
     1094
     1095  if( typeof( attrib(basering, "SYZCHECK") ) == "int" )
     1096  {
     1097    int @SYZCHECK = attrib(basering, "SYZCHECK");
     1098  } else
     1099  {
     1100    int @SYZCHECK = @DEBUG;
     1101  }
     1102
     1103  if( typeof( attrib(basering, "KERCHECK") ) == "int" )
     1104  {
     1105    int @KERCHECK = attrib(basering, "KERCHECK");
     1106  } else
     1107  {
     1108    int @KERCHECK = @DEBUG;
    10951109  }
    10961110
     
    11111125
    11121126
    1113   if( typeof( attrib(basering, "SYZCHECK") ) == "int" )
    1114   {
    1115     int @SYZCHECK = attrib(basering, "SYZCHECK");
    1116   } else
    1117   {
    1118     int @SYZCHECK = @DEBUG;
    1119   }
    1120  
    1121   if( @SYZCHECK && (syzterm != 0) )
     1127  if( @DEBUG && (syzterm != 0) )
    11221128  {
    11231129    def @@c = leadcomp(syzterm); int @@r = int(@@c);
     
    11411147 
    11421148
    1143   if( @SYZCHECK )
     1149  if( @KERCHECK )
    11441150  {
    11451151    bigint c = leadcomp(product); int r = int(c);
     
    12071213}
    12081214
    1209 
    1210 
    1211 
    1212 
    12131215/// TODO: save shortcut (syz: |-.->) LM(m) * "t" -> ?
    12141216proc SSReduceTerm(poly m, def t, def syzterm, def L, def T, list #)
     
    12391241  }
    12401242
    1241 
     1243  if( typeof( attrib(basering, "KERCHECK") ) == "int" )
     1244  {
     1245    int @KERCHECK = attrib(basering, "KERCHECK");
     1246  } else
     1247  {
     1248    int @KERCHECK = @DEBUG;
     1249  }
     1250 
    12421251  if( typeof( attrib(basering, "SYZCHECK") ) == "int" )
    12431252  {
     
    12991308    int @DEBUG = !system("with", "ndebug");
    13001309  }
     1310
     1311  if( typeof( attrib(basering, "KERCHECK") ) == "int" )
     1312  {
     1313    int @KERCHECK = attrib(basering, "KERCHECK");
     1314  } else
     1315  {
     1316    int @KERCHECK = @DEBUG;
     1317  }
     1318 
    13011319
    13021320  if( @DEBUG )
     
    14511469        } else
    14521470        {
    1453           a2 = SSFindReducer( aa * L[r], a, L/*, T*/, LS);
     1471          a2 = SSFindReducer( aa * L[r], a, L, LS);
    14541472        }
    14551473
     
    19491967proc TestSSres(def M)
    19501968{
    1951   "-------------------------------------";
    1952   "options: ", attrib(SSinit, "LEAD2SYZ"), attrib(SSinit, "TAILREDSYZ"), attrib(SSinit, "HYBRIDNF"), ": ";
     1969  "/ ----------------------------------- : ", "options: ", attrib(SSinit, "LEAD2SYZ"), attrib(SSinit, "TAILREDSYZ"), attrib(SSinit, "HYBRIDNF"), "...";
    19531970  int t = timer;
    19541971  def S = SSres(M, 0);
     
    19711988proc TestSSresAttribs(def M)
    19721989{
     1990//  M = groebner(M);  "groebner: "; M;  "";
     1991
    19731992
    19741993  // the following 2 setups are bad for AGR@101n3d002s004%1:(((
    1975 //  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
    1976 //  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
     1994
     1995  //////////  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
     1996  //////////  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 0); attrib(SSinit, "HYBRIDNF", 1); TestSSres(M);
    19771997
    19781998  attrib(SSinit, "LEAD2SYZ", 0); attrib(SSinit, "TAILREDSYZ", 1); attrib(SSinit, "HYBRIDNF", 0); TestSSres(M);
     
    19922012  attrib(SSinit, "DEBUG", 0);
    19932013  attrib(SSinit, "SYZCHECK", 1);
    1994   attrib(SSinit, "KERCHECK", 0);
     2014  attrib(SSinit, "KERCHECK", 1);
    19952015
    19962016  ring r; r; ideal M = maxideal(1); M;
     
    20112031  TestSSresAttribs(M); 
    20122032  kill r; 
    2013 
    20142033 
    20152034  ring AGR = (101), (a, b, c, d), dp; AGR;
     
    20192038  TestSSresAttribs(M);
    20202039
    2021 
    20222040  // medium: AGR@101n3d004s009%1;
    2023   ideal M = a*b+7*a*c-16*b*c-27*a*d+37*b*d-2*c*d, d^3, c*d^2, b*d^2, a*d^2, c^2*d, b*c*d, a*c*d, b^2*d, a^2*d, c^3, b*c^2, a*c^2, b^2*c, a^2*c, b^3, a^3;
     2041  M = a*b+7*a*c-16*b*c-27*a*d+37*b*d-2*c*d, d^3, c*d^2, b*d^2, a*d^2, c^2*d, b*c*d, a*c*d, b^2*d, a^2*d, c^3, b*c^2, a*c^2, b^2*c, a^2*c, b^3, a^3;
    20242042  M;
    20252043  TestSSresAttribs(M);
  • dyn_modules/syzextra/mod_main.cc

    rd353e4f rf6c459  
    11011101static BOOLEAN FindReducer(leftv res, leftv h)
    11021102{
     1103  const char* usage = "`FindReducer(<poly/vector>, <vector/0>, <ideal/module>[,<module>])` expected";
    11031104  const ring r = currRing;
    11041105
     
    11131114
    11141115  const BOOLEAN __TAILREDSYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"TAILREDSYZ",INT_CMD, (void*)0)));
    1115   const BOOLEAN __LEAD2SYZ__ = (BOOLEAN)((long)(atGet(currRingHdl,"LEAD2SYZ",INT_CMD, (void*)0)));
    1116   const BOOLEAN __SYZCHECK__ = (BOOLEAN)((long)(atGet(currRingHdl,"SYZCHECK",INT_CMD, (void*)0)));   
    11171116
    11181117  if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL))
    11191118  {
    1120     WerrorS("`FindReducer(<poly/vector>, <vector>, <ideal/module>[,<module>])` expected");
     1119    WerrorS(usage);
    11211120    return TRUE;   
    11221121  }
    11231122   
    1124   const poly product = (poly) h->Data(); h = h->Next();
    1125 
    1126   assume (product != NULL);
    1127 
    1128    
    1129   if ((h==NULL) || (h->Typ()!=VECTOR_CMD))
    1130   {
    1131     WerrorS("`FindReducer(<poly/vector>, <vector>, <ideal/module>[,<module>])` expected");
     1123  const poly product = (poly) h->Data(); assume (product != NULL);
     1124
     1125
     1126  h = h->Next();
     1127  if ((h==NULL) || !((h->Typ()==VECTOR_CMD) || (h->Data() == NULL)) )
     1128  {
     1129    WerrorS(usage);
    11321130    return TRUE;   
    11331131  }
     
    11431141  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
    11441142  {
    1145     WerrorS("`FindReducer(<poly/vector>, <vector>, <ideal/module>[,<module>])` expected");
     1143    WerrorS(usage);
    11461144    return TRUE;   
    11471145  }
     
    11561154  if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL))
    11571155  {
    1158     WerrorS("`FindReducer(<poly/vector>, <vector>, <ideal/module>[,<module>])` expected");
     1156    WerrorS(usage);
    11591157    return TRUE;   
    11601158  }
     
    17431741    iLazyReduce = (int)((long)(h->Data()));
    17441742
    1745   res->data = (void *)kNFLength(M, currQuotient, v, iSyzComp, iLazyReduce);
     1743  res->data = (void *)kNFLength(M, currQuotient, v, iSyzComp, iLazyReduce); // NOTE: currRing :(
    17461744  return FALSE;
    17471745}
     
    18611859 
    18621860  NoReturn(res);
    1863   return false;
     1861  return FALSE;
    18641862}
    18651863
Note: See TracChangeset for help on using the changeset viewer.