Changeset 66415e1 in git


Ignore:
Timestamp:
Apr 3, 1997, 2:16:50 PM (27 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
4b6638742b286da99bbdce81bcde4c2346d3afed
Parents:
32df8279c33f6455329b9db1f5fba50e3397497e
Message:
* hannes: changed SIGINT handling (part1)
          added syz1.cc, changed syz.h, syz.cc syz0.cc (SRES - part1)


git-svn-id: file:///usr/local/Singular/svn/trunk@129 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/cntrlc.cc

    r32df82 r66415e1  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: cntrlc.cc,v 1.5 1997-04-02 15:06:56 Singular Exp $ */
     4/* $Id: cntrlc.cc,v 1.6 1997-04-03 12:16:47 Singular Exp $ */
    55/*
    66* ABSTRACT - interupt handling
     
    288288void sigint_handler(int sig)
    289289{
    290   siCntrlc ++;
    291   if (siCntrlc>2) signal(SIGINT,(s_hdl_typ) sigsegv_handler);
    292   else            signal(SIGINT,(s_hdl_typ) sigint_handler);
     290  mflush();
     291  loop
     292  {
     293    fputs("\nabort(a), continue(c) or quit(q) ?",stderr);fflush(stderr);
     294    switch(fgetc(stdin))
     295    {
     296      case 'q':
     297                m2_end(2);
     298      case 'c':
     299                fgetc(stdin);
     300                signal(SIGINT ,(s_hdl_typ)sigint_handler);
     301                return;         
     302      case 'a':
     303                siCntrlc ++;
     304                if (siCntrlc>2) signal(SIGINT,(s_hdl_typ) sigsegv_handler);
     305                else            signal(SIGINT,(s_hdl_typ) sigint_handler);
     306    }
     307  }
    293308}
    294309#endif
  • Singular/syz.h

    r32df82 r66415e1  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
     6/* $Id: syz.h,v 1.3 1997-04-03 12:16:48 Singular Exp $ */
    67/*
    78* ABSTRACT
    89*/
    9 /* $Id: syz.h,v 1.2 1997-03-24 14:26:02 Singular Exp $ */
    1010#include "structs.h"
     11
     12struct sSObject{
     13                 poly  p;
     14                 poly  p1,p2; /*- the pair p comes from -*/
     15                 poly  lcm;   /*- the lcm of p1,p2 -*/
     16                 poly  syz;   /*- the syzygy associated to p1,p2 -*/
     17                 int   ind1,ind2; /*- the indeces of p1,p2 -*/
     18                 int isNotMinimal;
     19                 int order;
     20               };
     21typedef struct sSObject SObject;
     22typedef SObject * SSet;
     23typedef SSet * SRes;
    1124
    1225void sySchreyersSyzygiesM(polyset F,int Fmax,polyset* Shdl,int* Smax,
     
    1730
    1831resolvente sySchreyerResolvente(ideal arg, int maxlength, int * length,
    19    BOOLEAN isMonomial=FALSE);
     32   BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE);
    2033
    2134resolvente syResolvente(ideal arg, int maxlength, int * length,
     
    3346BOOLEAN syTestOrder(ideal i);
    3447
     48void syReOrderResolventFB(resolvente res,int length, int initial=1);
     49
     50resolvente syLaScala(ideal arg,int * length);
     51resolvente syLaScala1(ideal arg,int * length);
     52
    3553#endif
  • Singular/syz0.cc

    r32df82 r66415e1  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: syz0.cc,v 1.3 1997-04-02 15:07:57 Singular Exp $ */
    5 
     4/* $Id: syz0.cc,v 1.4 1997-04-03 12:16:50 Singular Exp $ */
    65/*
    76* ABSTRACT: resolutions
     
    121120}
    122121
     122inline BOOLEAN syDivisibleBy2(poly a, poly b)
     123{
     124  //if (a->exp[0]==b->exp[0])
     125  {
     126    int i=pVariables-1;
     127    short *e1=&(a->exp[1]);
     128    short *e2=&(b->exp[1]);
     129    if ((*e1) > (*e2)) return FALSE;
     130    do
     131    {
     132      i--;
     133      e1++;
     134      e2++;
     135      if ((*e1) > (*e2)) return FALSE;
     136    } while (i>0);
     137    return TRUE;
     138  }
     139  //else
     140  //{
     141    //Print("Fehler");
     142    //return FALSE;
     143  //}
     144}
     145
     146static poly syRedtail2(poly p, polyset redWith, intvec *modcomp)
     147{
     148  poly h, hn;
     149  int hncomp,nxt;
     150  int j;
     151
     152  h = p;
     153  hn = pNext(h);
     154  while(hn != NULL)
     155  {
     156    hncomp = pGetComp(hn);
     157    j = (*modcomp)[hncomp];
     158    nxt = (*modcomp)[hncomp+1];
     159    while (j < nxt)
     160    {
     161      if (syDivisibleBy2(redWith[j], hn))
     162      {
     163        //if (TEST_OPT_PROT) Print("r");
     164        hn = spSpolyRed(redWith[j],hn,NULL);
     165        if (hn == NULL)
     166        {
     167          pNext(h) = NULL;
     168          return p;
     169        }
     170        hncomp = pGetComp(hn);
     171        j = (*modcomp)[hncomp];
     172        nxt = (*modcomp)[hncomp+1];
     173      }
     174      else
     175      {
     176        j++;
     177      }
     178    }
     179    h = pNext(h) = hn;
     180    hn = pNext(h);
     181  }
     182  return p;
     183}
     184
    123185/*2
    124186* computes the Schreyer syzygies in the local case
     
    246308        ecartToRed = 1;
    247309        bestEcart = 1;
    248         if (TEST_OPT_DEBUG)
     310        if (BTEST1(6))
    249311        {
    250312          PrintS("pair: ");pWrite0(S[j]);PrintS(" ");pWrite(S[k]);
     
    257319        while (pGetComp(toRed)<=rkF)
    258320        {
    259           if (TEST_OPT_DEBUG)
     321          if (BTEST1(6))
    260322          {
    261323            PrintS("toRed: ");pWrite(toRed);
     
    394456  int j,i=0;
    395457  poly p;
    396 
     458 
    397459  if (toNorm==NULL) return NULL;
    398460  p = pHead(toNorm);
     
    408470      //pNorm(toNorm);
    409471      toNorm = spSpolyRed(currQuotient->m[i],toNorm,NULL);
    410       pDelete(&p);
     472      pDelete(&p); 
    411473      if (toNorm==NULL) return NULL;
    412474      p = pHead(toNorm);
     
    520582        //the next term of the syzygy
    521583        //constructs the spoly
    522         if (TEST_OPT_DEBUG)
     584        if (BTEST1(6))
    523585        {
    524586          if (k<Fl)
     
    542604        while (toRed!=NULL)
    543605        {
    544           if (TEST_OPT_DEBUG)
     606          if (BTEST1(6))
    545607          {
    546608            PrintS("toRed: ");pWrite(toRed);
     
    580642            //the next monom of the syzygy
    581643            isNotReduced = TRUE;
    582             if (TEST_OPT_DEBUG)
     644            if (BTEST1(6))
    583645            {
    584646              PrintS("reduced with: ");pWrite(F[l]);
     
    612674          }
    613675          pNorm(syz);
    614           (*Shdl)[Sl] = syz;
     676          if (BTEST1(OPT_REDTAIL))
     677          {
     678            (*newmodcomp)[j+2] = Sl;
     679            (*Shdl)[Sl] = syRedtail2(syz,*Shdl,newmodcomp);
     680            (*newmodcomp)[j+2] = 0;
     681          }
     682          else
     683            (*Shdl)[Sl] = syz;
    615684          Sl++;
    616685        }
     
    634703}
    635704
    636 void syReOrderResolventFB(resolvente res,int length)
     705void syReOrderResolventFB(resolvente res,int length, int initial)
    637706{
    638707  int syzIndex=length-1,i,j;
     
    640709
    641710  while ((syzIndex!=0) && (res[syzIndex]==NULL)) syzIndex--;
    642   while (syzIndex!=0)
     711  while (syzIndex>=initial)
    643712  {
    644713    for(i=0;i<IDELEMS(res[syzIndex]);i++)
     
    680749
    681750resolvente sySchreyerResolvente(ideal arg, int maxlength, int * length,
    682   BOOLEAN isMonomial)
     751  BOOLEAN isMonomial,BOOLEAN notReplace)
    683752{
    684753  ideal mW=NULL;
     
    727796              && (currRing->order[j]!=ringorder_C))
    728797        j++;
    729       if (currRing->order[j]!=0)
     798      if ((!notReplace) && (currRing->order[j]!=0))
    730799      {
    731800        while (currRing->order[j]!=0) j++;
Note: See TracChangeset for help on using the changeset viewer.