Changeset 5ecf042 in git


Ignore:
Timestamp:
Dec 19, 2000, 7:31:48 PM (23 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
7022cd9d4b1177139f7d205efecb93fa232cc319
Parents:
b9d57bdc42ac80a762bda08cdb917d46e9f35616
Message:
* LIB: some categoy changes
* libparse: added -c option
* reimplementation of reing dpenendent options (put to ring->options)


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/makedbm.lib

    rb9d57b r5ecf042  
    1 // $Id: makedbm.lib,v 1.9 2000-12-19 15:05:29 anne Exp $
     1// $Id: makedbm.lib,v 1.10 2000-12-19 18:31:47 obachman Exp $
    22//=========================================================================
    33//
     
    66//=============================================================================
    77
    8 version="$Id: makedbm.lib,v 1.9 2000-12-19 15:05:29 anne Exp $";
    9 category="Utilities";
     8version="$Id: makedbm.lib,v 1.10 2000-12-19 18:31:47 obachman Exp $";
     9category="Miscellaneous";
    1010info="
    1111LIBRARY:  makedbm.lib     some usefull tools needed by the Arnold-Classifier.
  • Singular/LIB/standard.lib

    rb9d57b r5ecf042  
    1 // $Id: standard.lib,v 1.50 2000-12-19 15:05:39 anne Exp $
     1// $Id: standard.lib,v 1.51 2000-12-19 18:31:47 obachman Exp $
    22//////////////////////////////////////////////////////////////////////////////
    33
    4 version="$Id: standard.lib,v 1.50 2000-12-19 15:05:39 anne Exp $";
    5 category="Utilities";
     4version="$Id: standard.lib,v 1.51 2000-12-19 18:31:47 obachman Exp $";
     5category="Miscellaneous";
    66info="
    77LIBRARY: standard.lib   PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP
  • Singular/LIB/template.lib

    rb9d57b r5ecf042  
    11////////////////////////////////////////////////////////////////////
    22// version string automatically expanded by CVS
    3 version="$Id: template.lib,v 1.7 2000-12-19 15:05:44 anne Exp $";
     3version="$Id: template.lib,v 1.8 2000-12-19 18:31:48 obachman Exp $";
    44// summary description of the library
    5 category="Utilities";
     5category="Miscellaneous";
    66info="
    77LIBRARY:   template.lib  A TEMPLATE FOR A SINGULAR LIBRARY
  • Singular/Makefile.in

    rb9d57b r5ecf042  
    214214        poly.lib           presolve.lib       primdec.lib       primitiv.lib\
    215215        qhmoduli.lib       random.lib         ring.lib          sing.lib    \
    216         solve.lib          solver.lib         spcurve.lib       standard.lib\
     216        solve.lib          solve.lib          spcurve.lib       standard.lib\
    217217        surf.lib           triang.lib         template.lib      spectrum.lib\
    218218        mregular.lib       toric.lib          intprog.lib       gaussman.lib
  • Singular/iparith.cc

    rb9d57b r5ecf042  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iparith.cc,v 1.243 2000-12-18 18:26:31 Singular Exp $ */
     4/* $Id: iparith.cc,v 1.244 2000-12-19 18:31:39 obachman Exp $ */
    55
    66/*
     
    31733173    hom=isHomog;
    31743174  }
    3175   //if (hasFlag(v,FLAG_STD))
    3176   //  result=stdred((ideal)v->Data(),currQuotient,hom,&w);
    3177   //else
    3178     result=kStd((ideal)(v->Data()),currQuotient,hom,&w);
     3175  result=kStd((ideal)(v->Data()),currQuotient,hom,&w);
    31793176  idSkipZeroes(result);
    31803177  res->data = (char *)result;
  • Singular/kInline.cc

    rb9d57b r5ecf042  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: kInline.cc,v 1.19 2000-12-14 16:38:49 obachman Exp $
     9 *  Version: $Id: kInline.cc,v 1.20 2000-12-19 18:31:40 obachman Exp $
    1010 *******************************************************************/
    1111#ifndef KINLINE_CC
     
    6363  return T;
    6464}
    65  
     65
     66KINLINE TObject* skStrategy::s_2_t(int i)
     67{
     68  if (i >= 0 && i <= sl)
     69  {
     70    int sri= S_2_R[i];
     71    if (sri >= 0 && sri <= tl)
     72    {
     73      TObject* t = R[sri];
     74      if (t != NULL && t->p == S[i])
     75        return t;
     76    }
     77    // last but not least, try kFindInT
     78    sri = kFindInT(S[i], T, tl);
     79    if (sri >= 0)
     80      return &(T[sri]);
     81  }
     82  return NULL;
     83}
     84
    6685/***************************************************************
    6786 *
     
    9841003}
    9851004
     1005KINLINE poly redtailBba(TObject *T, int pos,kStrategy strat, BOOLEAN withT)
     1006{
     1007  LObject L;
     1008  L = *T;
     1009  poly p = redtailBba(&L, pos, strat, FALSE);
     1010  *T = L;
     1011  kTest_T(T);
     1012  assume( p == T->p);
     1013  return p;
     1014}
    9861015 
    9871016#endif // defined(KINLINE) || defined(KUTIL_CC)
  • Singular/kstd2.cc

    rb9d57b r5ecf042  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.68 2000-12-18 13:30:36 obachman Exp $ */
     4/* $Id: kstd2.cc,v 1.69 2000-12-19 18:31:41 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    786786}
    787787
    788 static ideal bbared (ideal F, ideal Q,kStrategy strat)
    789 {
    790 
    791   /* complete reduction of the standard basis--------- */
    792   completeReduce(strat);
    793   /* release temp data-------------------------------- */
    794   exitBuchMora(strat);
    795   if (TEST_OPT_WEIGHTM)
    796   {
    797     pFDeg=pFDegOld;
    798     pLDeg=pLDegOld;
    799     if (ecartWeights)
    800     {
    801       omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(short));
    802       ecartWeights=NULL;
    803     }
    804   }
    805   if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
    806   return (strat->Shdl);
    807 }
    808 
    809 ideal stdred(ideal F, ideal Q, tHomog h,intvec ** w)
    810 {
    811   ideal r;
    812   BOOLEAN b=pLexOrder,toReset=FALSE;
    813   BOOLEAN delete_w=(w==NULL);
    814   kStrategy strat=new skStrategy;
    815 
    816   if (rField_has_simple_inverse())
    817     strat->LazyPass=20;
    818   else
    819    strat->LazyPass=2;
    820   strat->LazyDegree = 1;
    821   strat->ak = idRankFreeModule(F);
    822   if ((h==testHomog))
    823   {
    824     if (strat->ak==0)
    825     {
    826       h = (tHomog)idHomIdeal(F,Q);
    827       w=NULL;
    828     }
    829     else
    830       h = (tHomog)idHomModule(F,Q,w);
    831   }
    832   if (h==isHomog)
    833   {
    834     if ((w!=NULL) && (*w!=NULL))
    835     {
    836       kModW = *w;
    837       strat->kModW = *w;
    838       pOldFDeg = pFDeg;
    839       pFDeg = kModDeg;
    840       toReset = TRUE;
    841     }
    842     pLexOrder = TRUE;
    843     strat->LazyPass*=2;
    844   }
    845   strat->homog=h;
    846   initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit*/
    847   initBuchMoraPos(strat);
    848   if (pOrdSgn==1)
    849     initBba(F,strat);
    850   else
    851     initMora(F,strat);
    852   initBuchMora(F, Q,strat);
    853   //initS(F,Q,strat);
    854 // Ende der Initalisierung
    855   r=bbared(F,Q,strat);
    856 #ifdef KDEBUG
    857   int i;
    858   for (i=0; i<IDELEMS(r); i++) pTest(r->m[i]);
    859 #endif
    860 // Ende: aufraeumen
    861   if (toReset)
    862   {
    863     kModW = NULL;
    864     pFDeg = pOldFDeg;
    865   }
    866   pLexOrder = b;
    867   delete(strat);
    868   if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
    869   idSkipZeroes(r);
    870   return r;
    871 }
     788
  • Singular/kutil.cc

    rb9d57b r5ecf042  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.86 2000-12-18 17:47:18 obachman Exp $ */
     4/* $Id: kutil.cc,v 1.87 2000-12-19 18:31:41 obachman Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    647647    }
    648648  }
    649   r_assume(L->max == NULL);
    650649  if (L->p1 == NULL)
    651650  {
     
    776775        return dReportError("L[%d].i_r2 out of sync", i);
    777776    }
     777    if (strat->L[i].i_r != -1)
     778      return dReportError("L[%d].i_r out of sync", i);
    778779  }
    779780  return TRUE;
     
    39913992    for (i=strat->sl; i>0; i--)
    39923993    {
    3993       //if (strat->interpt) test_int_std(strat->kIdeal);
    3994       strat->S[i] = redtailBba(strat->S[i],i-1,strat);
     3994      TObject* T_j = strat->s_2_t(i);
     3995      if (T_j != NULL)
     3996      {
     3997        assume(strat->S[i] == T_j->p);
     3998        strat->S[i] = redtailBba(T_j, i-1, strat);
     3999        assume(strat->S[i] == T_j->p);
     4000        if (strat->redTailChange && strat->tailRing != currRing)
     4001        {
     4002          if (T_j->max != NULL) p_LmFree(T_j->max, strat->tailRing);
     4003          if (pNext(T_j->p) != NULL)
     4004            T_j->max = p_GetMaxExpP(pNext(T_j->p), strat->tailRing);
     4005          else
     4006            T_j->max = NULL;
     4007        }
     4008      }
     4009      else
     4010        strat->S[i] = redtailBba(strat->S[i],i-1,strat);
     4011
    39954012      if (TEST_OPT_INTSTRATEGY)
    39964013      {
     
    41304147 
    41314148  if (L != NULL && L->tailRing != new_tailRing)
    4132     L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
    4133   if (T != NULL && T->tailRing != new_tailRing)
     4149  {
     4150    if (L->i_r < 0)   
     4151      L->ShallowCopyDelete(new_tailRing, p_shallow_copy_delete);
     4152    else
     4153    {
     4154      assume(L->i_r <= strat->tl);
     4155      TObject* t_l = strat->R[L->i_r];
     4156      assume(t_l != NULL);
     4157      L->tailRing = new_tailRing;
     4158      L->p = t_l->p;
     4159      L->t_p = t_l->t_p;
     4160      L->max = t_l->max;
     4161    }
     4162  }
     4163     
     4164  if (T != NULL && T->tailRing != new_tailRing && T->i_r < 0)
    41344165    T->ShallowCopyDelete(new_tailRing, new_tailBin, p_shallow_copy_delete);
    41354166   
     
    41724203}
    41734204
    4174 #endif // KUTIL_CC
    41754205
    41764206#if 0
     
    43254355
    43264356#endif
     4357
     4358#endif // KUTIL_CC
  • Singular/kutil.h

    rb9d57b r5ecf042  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: kutil.h,v 1.50 2000-12-18 17:47:17 obachman Exp $ */
     6/* $Id: kutil.h,v 1.51 2000-12-19 18:31:42 obachman Exp $ */
    77/*
    88* ABSTRACT: kernel: utils for kStd
     
    6060    length,     // as of pLDeg
    6161    pLength,    // either == 0, or == pLength(p)
    62     i_r;        // index of TObject in R set
    63   BOOLEAN is_normalized; // true, if pNoram was called on p, false otherwise
     62    i_r;        // index of TObject in R set, or -1 if not in T
     63  BOOLEAN is_normalized; // true, if pNorm was called on p, false otherwise
    6464
    6565  // initialization
     
    284284  KINLINE ~skStrategy();
    285285
    286   // return TObject corresponding to S[i]
     286  // return TObject corresponding to S[i]: assume that it exists
     287  // i.e. no error checking is done
    287288  KINLINE TObject* S_2_T(int i);
     289  // like S_2_T, except that NULL is returned if it can not be found
     290  KINLINE TObject* s_2_t(int i);
    288291};
    289292
     
    331334KINLINE poly redtailBba (poly p,int pos,kStrategy strat);
    332335poly redtailBba (LObject *L, int pos,kStrategy strat, BOOLEAN withT = FALSE);
     336poly redtailBba (TObject *T, int pos,kStrategy strat, BOOLEAN withT = FALSE);
    333337poly redtail (poly p,int pos,kStrategy strat);
    334338poly redtail (LObject *L,int pos,kStrategy strat);
  • Singular/libparse.l

    rb9d57b r5ecf042  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: libparse.l,v 1.43 2000-12-12 11:06:00 anne Exp $ */
     5/* $Id: libparse.l,v 1.44 2000-12-19 18:31:43 obachman Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    105105#ifdef STANDALONE_PARSER
    106106procinfov pi;
     107int category_out = 0;
    107108void printpi(procinfov pi);
    108109void pi_clear(procinfov pi);
     
    293294                 printf("\";\n");
    294295               }
    295                else
     296               else if (!category_out)
    296297                 printf("Version:%s;\n", libnamebuf);
    297298               #else
     
    896897{
    897898#ifdef STANDALONE_PARSER
    898   if (texinfo_out && (last_cmd == LP_INFO || last_cmd == LP_CATEGORY))
     899  if ((texinfo_out && (last_cmd == LP_INFO || last_cmd == LP_CATEGORY)) ||
     900      (category_out && last_cmd == LP_CATEGORY))
    899901  {
    900902    long current_location = ftell(yylpin), i = string_start, quote = 0;
    901903    char c;
    902     if (last_cmd == LP_INFO)
     904    if (texinfo_out)
    903905    {
    904       printf("$info = <<EOT;\n");
    905     }
    906     else
    907     {
    908       printf("$category = <<EOT;\n");
     906     if (last_cmd == LP_INFO)
     907     {
     908       printf("$info = <<EOT;\n");
     909     }
     910     else
     911     {
     912       printf("$category = <<EOT;\n");
     913     }
    909914    }
    910915    fseek (yylpin, i, SEEK_SET);
     
    926931      i++;
    927932    }
     933    if (category_out) exit(0);
    928934    fseek (yylpin, current_location, SEEK_SET);
    929935    printf("\nEOT\n");
     
    9951001    exit(1);
    9961002  }
    997   if (! texinfo_out)
     1003  if (! (texinfo_out || category_out))
    9981004  {
    9991005    if(lpverbose)printf("Verbose level=%d\n", lpverbose);
  • Singular/maps.cc

    rb9d57b r5ecf042  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: maps.cc,v 1.32 2000-12-15 18:49:33 Singular Exp $ */
     4/* $Id: maps.cc,v 1.33 2000-12-19 18:31:43 obachman Exp $ */
    55/*
    66* ABSTRACT - the mapping of polynomials to other rings
     
    215215
    216216  memcpy(names, currRing->names, currRing->N*sizeof(char*));
     217  memcpy(&(names[currRing->N]), theImageRing->names, (theImageRing->N*sizeof(char*)));
    217218  sip_sring tmpR;
    218219
  • Singular/misc.cc

    rb9d57b r5ecf042  
    474474    Werror("unknown option `%s`",n);
    475475  okay:
     476    if (currRing != NULL)
     477      currRing->options = test & TEST_RINGDEP_OPTS;
    476478    omFree((ADDRESS)n);
    477479    v=v->next;
  • Singular/numbers.cc

    rb9d57b r5ecf042  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: numbers.cc,v 1.33 2000-12-15 18:49:34 Singular Exp $ */
     4/* $Id: numbers.cc,v 1.34 2000-12-19 18:31:44 obachman Exp $ */
    55
    66/*
     
    111111  {
    112112    naSetChar(c,r);
    113     test |= Sy_bit(OPT_INTSTRATEGY); /*intStrategy*/
    114     test &= ~Sy_bit(OPT_REDTAIL); /*noredTail*/
    115   }
    116   else if (rField_is_Q(r))
    117   {
    118     test |= Sy_bit(OPT_INTSTRATEGY); /*26*/
    119113  }
    120114  else if (rField_is_Zp(r))
     
    122116  {
    123117    npSetChar(c, r);
    124     test &= ~Sy_bit(OPT_INTSTRATEGY); /*26*/
    125118  }
    126119  /* -------------- GF(p^m) -----------------------*/
    127120  else if (rField_is_GF(r))
    128121  {
    129     test &= ~Sy_bit(OPT_INTSTRATEGY); /*26*/
    130122    nfSetChar(c,r->parameter);
    131123  }
  • Singular/polys.cc

    rb9d57b r5ecf042  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys.cc,v 1.72 2000-12-18 13:30:38 obachman Exp $ */
     4/* $Id: polys.cc,v 1.73 2000-12-19 18:31:44 obachman Exp $ */
    55
    66/*
     
    5858  if (complete)
    5959  {
    60     if ((r->LexOrder) || (r->OrdSgn==-1))
    61       test &= ~Sy_bit(OPT_REDTAIL); /* noredTail */
    62 
    63     if (!TEST_OPT_OLDSTD && r->OrdSgn == 1 && ! r->LexOrder)
    64       test |= Sy_bit(OPT_REDTHROUGH);
    65     else
    66       test &= ~Sy_bit(OPT_REDTHROUGH);
     60    test &= ~ TEST_RINGDEP_OPTS;
     61    test |= r->options;
    6762  }
    6863}
  • Singular/ring.cc

    rb9d57b r5ecf042  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.150 2000-12-14 16:38:54 obachman Exp $ */
     4/* $Id: ring.cc,v 1.151 2000-12-19 18:31:45 obachman Exp $ */
    55
    66/*
     
    9595    /*------------ set global ring vars --------------------------------*/
    9696    currQuotient=r->qideal;
    97     /*------------ set redTail, except reset by nSetChar or pSetGlobals */
    98     test |= Sy_bit(OPT_REDTAIL);
    9997
    10098    /*------------ global variables related to coefficients ------------*/
     
    28432841}
    28442842
     2843static void rSetOption(ring r)
     2844{
     2845  // set redthrough
     2846  if (!TEST_OPT_OLDSTD && r->OrdSgn == 1 && ! r->LexOrder)
     2847    r->options |= Sy_bit(OPT_REDTHROUGH);
     2848  else
     2849    r->options &= ~Sy_bit(OPT_REDTHROUGH);
     2850
     2851  // set intStrategy
     2852  if (rField_is_Extension(r) || rField_is_Q(r))
     2853    r->options |= Sy_bit(OPT_INTSTRATEGY);
     2854  else
     2855    r->options &= ~Sy_bit(OPT_INTSTRATEGY);
     2856 
     2857  // set redTail
     2858  if (r->LexOrder || r->OrdSgn == -1 || rField_is_Extension(r))
     2859    r->options &= ~Sy_bit(OPT_REDTAIL);
     2860  else
     2861    r->options |= Sy_bit(OPT_REDTAIL);
     2862}
     2863
    28452864BOOLEAN rComplete(ring r, int force)
    28462865{
     
    28492868  rSetOutParams(r);
    28502869  rSetDegStuff(r);
     2870  rSetOption(r);
    28512871  int n=rBlocks(r)-1;
    28522872  int i;
  • Singular/structs.h

    rb9d57b r5ecf042  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: structs.h,v 1.49 2000-12-15 18:49:36 Singular Exp $ */
     6/* $Id: structs.h,v 1.50 2000-12-19 18:31:46 obachman Exp $ */
    77/*
    88* ABSTRACT
     
    352352  char **    names;  /* array of variable names */
    353353
     354  unsigned long options; /* ring dependent options */
     355
    354356  // what follows below here should be set by rComplete, _only_
    355357  long      *ordsgn;  /* array of +/- 1 (or 0) for comparing monomials */
  • Singular/tok.h

    rb9d57b r5ecf042  
    77* ABSTRACT: tokens, types for interpreter; general macros
    88*/
    9 /* $Id: tok.h,v 1.48 2000-12-18 13:30:39 obachman Exp $ */
     9/* $Id: tok.h,v 1.49 2000-12-19 18:31:46 obachman Exp $ */
    1010
    1111#ifndef MYYSTYPE
     
    203203#define OPT_WEIGHTM       31
    204204
     205/* define ring dependent options */
     206#define TEST_RINGDEP_OPTS \
     207 (Sy_bit(OPT_INTSTRATEGY) | Sy_bit(OPT_REDTHROUGH) | Sy_bit(OPT_REDTAIL))
     208
    205209#define TEST_OPT_PROT              BTEST1(OPT_PROT)
    206210#define TEST_OPT_REDSB             BTEST1(OPT_REDSB)
  • Singular/utils.cc

    rb9d57b r5ecf042  
    1515extern int lpverbose, check;
    1616extern int texinfo_out;
     17extern int category_out;
    1718extern int found_version, found_info, found_oldhelp, found_proc_in_proc;
    1819int warning_info = 0, warning_version = 0;
     
    2728  printf("   -s                    : turns on reporting about violations of unenforced syntax rules\n");
    2829  printf("   -i                    : perl output of examples and help of procs\n");
     30  printf("   -c                    : print category of lib to stdout and exit\n");
    2931  printf("   -h                    : print this message\n");
    3032  exit(1);
     
    3941  char c;
    4042
    41   while((c=fe_getopt(argc, argv, "ihd:sf:"))>=0) {
     43  while((c=fe_getopt(argc, argv, "ihdc:sf:"))>=0) {
    4244    switch(c) {
    4345        case 'd':
     
    5456          texinfo_out = 1;
    5557          break;
     58        case 'c':
     59          category_out = 1;
     60          break;
     61
    5662        case 'h' :
    5763          usage(argv[0]);
    5864          break;
    59          
    6065        case -1 : printf("no such option:%s\n", argv[fe_optind]);
    6166          usage(argv[0]);
     
    6570    }
    6671  }
    67   if (texinfo_out) lpverbose = 0;
     72  if (texinfo_out || category_out) lpverbose = 0;
    6873   
    6974  if(lib_file!=NULL) {
    7075    yylpin = fopen( lib_file, "rb" );
    71     if (! texinfo_out)
     76    if (! (texinfo_out || category_out))
    7277      printf("Checking library '%s'\n", lib_file);
    73     else
     78    else if (! category_out)
    7479      printf("$library = \"%s\";\n", lib_file);
    7580  } else {
     
    7984      {
    8085        lib_file = argv[fe_optind];
    81         if (! texinfo_out)
     86        if (! (texinfo_out || category_out) )
    8287          printf("Checking library '%s'\n", argv[fe_optind]);
    83         else
     88        else if (! category_out)
    8489          printf("$library = \"%s\";\n", lib_file);
    8590      }
     
    207212    }
    208213  }
    209   else
     214  else if (! category_out)
    210215  {
    211216    if(lpverbose) printf("//     ");
Note: See TracChangeset for help on using the changeset viewer.