Changeset a3bc95e in git


Ignore:
Timestamp:
Oct 9, 2001, 6:36:27 PM (21 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
7497ef3773fc1afff892546445b1d82b1cf0fb05
Parents:
e58c4abd91b68d128331a23f3f9dd76dff924048
Message:
*hannes: namespaces ->ns


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

Legend:

Unmodified
Added
Removed
  • Singular/clapconv.cc

    re58c4a ra3bc95e  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 // $Id: clapconv.cc,v 1.32 2000-12-08 17:26:22 Singular Exp $
     5// $Id: clapconv.cc,v 1.33 2001-10-09 16:35:56 Singular Exp $
    66/*
    77* ABSTRACT: convert data between Singular and factory
     
    210210      {
    211211        number z=(number)omAllocBin(rnumber_bin);
    212 #if defined(LDEBUG) 
     212#if defined(LDEBUG)
    213213        z->debug=123456;
    214214#endif
     
    283283      {
    284284        number z=(number)omAllocBin(rnumber_bin);
    285 #if defined(LDEBUG) 
     285#if defined(LDEBUG)
    286286        z->debug=123456;
    287287#endif
     
    581581  {
    582582    number z=(number)omAllocBin(rnumber_bin);
    583 #if defined(LDEBUG) 
     583#if defined(LDEBUG)
    584584    z->debug=123456;
    585585#endif
  • Singular/cntrlc.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: cntrlc.cc,v 1.38 2001-08-27 14:46:50 Singular Exp $ */
     4/* $Id: cntrlc.cc,v 1.39 2001-10-09 16:35:56 Singular Exp $ */
    55/*
    66* ABSTRACT - interupt handling
     
    366366      c = 'a';
    367367    }
    368    
     368
    369369    switch(c)
    370370    {
     
    640640/* Under HPUX 9, system(...) returns -1 if SIGCHLD does not equal
    641641   SIG_DFL. However, if it stays at SIG_DFL we get zombie processes
    642    for terminated childs generated by fork. Therefors some special treatment 
     642   for terminated childs generated by fork. Therefors some special treatment
    643643   is necessary */
    644644#ifdef HPUX_9
  • Singular/dError.h

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 9/00
    9  *  Version: $Id: dError.h,v 1.5 2000-12-31 15:14:29 obachman Exp $
     9 *  Version: $Id: dError.h,v 1.6 2001-10-09 16:35:56 Singular Exp $
    1010 *******************************************************************/
    1111#ifndef DERROR_H
     
    1313
    1414#ifdef __cplusplus
    15 extern "C" 
     15extern "C"
    1616{
    1717#endif
  • Singular/distrib.h

    re58c4a ra3bc95e  
    1 #undef MAKE_DISTRIBUTION 
     1#undef MAKE_DISTRIBUTION
  • Singular/emacs.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: emacs.cc,v 1.20 2001-08-27 14:46:56 Singular Exp $ */
     4/* $Id: emacs.cc,v 1.21 2001-10-09 16:35:57 Singular Exp $ */
    55/*
    66* ABSTRACT: Esingular main file
     
    7575void fePrintReportBug(char* msg, char* file, int line)
    7676{
    77   error("YOU HAVE FOUND A BUG IN SINGULAR. 
     77  error("YOU HAVE FOUND A BUG IN SINGULAR.
    7878Please, email the following output to singular@mathematik.uni-kl.de
    79 Bug occured at %s:%d 
    80 Message: %s 
     79Bug occured at %s:%d
     80Message: %s
    8181Version: " S_UNAME S_VERSION1 " (%lu) " __DATE__ __TIME__,
    8282        file, line, msg, feVersionId);
     
    100100  int no_emacs_call = 0;
    101101  char cwd[MAXPATHLEN];
    102  
     102
    103103  // parse-cmdline options
    104  
     104
    105105  feInitResources(argv[0]);
    106106  feResource('S');
    107107  feResource('b');
    108108  feResource('r');
    109  
     109
    110110  int optc, option_index;
    111  
    112   while ((optc = fe_getopt_long(argc, argv, SHORT_OPTS_STRING, 
     111
     112  while ((optc = fe_getopt_long(argc, argv, SHORT_OPTS_STRING,
    113113                                feOptSpec, &option_index))
    114114        != EOF)
     
    119119          feOptHelp(feArgv0);
    120120          exit(0);
    121          
     121
    122122        case '?':
    123123        case ':':
     
    134134                emacs = fe_optarg;
    135135              break;
    136 #else             
     136#else
    137137              case FE_OPT_EMACS:
    138138                emacs = fe_optarg;
    139139                break;
    140                
     140
    141141              case FE_OPT_EMACS_DIR:
    142142                emacs_dir = fe_optarg;
    143143                break;
    144                
     144
    145145              case FE_OPT_EMACS_LOAD:
    146146                emacs_load = fe_optarg;
    147147                break;
    148 #endif               
     148#endif
    149149              case FE_OPT_SINGULAR:
    150150                singular = fe_optarg;
     
    154154                no_emacs_call = 1;
    155155                break;
    156                
     156
    157157              default:
    158158                goto NEXT;
    159159          }
    160160          // delete options from option-list
    161           if (fe_optind > 2 && *argv[fe_optind-1] != '-' && 
     161          if (fe_optind > 2 && *argv[fe_optind-1] != '-' &&
    162162              fe_optarg != NULL && feOptSpec[option_index].has_arg)
    163163          {
     
    181181  if (emacs == NULL)
    182182  {
    183     error( "Error: Can't find emacs xterm program. \n Expected it at %s or %s\n Specify alternative with --xterm=PROGRAM option,\n or set ESINGULAR_EMACS environment variable to the name of the program to use as xterm.\n", 
     183    error( "Error: Can't find emacs xterm program. \n Expected it at %s or %s\n Specify alternative with --xterm=PROGRAM option,\n or set ESINGULAR_EMACS environment variable to the name of the program to use as xterm.\n",
    184184           feResourceDefault('X'));
    185185    mainUsage();
    186186    exit(1);
    187187  }
    188  
     188
    189189  if (singular == NULL) singular = feResource("SingularXterm", 0);
    190190  if (singular == NULL)
    191191  {
    192     error( "Error: Can't find singular executable.\n Expected it at %s\n Specify with --singular option,\n or set TSINGULAR_SINGULAR environment variable.\n", 
     192    error( "Error: Can't find singular executable.\n Expected it at %s\n Specify with --singular option,\n or set TSINGULAR_SINGULAR environment variable.\n",
    193193            feResourceDefault("SingularXterm"));
    194194    mainUsage();
     
    196196  }
    197197
    198 #ifdef WINNT 
     198#ifdef WINNT
    199199#define EXTRA_XTERM_ARGS "+vb -sl 2000 -fb Courier-bold-13 -tn linux -cr Red3"
    200200#else
     
    202202#endif
    203203
    204   syscall = (char*) omAlloc(strlen(emacs) + 
    205                                  strlen(singular) + 
     204  syscall = (char*) omAlloc(strlen(emacs) +
     205                                 strlen(singular) +
    206206                                 length + 300);
    207207  sprintf(syscall, "%s %s -e %s ", emacs, EXTRA_XTERM_ARGS, singular);
     
    215215    }
    216216  }
    217 #else 
     217#else
    218218  // make sure  emacs, singular, emacs_dir, emacs_load are set
    219219  if (emacs == NULL) emacs = feResource("xemacs", 0);
     
    221221  if (emacs == NULL)
    222222  {
    223     error( "Error: Can't find emacs or xemacs executable. \n Expected it at %s or %s\n Specify alternative with --emacs option,\n or set ESINGULAR_EMACS environment variable.\n", 
     223    error( "Error: Can't find emacs or xemacs executable. \n Expected it at %s or %s\n Specify alternative with --emacs option,\n or set ESINGULAR_EMACS environment variable.\n",
    224224            feResourceDefault("emacs"), feResourceDefault("xemacs"));
    225225    mainUsage();
    226226    exit(1);
    227227  }
    228            
     228
    229229  if (singular == NULL) singular = feResource("SingularEmacs", 0);
    230230  if (singular == NULL)
    231231  {
    232     error( "Error: Can't find singular executable.\n Expected it at %s\n Specify with --singular option,\n or set ESINGULAR_SINGULAR environment variable.\n", 
     232    error( "Error: Can't find singular executable.\n Expected it at %s\n Specify with --singular option,\n or set ESINGULAR_SINGULAR environment variable.\n",
    233233            feResourceDefault("SingularEmacs"));
    234234    mainUsage();
    235235    exit(1);
    236236  }
    237    
     237
    238238  if (emacs_dir == NULL) emacs_dir = feResource("EmacsDir", 0);
    239239  if (emacs_dir == NULL)
    240240  {
    241     error( "Error: Can't find emacs directory for Singular lisp files. \n Expected it at %s\n Specify with --emacs_dir option,\n or set ESINGULAR_EMACS_DIR environment variable.\n", 
     241    error( "Error: Can't find emacs directory for Singular lisp files. \n Expected it at %s\n Specify with --emacs_dir option,\n or set ESINGULAR_EMACS_DIR environment variable.\n",
    242242            feResourceDefault("EmacsDir"));
    243243    mainUsage();
     
    245245  }
    246246
    247   if (emacs_load == NULL) 
     247  if (emacs_load == NULL)
    248248  {
    249249    // look into env variable
     
    268268        if (emacs_load == NULL)
    269269        {
    270           error( "Error: Can't find emacs load file for Singular mode. \n Expected it at %s\n Specify with --emacs_load option,\n or set ESINGULAR_EMACS_LOAD environment variable,\n or put file '.emacs-singular' in your home directory.\n", 
    271                   feResourceDefault("EmacsLoad")); 
     270          error( "Error: Can't find emacs load file for Singular mode. \n Expected it at %s\n Specify with --emacs_load option,\n or set ESINGULAR_EMACS_LOAD environment variable,\n or put file '.emacs-singular' in your home directory.\n",
     271                  feResourceDefault("EmacsLoad"));
    272272          mainUsage();
    273273          exit(1);
     
    276276    }
    277277  }
    278  
    279   syscall = (char*) omAlloc(strlen(emacs) + 
    280                            strlen(singular) + 
    281                            strlen(emacs_dir) + 
     278
     279  syscall = (char*) omAlloc(strlen(emacs) +
     280                           strlen(singular) +
     281                           strlen(emacs_dir) +
    282282                           strlen(emacs_load) +
    283283                           length + 300);
     
    288288  // append / at the end of cwd
    289289  if (cwd[strlen(cwd)-1] != '/') strcat(cwd, "/");
    290    
    291   // Note: option -no-init-file should be equivalent to -q. Anyhow, 
     290
     291  // Note: option -no-init-file should be equivalent to -q. Anyhow,
    292292  // xemacs-20.4 sometimes crashed on startup when using -q. DonŽt know why.
    293293  sprintf(syscall, "%s %seval '(setq singular-emacs-home-directory \"%s\")' %sno-init-file %sl %s %seval '(singular-other \"%s\" \"%s\" (list ",
    294           emacs, prefix, emacs_dir, prefix, prefix, emacs_load, prefix, 
     294          emacs, prefix, emacs_dir, prefix, prefix, emacs_load, prefix,
    295295          singular, cwd);
    296296
  • Singular/extra.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: extra.cc,v 1.168 2001-09-27 15:56:25 Singular Exp $ */
     4/* $Id: extra.cc,v 1.169 2001-10-09 16:35:57 Singular Exp $ */
    55/*
    66* ABSTRACT: general interface to internals of Singular ("system" command)
     
    246246        #ifdef HAVE_NAMESPACES
    247247          TEST_FOR("Namespaces");
     248        #endif
     249        #ifdef HAVE_NS
     250          TEST_FOR("namespaces");
    248251        #endif
    249252        #ifdef HAVE_DYNAMIC_LOADING
     
    10231026    {
    10241027#ifdef HAVE_NS
    1025       idhdl hh=basePack->idroot;
    1026       while (hh!=NULL)
    1027       {
    1028         if (IDDATA(hh)==(void *)currRing) PrintS("(R)");
    1029         else if (IDDATA(hh)==(void *)currPack) PrintS("(P)");
    1030         else PrintS("   ");
    1031         Print("::%s, typ %s level %d\n",
    1032                IDID(hh),Tok2Cmdname(IDTYP(hh)),IDLEV(hh));
    1033         hh=IDNEXT(hh);
    1034       }
    1035       hh=basePack->idroot;
    1036       while (hh!=NULL)
    1037       {
    1038         if (IDDATA(hh)==(void *)basePack)
    1039           Print("(T)::%s, typ %s level %d\n",
    1040           IDID(hh),Tok2Cmdname(IDTYP(hh)),IDLEV(hh));
    1041         else
    1042         if ((IDTYP(hh)==RING_CMD)
    1043         || (IDTYP(hh)==QRING_CMD)
    1044         || (IDTYP(hh)==PACKAGE_CMD))
    1045         {
    1046           idhdl h2=IDRING(hh)->idroot;
    1047           while (h2!=NULL)
    1048           {
    1049             if (IDDATA(h2)==(void *)currRing) PrintS("(R)");
    1050             else if (IDDATA(h2)==(void *)currPack) PrintS("(P)");
    1051             else PrintS("   ");
    1052             Print("%s::%s, typ %s level %d\n",
    1053             IDID(hh),IDID(h2),Tok2Cmdname(IDTYP(h2)),IDLEV(h2));
    1054             h2=IDNEXT(h2);
    1055           }
    1056         }
    1057         hh=IDNEXT(hh);
    1058       }
    1059 #else     
     1028      listall();
     1029#else
    10601030      idhdl hh=IDROOT;
    10611031      while (hh!=NULL)
  • Singular/feOpt.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: feOpt.cc,v 1.18 2001-09-19 09:49:37 Singular Exp $ */
     4/* $Id: feOpt.cc,v 1.19 2001-10-09 16:35:58 Singular Exp $ */
    55/*
    66* ABSTRACT: Implementation of option buisness
     
    6767  {"xterm",         required_argument,      LONG_OPTION_RETURN,
    6868   "XTERM",     "Use XTERM as terminal program to run Singular",          feOptString, 0,   0},
    69 #endif 
     69#endif
    7070
    7171  {"singular",          required_argument,  LONG_OPTION_RETURN,
     
    184184#elif defined(TSINGULAR)
    185185  fd = fopen("feOptTS.inc", "w");
    186 #else 
     186#else
    187187  fd = fopen("feOpt.inc", "w");
    188188#endif
     
    375375        else
    376376          sdb_flags = 0;
    377       #endif     
     377      #endif   
    378378        return NULL;
    379379
  • Singular/feOpt.h

    re58c4a ra3bc95e  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: feOpt.h,v 1.6 2000-05-05 18:40:28 obachman Exp $ */
     6/* $Id: feOpt.h,v 1.7 2001-10-09 16:35:58 Singular Exp $ */
    77/*
    88* ABSTRACT: Declarations for working with Options
     
    1212
    1313extern const char SHORT_OPTS_STRING[];
    14 #define LONG_OPTION_RETURN 13 
     14#define LONG_OPTION_RETURN 13
    1515
    1616/* specifies format of options */
     
    3737
    3838void* feGetOptValue(feOptIndex opt);
    39  
     39
    4040
    4141#ifdef __cplusplus
     
    4848inline int feOptValue(feOptIndex opt, char** val)
    4949{
    50   if (opt != FE_OPT_UNDEF && feOptSpec[(int)opt].type == feOptString) 
     50  if (opt != FE_OPT_UNDEF && feOptSpec[(int)opt].type == feOptString)
    5151  {
    5252    *val = (char*) feOptSpec[(int)opt].value;
     
    5858inline int feOptValue(feOptIndex opt, int* val)
    5959{
    60   if (opt != FE_OPT_UNDEF && feOptSpec[(int)opt].type != feOptString) 
     60  if (opt != FE_OPT_UNDEF && feOptSpec[(int)opt].type != feOptString)
    6161  {
    6262    *val = (int) feOptSpec[(int)opt].value;
     
    6666  return FALSE;
    6767}
    68  
     68
    6969// maps name to otions
    7070feOptIndex feGetOptIndex(const char* name);
  • Singular/fegetopt.h

    re58c4a ra3bc95e  
    1515   along with this program; if not, write to the Free Software
    1616   Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
    17 /* 
    18    obachman 9/99: adapted to Singular by 
     17/*
     18   obachman 9/99: adapted to Singular by
    1919    * adding prefix fe_ to global variables
    20     * extended fe_option structure   
     20    * extended fe_option structure
    2121*/
    2222
     
    9191  const char*   help;    // (short) help string
    9292  feOptType     type;    // type of argument, if has_arg > 0
    93   void*         value;   // (default) value of option 
     93  void*         value;   // (default) value of option
    9494  int           set;     // only relevant for strings: 0 if not set, 1 if set
    9595};
  • Singular/fehelp.cc

    re58c4a ra3bc95e  
    601601    yylplex(str, libnamebuf, &lib_style, IDROOT, FALSE, GET_INFO);
    602602#else /* HAVE_NAMESPACES */
     603#ifdef HAVE_NS
     604    yylplex(str, libnamebuf, &lib_style, IDROOT, FALSE, GET_INFO);
     605#else /* HAVE_NS */
    603606    yylplex(str, libnamebuf, &lib_style, GET_INFO);
     607#endif /* HAVE_NS */
    604608#endif /* HAVE_NAMESPACES */
    605609    reinit_yylp();
  • Singular/fglm.cc

    re58c4a ra3bc95e  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglm.cc,v 1.25 2001-01-12 13:47:09 Singular Exp $
     2// $Id: fglm.cc,v 1.26 2001-10-09 16:35:59 Singular Exp $
    33
    44/****************************************
     
    147147    else
    148148        pperm= NULL;
    149     maFindPerm( sring->names, nvar, sring->parameter, npar, 
    150                 dring->names, nvar, dring->parameter, npar, vperm, pperm, 
     149    maFindPerm( sring->names, nvar, sring->parameter, npar,
     150                dring->names, nvar, dring->parameter, npar, vperm, pperm,
    151151                dring->ch);
    152152    for ( k= nvar; (k > 0) && (state == FglmOk); k-- )
     
    187187        // check if dring->qideal is contained in sring->qideal:
    188188        int * dsvperm = (int *)omAlloc0( (nvar+1)*sizeof( int ) );
    189         maFindPerm( dring->names, nvar, NULL, 0, sring->names, nvar, NULL, 0, 
     189        maFindPerm( dring->names, nvar, NULL, 0, sring->names, nvar, NULL, 0,
    190190                    dsvperm, NULL, sring->ch);
    191191        nMap=nSetMap(dring);
     
    341341      else if ( pIsConstant( quot ) ) state= FglmPolyIsOne;
    342342    }
    343    
     343
    344344    if ( state == FglmOk ) {
    345345      assumeStdFlag( first );
  • Singular/fglmhom.cc

    re58c4a ra3bc95e  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglmhom.cc,v 1.17 2000-09-18 09:18:58 obachman Exp $
     2// $Id: fglmhom.cc,v 1.18 2001-10-09 16:35:59 Singular Exp $
    33
    44/****************************************
     
    6868    }
    6969#ifndef HAVE_EXPLICIT_CONSTR
    70     void initialize( poly m, int b, BOOLEAN ind ) 
     70    void initialize( poly m, int b, BOOLEAN ind )
    7171    {
    7272        basis = b;
     
    7575        mon.sm = NULL;
    7676    }
    77     void initialize( const homogElem h ) 
     77    void initialize( const homogElem h )
    7878    {
    7979        basis = h.basis;
     
    166166#ifdef HAVE_EXPLICIT_CONSTR
    167167                // Expand array using Singulars ReAlloc function
    168                 dat->monlist= 
    169                     (homogElem * )omReallocSize( dat->monlist, 
    170                                            (dat->monlistmax)*sizeof( homogElem ), 
     168                dat->monlist=
     169                    (homogElem * )omReallocSize( dat->monlist,
     170                                           (dat->monlistmax)*sizeof( homogElem ),
    171171                                           (dat->monlistmax+dat->monlistblock) * sizeof( homogElem ) );
    172172                for ( k= dat->monlistmax; k < (dat->monlistmax+dat->monlistblock); k++ )
     
    177177                homogElem * tempelem = new homogElem[ newsize ];
    178178                // Copy old elements
    179                 for ( k= dat->monlistmax - 1; k >= 0; k-- ) 
     179                for ( k= dat->monlistmax - 1; k >= 0; k-- )
    180180                    tempelem[k].initialize( dat->monlist[k] );
    181181                delete [] homogElem;
     
    363363    // Map the sourceHeads to the destRing
    364364    int * vperm = (int *)omAlloc( (sourceRing->N + 1)*sizeof(int) );
    365     maFindPerm( sourceRing->names, sourceRing->N, NULL, 0, currRing->names, 
     365    maFindPerm( sourceRing->names, sourceRing->N, NULL, 0, currRing->names,
    366366                currRing->N, NULL, 0, vperm, NULL, currRing->ch);
    367367    //nSetMap( sourceRing->ch, sourceRing->parameter, sourceRing->P, sourceRing->minpoly );
  • Singular/fglmzero.cc

    re58c4a ra3bc95e  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglmzero.cc,v 1.33 2001-01-09 15:40:06 Singular Exp $
     2// $Id: fglmzero.cc,v 1.34 2001-10-09 16:36:00 Singular Exp $
    33
    44/****************************************
     
    661661    //    STICKYPROT("Calculating vector rep\n");
    662662    v = data.getVectorRep( p );
    663     // if ( v.isZero() ) 
     663    // if ( v.isZero() )
    664664    //   STICKYPROT("vectorrep is 0\n");
    665665    return ( data.state() );
     
    10201020      initv = iv;
    10211021    }
    1022      
     1022
    10231023    poly one = pOne();
    10241024    data.updateCandidates( one, initv );
  • Singular/gnumpc.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: gnumpc.cc,v 1.20 2001-03-22 19:10:59 Singular Exp $ */
     4/* $Id: gnumpc.cc,v 1.21 2001-10-09 16:36:00 Singular Exp $ */
    55/*
    66* ABSTRACT: computations with GMP complex floating-point numbers
     
    322322  gmp_complex* n = new gmp_complex(((gmp_complex*)a)->real());
    323323  return (number)n;
    324 } 
    325  
     324}
     325
    326326number ngcImPart(number a)
    327327{
     
    329329  gmp_complex* n = new gmp_complex(((gmp_complex*)a)->imag());
    330330  return (number)n;
    331 } 
    332  
     331}
     332
    333333/*2
    334334* za >= 0 ?
  • Singular/gnumpc.h

    re58c4a ra3bc95e  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: gnumpc.h,v 1.10 2001-03-22 19:11:00 Singular Exp $ */
     6/* $Id: gnumpc.h,v 1.11 2001-10-09 16:36:00 Singular Exp $ */
    77/*
    88* ABSTRACT: computations with GMP floating-point numbers
     
    4848// folded-file: t ***
    4949// compile-command: "make installg" ***
    50 // End: *** 
     50// End: ***
  • Singular/gr_kstd2.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: gr_kstd2.cc,v 1.2 2001-08-27 14:47:00 Singular Exp $ */
     4/* $Id: gr_kstd2.cc,v 1.3 2001-10-09 16:36:01 Singular Exp $ */
    55/* $Log: not supported by cvs2svn $
     6/* Revision 1.2  2001/08/27 14:47:00  Singular
     7/* *hannes: merge-2-0-2
     8/*
    69/* Revision 1.1.2.2  2001/08/16 13:17:29  Singular
    710/* * hannes: removed rcsid
     
    580583          pLmFree((*h).lcm);
    581584          (*h).lcm=NULL;
    582         } 
     585        }
    583586        (*h).p = NULL;
    584587        return 0;
  • Singular/grammar.y

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: grammar.y,v 1.93 2001-09-25 16:07:26 Singular Exp $ */
     4/* $Id: grammar.y,v 1.94 2001-10-09 16:36:01 Singular Exp $ */
    55/*
    66* ABSTRACT: SINGULAR shell grammatik
     
    11331133#ifdef HAVE_NS
    11341134#else
    1135             Print("%s::%s;\n", (char *)$4.Name(),$2.Name()); 
     1135            Print("%s::%s;\n", (char *)$4.Name(),$2.Name());
    11361136#endif /* HAVE_NS */
    11371137#endif /* HAVE_NAMESPACES */
     
    14301430              idhdl h=(idhdl)$2.data;
    14311431              if ($2.e!=NULL) h=rFindHdl((ring)$2.Data(),NULL, NULL);
     1432              //Print("setring %s lev %d (ptr:%x)\n",IDID(h),IDLEV(h),IDRING(h));
    14321433              if ($1==KEEPRING_CMD)
    14331434              {
     
    14611462                            if (BVERBOSE(V_REDEFINE))
    14621463                              Warn("redefining %s",IDID(p));
    1463                             killhdl(old,&root);
     1464                            killhdl2(old,&root);
    14641465                          }
    14651466                          IDLEV(p)=prevlev;
     
    14671468                        p=IDNEXT(p);
    14681469                      }
     1470                      IDRING(h)->idroot=root;
    14691471                    //}
    14701472                  }
    14711473#ifdef USE_IILOCALRING
    14721474                  iiLocalRing[myynest-1]=IDRING(h);
    1473 #else
     1475#endif
    14741476                  procstack->currRing=IDRING(h);
    14751477                  procstack->currRingHdl=h;
    1476 #endif
    14771478                }
    14781479                else
  • Singular/gring.cc

    re58c4a ra3bc95e  
    77 *  Author:  levandov (Viktor Levandovsky)
    88 *  Created: 8/00 - 11/00
    9  *  Version: $Id: gring.cc,v 1.9 2001-02-28 11:54:49 levandov Exp $
     9 *  Version: $Id: gring.cc,v 1.10 2001-10-09 16:36:02 Singular Exp $
    1010 *******************************************************************/
    1111#include "mod2.h"
     
    8181  Exponent_t expP=0;
    8282  Exponent_t expOut=0;
    83  
     83
    8484  while (p!=NULL)
    8585  {
     
    8787    p_Test(v,r);
    8888    p_Test(p,r);
    89    
     89
    9090    expP=p_GetComp(v,r);
    9191    if (expP==0)
     
    9898      {
    9999        expOut=expM;
    100       }     
     100      }
    101101    }
    102102    else
     
    113113      }
    114114    }
    115    
     115
    116116    p_GetExpV(v,P,r);
    117117    cP=p_GetCoeff(v,r);
     
    155155  Exponent_t expP=0;
    156156  Exponent_t expOut=0;
    157  
     157
    158158  while (p!=NULL)
    159159  {
     
    161161    p_Test(v,r);
    162162    p_Test(p,r);
    163    
     163
    164164    expP=p_GetComp(v,r);
    165165    if (expP==0)
     
    172172      {
    173173        expOut=expM;
    174       }     
     174      }
    175175    }
    176176    else
     
    186186      }
    187187    }
    188    
     188
    189189    p_GetExpV(v,P,r);
    190190    cP=p_GetCoeff(v,r);
     
    222222  F[0]=0;
    223223  G[0]=0;
    224  
     224
    225225  iF=r->N;
    226226  while ((F[iF]==0)&&(iF>=1)) iF--; /* last exp_num of F */
     
    237237    {
    238238      F[i]=F[i]+G[i];
    239     } 
     239    }
    240240    p_SetExpV(out,F,r);
    241241    p_Setm(out,r);
     
    248248// g is univariate monomial
    249249  {
    250 //    if (ri->nc->type==nc_skew) -- postpone to TU   
     250//    if (ri->nc->type==nc_skew) -- postpone to TU
    251251    out=nc_mm_Mult_uu(F,jG,G[jG],r);
    252252    freeT(F,r->N);
     
    254254    return(out);
    255255  }
    256  
     256
    257257  number n1=n_Init(1,r);
    258258  Exponent_t *Prv=(Exponent_t *)omAlloc0(ExpSize);
     
    331331       p_Setm(Pn,r);
    332332       p_Test(Pn,r);
    333        
     333
    334334//       if (pNext(D)==0)
    335335// is D a monomial? could be postponed higher
     
    339339//       else
    340340//       {
    341        Rout=nc_p_Mult_mm(D,Pn,r); 
     341       Rout=nc_p_Mult_mm(D,Pn,r);
    342342//       }
    343343     }
     
    347347       D=NULL;
    348348     }
    349      
     349
    350350     if (Rout!=NULL)
    351351     {
     
    395395  int i;
    396396  number num=NULL;
    397  
     397
    398398  int iF=r->N;
    399399  while ((F[iF]==0)&&(iF>0)) iF-- ;   /* last exponent_num of F */
     
    426426   return(out);
    427427  }
    428  
     428
    429429  Exponent_t *Prv=(Exponent_t*)omAlloc0((r->N+1)*sizeof(Exponent_t));
    430430  Exponent_t *Nxt=(Exponent_t*)omAlloc0((r->N+1)*sizeof(Exponent_t));
     
    518518       kk=lF[cnt+1];
    519519       On[kk]=F[kk];
    520        
     520
    521521       Pn=pOne();
    522522       p_SetExpV(Pn,On,r);
     
    562562/* leadterm and Prv-part with coef 1 */
    563563//  U[0]=exp;
    564  
     564
    565565//  U[jG]=U[jG]+bG;  /* make leadterm */
    566566// ??????????? we have done it already :-0
     
    587587}
    588588
    589 //----------pMultUU--------- 
     589//----------pMultUU---------
    590590poly nc_uu_Mult_ww (int i, int a, int j, int b, const ring r)
    591591{
    592592  poly out=NULL;
    593593  number tmp_number=NULL;
    594  
    595 //Now check zero exeptions, commutativity and should we do something at all? 
     594
     595//Now check zero exeptions, commutativity and should we do something at all?
    596596  out=pOne();
    597597  p_SetExp(out,j,b,r);
     
    600600  p_Setm(out,r);
    601601  if ((a==0)||(b==0)||(i<=j)) return(out);//zero exeptions and usual case
    602  
     602
    603603  if (MATELEM(r->nc->COM,j,i)!=NULL)
    604604//commutative or quasicommutative case
     
    607607    {
    608608      return(out);
    609     }     
     609    }
    610610    else
    611611    {
     
    629629    return (out);
    630630  }
    631  
    632 //  poly C=MATELEM(r->nc->C,j,i);               
    633 //  number c=p_GetCoeff(C,r); //coeff           
     631
     632//  poly C=MATELEM(r->nc->C,j,i);
     633//  number c=p_GetCoeff(C,r); //coeff
    634634//  p_Delete(&C,r);
    635      
     635
    636636  int newcMTsize=0;
    637637  int k,m;
    638638  p_Delete(&out,r);//Shura thinks it is nesessary
    639639
    640  
     640
    641641  if (a>=b) {newcMTsize=a;} else {newcMTsize=b;}
    642642  if (newcMTsize>cMTsize)
     
    644644     newcMTsize = newcMTsize+cMTsize;
    645645     matrix tmp = mpNew(newcMTsize,newcMTsize);
    646      
     646
    647647     for (k=1;k<r->N;k++)
    648648     {
     
    662662  poly x=pOne();p_SetExp(x,j,1,r);p_Setm(x,r);//var(j);
    663663  poly y=pOne();p_SetExp(y,i,1,r);p_Setm(y,r);//var(i);  for convenience
    664  
     664
    665665  poly t=NULL;
    666666/* ------------ Main Cycles ----------------------------*/
     
    679679     t=NULL;
    680680  }
    681  
     681
    682682  for (m=2;m<=b;m++)
    683683  {
     
    762762  int i=0;
    763763  int nv=r->N;
    764  
     764
    765765  Exponent_t *A1=(Exponent_t *)omAlloc0((r->N+1)*sizeof(Exponent_t));
    766766  Exponent_t *A2=(Exponent_t *)omAlloc0((r->N+1)*sizeof(Exponent_t));
  • Singular/gring.h

    re58c4a ra3bc95e  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: gring.h,v 1.7 2001-02-28 11:54:49 levandov Exp $ */
     6/* $Id: gring.h,v 1.8 2001-10-09 16:36:02 Singular Exp $ */
    77/*
    88* ABSTRACT additional defines etc for --with-plural
     
    2020// other routines we need in addition :
    2121poly nc_mm_Mult_p(const poly m, poly p, const ring r);
    22 poly nc_mm_Mult_nn (Exponent_t *F, Exponent_t *G, const ring r); 
     22poly nc_mm_Mult_nn (Exponent_t *F, Exponent_t *G, const ring r);
    2323poly nc_mm_Mult_uu (Exponent_t *F,int jG,int bG, const ring r);
    2424poly nc_uu_Mult_ww (int i, int a, int j, int b, const ring r);
  • Singular/ideals.h

    re58c4a ra3bc95e  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ideals.h,v 1.34 2001-03-05 16:41:48 mschulze Exp $ */
     6/* $Id: ideals.h,v 1.35 2001-10-09 16:36:02 Singular Exp $ */
    77/*
    88* ABSTRACT - all basic methods to manipulate ideals
     
    6060
    6161long idRankFreeModule(ideal m, ring lmRing, ring tailRing);
    62 inline long idRankFreeModule(ideal m, ring r = currRing) 
     62inline long idRankFreeModule(ideal m, ring r = currRing)
    6363{return idRankFreeModule(m, r, r);}
    6464
  • Singular/intvec.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: intvec.cc,v 1.23 2001-01-31 18:04:51 Singular Exp $ */
     4/* $Id: intvec.cc,v 1.24 2001-10-09 16:36:03 Singular Exp $ */
    55/*
    66* ABSTRACT: class intvec: lists/vectors of integers
     
    323323
    324324/*2
    325 *computes a triangular matrix 
     325*computes a triangular matrix
    326326*/
    327327//void ivTriangMat(intvec * imat)
     
    332332//  i *= imat->cols();
    333333//  for(j=k;j>=i;j--)
    334 //    (*imat)[j] = 0; 
     334//    (*imat)[j] = 0;
    335335//}
    336336
     
    353353static void ivContent(intvec *);
    354354static int ivL1Norm(intvec *);
    355 static int ivCondNumber(intvec *, int); 
     355static int ivCondNumber(intvec *, int);
    356356
    357357/* Triangulierung in intmat.cc */
     
    697697    for(k=w->rows()-1;k>=0;k--)
    698698      (*res)[k] = (*w)[k];
    699   } 
     699  }
    700700}
    701701
  • Singular/iparith.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iparith.cc,v 1.267 2001-09-25 16:07:26 Singular Exp $ */
     4/* $Id: iparith.cc,v 1.268 2001-10-09 16:36:03 Singular Exp $ */
    55
    66/*
     
    763763      case PACKAGE_CMD:
    764764        packhdl = (idhdl)u->data;
    765         if((!IDPACKAGE(packhdl)->loaded) 
     765        if((!IDPACKAGE(packhdl)->loaded)
    766766        && (IDPACKAGE(packhdl)->language > LANG_TOP))
    767767        {
     
    14581458  leftv sl = iiMake_proc((idhdl)u->data,u,v);
    14591459#else /* HAVE_NAMESPACES */
     1460#ifdef HAVE_NS
     1461  leftv sl;
     1462  if (u->req_packhdl==currPack)
     1463    sl = iiMake_proc((idhdl)u->data,NULL,v);
     1464  else
     1465    sl = iiMake_proc((idhdl)u->data,u->req_packhdl,v);
     1466#else /* HAVE_NS */
    14601467  leftv sl = iiMake_proc((idhdl)u->data,v);
     1468#endif /* HAVE_NS */
    14611469#endif /* HAVE_NAMESPACES */
    14621470  if (sl==NULL)
     
    25592567  leftv sl = iiMake_proc((idhdl) u->data,u,NULL);
    25602568#else /* HAVE_NAMESPACES */
     2569#ifdef HAVE_NS
     2570  leftv sl = iiMake_proc((idhdl) u->data,u->req_packhdl,NULL);
     2571#else /* HAVE_NS */
    25612572  leftv sl = iiMake_proc((idhdl) u->data,NULL);
     2573#endif /* HAVE_NS */
    25622574#endif /* HAVE_NAMESPACES */
    25632575  if (sl==NULL)
  • Singular/ipid.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipid.cc,v 1.53 2001-09-25 16:07:27 Singular Exp $ */
     4/* $Id: ipid.cc,v 1.54 2001-10-09 16:36:04 Singular Exp $ */
    55
    66/*
     
    4646#ifdef HAVE_NS
    4747idhdl currPackHdl = NULL;
     48idhdl basePackHdl = NULL;
    4849package currPack =NULL;
    4950package basePack =NULL;
     
    350351    else if ((IDTYP(h) == t)||(t==DEF_CMD))
    351352    {
     353      if ((IDTYP(h)==PACKAGE_CMD)
     354      && (strcmp(s,"Top")==0))
     355      {
     356        goto errlabel;
     357      }
    352358      if (BVERBOSE(V_REDEFINE))
    353359#ifdef KAI
     
    357363#endif
    358364#ifdef HAVE_NAMESPACES
    359         if(t==PACKAGE_CMD && strcmp(s,"Top")==0) {
    360           Warn("identifier `%s` in use",s);
    361           return(h);
    362         }
    363 #endif /* HAVE_NAMESPACES */
    364         if (s==IDID(h))
    365         IDID(h)=NULL;
    366       killhdl(h,root);
     365      if(t==PACKAGE_CMD && strcmp(s,"Top")==0)
     366      {
     367        Warn("identifier `%s` in use",s);
     368        return(h);
     369      }
     370#endif /* HAVE_NAMESPACES */
     371      if (s==IDID(h)) IDID(h)=NULL;
     372      killhdl2(h,root);
    367373    }
    368374    else
     
    375381    {
    376382      if (IDLEV(h)!=lev)
    377       {
    378383        s=omStrDup(s);
    379       }
    380384      else if ((IDTYP(h) == t)||(t==DEF_CMD))
    381385      {
     
    386390          Warn("redefining %s **",s);
    387391#endif
    388         IDID(h)=NULL;
    389         killhdl(h,&IDROOT);
     392        if (s==IDID(h)) IDID(h)=NULL;
     393        killhdl2(h,&IDROOT);
    390394      }
    391395      else
    392       {
    393396        goto errlabel;
    394       }
    395397    }
    396398  }
     
    423425#endif
    424426        IDID(h)=NULL;
    425         killhdl(h,&currRing->idroot);
     427        killhdl2(h,&currRing->idroot);
    426428      }
    427429      else
     
    431433    }
    432434  }
    433   return *root = (*root)->set(s, lev, t, init);
     435  *root = (*root)->set(s, lev, t, init);
     436  checkall();
     437  return *root;
    434438
    435439  errlabel:
     
    452456        if (h!=NULL)
    453457        {
    454           killhdl(h,&(currRing->idroot));
     458          killhdl2(h,&(currRing->idroot));
    455459          return;
    456460        }
     
    459463      return;
    460464    }
    461     killhdl(h,ih);
     465    killhdl2(h,ih);
    462466  }
    463467  else
     
    469473  int t=IDTYP(h);
    470474  if ((BEGIN_RING<t) && (t<END_RING) && (t!=QRING_CMD))
    471     killhdl(h,&currRing->idroot);
     475    killhdl2(h,&currRing->idroot);
    472476  else
    473477  {
     
    475479    if(t==PACKAGE_CMD)
    476480    {
    477       killhdl(h,&NSROOT(namespaceroot->root));
     481      killhdl2(h,&NSROOT(namespaceroot->root));
    478482    }
    479483    else
    480484#endif /* HAVE_NAMESPACES */
     485#ifdef HAVE_NS
     486    if(t==PACKAGE_CMD)
     487    {
     488      killhdl2(h,&(basePack->idroot));
     489    }
     490    else
     491    {
     492      idhdl s=currPack->idroot;
     493      while ((s!=h) && (s!=NULL)) s=s->next;
     494      if (s!=NULL)
     495        killhdl2(h,&(currPack->idroot));
     496      else if (basePack!=currPack)
     497      {
     498        idhdl s=basePack->idroot;
     499        while ((s!=h) && (s!=NULL)) s=s->next;
     500        if (s!=NULL)
     501          killhdl2(h,&(basePack->idroot));
     502        else
     503          killhdl2(h,&(currRing->idroot));
     504       }
     505    }
     506#else /* HAVE_NS */
    481507    {
    482508      idhdl s=IDROOT;
    483509      while ((s!=h) && (s!=NULL)) s=s->next;
    484       if (s==NULL) killhdl(h,&currRing->idroot);
    485       else killhdl(h,&IDROOT);
    486     }
    487   }
    488 }
    489 
    490 void killhdl(idhdl h, idhdl * ih)
     510      if (s==NULL) killhdl2(h,&(currRing->idroot));
     511      else killhdl2(h,&IDROOT);
     512    }
     513#endif /* HAVE_NAMESPACES */
     514  }
     515}
     516
     517void killhdl2(idhdl h, idhdl * ih)
    491518{
    492519  //printf("kill %s, id %x, typ %d lev: %d\n",IDID(h),(int)IDID(h),IDTYP(h),IDLEV(h));
     
    501528  }
    502529  // ring / qring  --------------------------------------------------------
     530  if ((IDTYP(h) == PACKAGE_CMD) && (strcmp(IDID(h),"Top")==0))
     531  {
     532    WarnS("can not kill `Top`");
     533    return;
     534  }
    503535  if ((IDTYP(h) == RING_CMD) || (IDTYP(h) == QRING_CMD))
    504536  {
     
    533565      {
    534566        temp = IDNEXT(hdh);
    535         killhdl(hdh,&(IDRING(h)->idroot));
     567        killhdl2(hdh,&(IDRING(h)->idroot));
    536568        hdh = temp;
    537569      }
    538       killhdl(*hd,hd);
     570      killhdl2(*hd,hd);
    539571    }
    540572    // reset currRing ?
     
    581613  }
    582614#endif /* HAVE_NAMESPACES */
     615#ifdef HAVE_NS
     616  // package -------------------------------------------------------------
     617  else if (IDTYP(h) == PACKAGE_CMD)
     618  {
     619    // any objects defined for this package ?
     620    if ((IDPACKAGE(h)->ref<=0)  &&  (IDPACKAGE(h)->idroot!=NULL))
     621    {
     622      if (currPack==IDPACKAGE(h))
     623      {
     624        currPack=basePack;
     625        currPackHdl=NULL;
     626      }
     627      idhdl * hd = &IDRING(h)->idroot;
     628      idhdl  hdh = IDNEXT(*hd);
     629      idhdl  temp;
     630      while (hdh!=NULL)
     631      {
     632        temp = IDNEXT(hdh);
     633        killhdl2(hdh,&(IDPACKAGE(h)->idroot));
     634        hdh = temp;
     635      }
     636      killhdl2(*hd,hd);
     637    }
     638    paKill(IDPACKAGE(h));
     639    if (currPackHdl==h) currPackHdl=packFindHdl(currPack);
     640  }
     641#endif /* HAVE_NS */
    583642  // poly / vector -------------------------------------------------------
    584643  else if ((IDTYP(h) == POLY_CMD) || (IDTYP(h) == VECTOR_CMD))
     
    644703  //  general  -------------------------------------------------------------
    645704  // now dechain it and delete idrec
    646 #ifdef KAI_
     705#ifdef KAI
    647706  if(h->next != NULL)
    648707    Print("=======>%s(%x) -> %s<====\n", IDID(h), IDID(h), IDID(h->next));
     
    657716  {
    658717    // h is at the beginning of the list
    659     *ih = IDNEXT(*ih);
     718    *ih = IDNEXT(h) /* ==*ih */;
    660719  }
    661720  else
     
    778837* move 'tomove' from root1 list to root2 list
    779838*/
    780 static void ipSwapId(idhdl tomove, idhdl &root1, idhdl &root2)
     839static int ipSwapId(idhdl tomove, idhdl &root1, idhdl &root2)
    781840{
    782841  idhdl h;
     
    784843  h=root2;
    785844  while ((h!=NULL) && (h!=tomove)) h=IDNEXT(h);
    786   if (h!=NULL) return;
     845  if (h!=NULL) return FALSE; /*okay */
    787846  /* search predecessor of h in root1, remove 'tomove' */
    788847  h=root1;
     
    794853  {
    795854    while ((h!=NULL) && (IDNEXT(h)!=tomove)) h=IDNEXT(h);
    796     if (h==NULL) return; /* not in the list root1 -> do nothing */
     855    if (h==NULL) return TRUE; /* not in the list root1 -> do nothing */
    797856    IDNEXT(h)=IDNEXT(tomove);
    798857  }
     
    800859  IDNEXT(tomove)=root2;
    801860  root2=tomove;
     861  return FALSE;
    802862}
    803863
     
    806866  if ((currRing!=NULL)&&(tomove!=NULL))
    807867  {
    808     if (((QRING_CMD!=IDTYP(tomove)) && (BEGIN_RING<IDTYP(tomove)) && (IDTYP(tomove)<END_RING))
     868    if (((QRING_CMD!=IDTYP(tomove)) && RingDependend(IDTYP(tomove)))
    809869    || ((IDTYP(tomove)==LIST_CMD) && (lRingDependend(IDLIST(tomove)))))
    810870    {
    811871      /*move 'tomove' to ring id's*/
     872#ifdef HAVE_NS
     873      if (ipSwapId(tomove,IDROOT,currRing->idroot))
     874      ipSwapId(tomove,basePack->idroot,currRing->idroot);
     875#else
    812876      ipSwapId(tomove,IDROOT,currRing->idroot);
     877#endif
    813878    }
    814879    else
     
    917982         (IDTYP(hdh)==PACKAGE_CMD && IDPACKAGE(hdh)->language==LANG_TOP &&
    918983         IDPACKAGE(hdh)->ref>0 ))
    919         killhdl(hdh,&(pack->idroot));
     984        killhdl2(hdh,&(pack->idroot));
    920985      hdh = temp;
    921986    }
     
    10011066#endif
    10021067
    1003 void proclevel::push(ring r, idhdl R,char *n)
    1004 {
     1068void proclevel::push(char *n)
     1069{
     1070  //Print("push %s\n",n);
    10051071  proclevel *p=(proclevel*)omAlloc0(sizeof(proclevel));
    1006   p->currRing=r;
    1007   p->currRingHdl=R;
     1072  p->currRing=::currRing;
     1073  p->currRingHdl=::currRingHdl;
    10081074  p->name=n;
    10091075  #ifdef HAVE_NS
     
    10131079  p->next=this;
    10141080  procstack=p;
    1015 
    1016 void proclevel::pop(ring &r, idhdl &R)
    1017 {
    1018   r=this->currRing;
     1081}
     1082void proclevel::pop()
     1083{
     1084  //Print("pop %s\n",name);
     1085  if (currRing!=::currRing) PrintS("currRing wrong\n");;
     1086  ::currRing=this->currRing;
    10191087  //if (r==NULL) Print("set ring to NULL at lev %d(%s)\n",myynest,name);
    1020   R=this->currRingHdl;
     1088  ::currRingHdl=this->currRingHdl;
     1089  if((::currRingHdl==NULL)||(IDRING(::currRingHdl)!=(::currRing)))
     1090    ::currRingHdl=rFindHdl(::currRing,NULL,NULL);
    10211091  #ifdef HAVE_NS
     1092  //Print("restore pack=%s,1.obj=%s\n",IDID(currPackHdl),IDID(currPack->idroot));
    10221093  ::currPackHdl=this->currPackHdl;
    10231094  ::currPack=this->currPack;
     
    11431214}
    11441215#endif /* HAVE_NAMESPACES */
     1216
     1217#ifdef HAVE_NS
     1218idhdl packFindHdl(package r)
     1219{
     1220  idhdl h=basePack->idroot;
     1221  while (h!=NULL)
     1222  {
     1223    if ((IDTYP(h)==PACKAGE_CMD)
     1224        && (IDPACKAGE(h)==r))
     1225      return h;
     1226    h=IDNEXT(h);
     1227  }
     1228  return NULL;
     1229}
     1230#endif
  • Singular/ipid.h

    re58c4a ra3bc95e  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ipid.h,v 1.30 2001-09-25 16:07:28 Singular Exp $ */
     6/* $Id: ipid.h,v 1.31 2001-10-09 16:36:05 Singular Exp $ */
    77/*
    88* ABSTRACT: identfier handling
     
    3535  pack->ref++;
    3636  return pack;
     37}
     38
     39inline void paKill(package pack)
     40{
     41  pack->ref--;
    3742}
    3843
     
    110115  char      * name;
    111116  proclevel()  { memset(this,0,sizeof(*this)); }
    112   void    push(ring,idhdl,char *);
    113   void    pop(ring &, idhdl &);
    114 }; 
     117  void    push(char *);
     118  void    pop();
     119};
    115120extern proclevel *procstack;
    116121
     
    149154#ifdef HAVE_NS
    150155extern idhdl currPackHdl;
     156extern idhdl basePackHdl;
    151157extern package currPack;
    152158extern package basePack;
     
    165171void  killid(char * a, idhdl * i);
    166172void  killhdl(idhdl h);
    167 void  killhdl(idhdl h, idhdl * ih);
     173void  killhdl2(idhdl h, idhdl * ih);
    168174lists ipNameList(idhdl root);
    169175void  ipMoveId(idhdl h);
    170176BOOLEAN checkPackage(package pack);
     177#ifdef HAVE_NS
     178idhdl packFindHdl(package r);
     179#endif
    171180
    172181#define FLAG_STD   0
  • Singular/iplib.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iplib.cc,v 1.91 2001-09-27 13:13:03 Singular Exp $ */
     4/* $Id: iplib.cc,v 1.92 2001-10-09 16:36:05 Singular Exp $ */
    55/*
    66* ABSTRACT: interpreter: LIB and help
     
    6262
    6363#ifndef HAVE_NAMESPACES
     64#ifndef HAVE_NS
    6465  char *p;
    6566
     
    6970
    7071  return TRUE;
     72#else
     73  char *plib = iiConvName(lib);
     74  hl = basePack->idroot->get(plib,0);
     75  if((hl==NULL) ||(IDTYP(hl)!=PACKAGE_CMD))
     76  {
     77    omFree(plib);
     78    return FALSE;
     79  }
     80  omFree(plib);
     81  return (strcmp(lib,IDPACKAGE(hl)->libname)==0);
     82#endif
    7183#else
    7284  char *plib = iiConvName(lib);
     
    316328  myynest++;
    317329  err=yyparse();
     330  checkall();
    318331  if (sLastPrinted.rtyp!=0)
    319332  {
     
    322335  //Print("kill locals for %s (level %d)\n",IDID(pn),myynest);
    323336  killlocals(myynest);
     337  checkall();
    324338  //Print("end kill locals for %s (%d)\n",IDID(pn),myynest);
    325339  myynest--;
     
    331345
    332346#ifdef USE_IILOCALRING
    333 ring    *iiLocalRing
    334 #ifdef TEST
    335                     =NULL
    336 #endif
    337                    ;
    338 #endif
    339 sleftv  *iiRETURNEXPR
    340 #ifdef TEST
    341                     =NULL
    342 #endif
    343                    ;
     347ring    *iiLocalRing;
     348#endif
     349sleftv  *iiRETURNEXPR;
    344350int     iiRETURNEXPR_len=0;
    345351
     
    347353static void iiShowLevRings()
    348354{
     355  int i;
    349356#ifdef USE_IILOCALRING
    350   int i;
    351357  for (i=1;i<=myynest;i++)
    352358  {
     
    357363  }
    358364#endif
    359   {
    360     proclevel * nshdl;
    361     for(nshdl=procstack; nshdl != NULL; nshdl = nshdl->next)
    362     {
    363       if (nshdl->currRing==NULL) PrintS("NULL");
    364       else                       Print("%d",nshdl->currRing);
    365       PrintLn();
    366     }
    367   }
     365#ifdef HAVE_NS
     366  i=myynest;
     367  proclevel *p=procstack;
     368  while (p!=NULL)
     369  {
     370    Print("lev %d:",i);
     371    if (p->currRingHdl==NULL) PrintS("NULL");
     372    else                      Print("%s",IDID(p->currRingHdl));
     373    PrintLn();
     374    p=p->next;
     375  }
     376#endif
    368377  if (currRing==NULL) PrintS("curr:NULL\n");
    369378  else                Print ("curr:%x\n",currRing);
     
    390399sleftv * iiMake_proc(idhdl pn, sleftv* slpn, sleftv* sl)
    391400#else /* HAVE_NAMESPACES */
     401#ifdef HAVE_NS
     402sleftv * iiMake_proc(idhdl pn, package pack, sleftv* sl)
     403#else /* HAVE_NS */
    392404sleftv * iiMake_proc(idhdl pn, sleftv* sl)
     405#endif /* HAVE_NS */
    393406#endif /* HAVE_NAMESPACES */
    394407{
     
    422435    //printf("iiMake_proc: staying in TOP-LEVEL\n");
    423436  }
    424   procstack->push(currRing,currRingHdl,pi->procname);
    425437#else /* HAVE_NAMESPACES */
    426438  omFree((ADDRESS)plib);
     
    431443    return NULL;
    432444  }
    433   procstack->push(currRing,currRingHdl,pi->procname);
    434445#endif /* HAVE_NAMESPACES */
    435446  iiCheckNest();
     
    438449#endif
    439450  iiRETURNEXPR[myynest+1].Init();
     451  procstack->push(pi->procname);
    440452  if ((traceit&TRACE_SHOW_PROC)
    441453  || (pi->trace_flag&TRACE_SHOW_PROC))
     
    455467
    456468    case LANG_SINGULAR:
     469                 #ifdef HAVE_NS
     470                 if ((pi->pack!=NULL)&&(currPack!=pi->pack))
     471                 {
     472                   currPack=pi->pack;
     473                   currPackHdl=packFindHdl(currPack);
     474                   //Print("set pack=%s\n",IDID(currPackHdl));
     475                 }
     476                 else if ((pack!=NULL)&&(currPack!=pack))
     477                 {
     478                   currPack=pack;
     479                   currPackHdl=packFindHdl(currPack);
     480                 }
     481                 #endif
    457482                 err=iiPStart(pn,sl);
    458483                 break;
     
    507532  }
    508533#else /* USE_IILOCALRING */
     534  if (procstack->currRing != currRing)
     535  {
     536    //if (procstack->currRingHdl!=NULL)
     537    //Print("procstack:%s,",IDID(procstack->currRingHdl));
     538    //if (currRingHdl!=NULL)
     539    //Print(" curr:%s\n",IDID(currRingHdl));
     540    //Print("pr:%x, curr: %x\n",procstack->currRing,currRing);
     541    if (((iiRETURNEXPR[myynest+1].Typ()>BEGIN_RING)
     542      && (iiRETURNEXPR[myynest+1].Typ()<END_RING))
     543    || ((iiRETURNEXPR[myynest+1].Typ()==LIST_CMD)
     544      && (lRingDependend((lists)iiRETURNEXPR[myynest+1].Data()))))
     545    {
     546      //idhdl hn;
     547      char *n;
     548      char *o;
     549      if (procstack->currRing!=NULL)
     550      {
     551        //PrintS("reset ring\n");
     552        procstack->currRingHdl=rFindHdl(procstack->currRing,NULL, NULL);
     553        if (procstack->currRingHdl==NULL)
     554          procstack->currRingHdl=
     555           rFindHdl(procstack->currRing,NULL,procstack->currPack->idroot);
     556        if (procstack->currRingHdl==NULL)
     557          procstack->currRingHdl=
     558           rFindHdl(procstack->currRing,NULL,basePack->idroot);
     559        o=IDID(procstack->currRingHdl);
     560        currRing=procstack->currRing;
     561        currRingHdl=procstack->currRingHdl;
     562      }
     563      else                            o="none";
     564      if (currRing!=NULL)             n=IDID(currRingHdl);
     565      else                            n="none";
     566      if (currRing==NULL)
     567      {
     568        Werror("ring change during procedure call: %s -> %s",o,n);
     569        iiRETURNEXPR[myynest+1].CleanUp();
     570        err=TRUE;
     571      }
     572    }
     573    if (procstack->currRingHdl!=NULL)
     574    {
     575      rSetHdl(procstack->currRingHdl);
     576    }
     577    else
     578    { currRingHdl=NULL; currRing=NULL; }
     579  }
     580#endif /* USE_IILOCALRING */
     581#ifdef HAVE_NAMESPACES
    509582  if (NS_LRING != currRing)
    510583  {
     
    546619    { currRingHdl=NULL; currRing=NULL; }
    547620  }
    548 #endif /* USE_IILOCALRING */
     621#endif /* HAVE_NAMESPACES */
    549622  if (iiCurrArgs!=NULL)
    550623  {
     
    554627    iiCurrArgs=NULL;
    555628  }
    556   procstack->pop(currRing,currRingHdl);
     629  procstack->pop();
    557630  if (err)
    558631    return NULL;
     
    581654  if(ns != NULL)  namespaceroot->push(IDPACKAGE(ns), IDID(ns), myynest+1);
    582655  else            namespaceroot->push(namespaceroot->root->pack, "Top", myynest+1);
    583   procstack->push(currRing,currRingHdl,example);
     656  procstack->push(example);
    584657#else /* HAVE_NAMESPACES */
    585   procstack->push(currRing,currRingHdl,example);
     658  procstack->push(example);
    586659#endif /* HAVE_NAMESPACES */
    587660#ifdef USE_IILOCALRING
     
    623696  }
    624697#else /* USE_IILOCALRING */
     698#endif /* USE_IILOCALRING */
    625699  if (NS_LRING != currRing)
    626700  {
     
    638712    }
    639713  }
    640 #endif /* USE_IILOCALRING */
    641   procstack->pop(currRing,currRingHdl);
     714//#endif /* USE_IILOCALRING */
     715  procstack->pop();
    642716  return err;
    643717}
     
    770844  idhdl pl;
    771845#else
     846#ifdef HAVE_NS
     847  idhdl pl;
     848#endif
    772849  idhdl hl;
    773850#endif /* HAVE_NAMESPACES */
     
    778855  char *plib = iiConvName(newlib);
    779856#endif /* HAVE_NAMESPACES */
     857#ifdef HAVE_NS
     858  char *plib = iiConvName(newlib);
     859#endif
    780860  FILE * fp = feFopen( newlib, "r", libnamebuf, tellerror );
    781861  if (fp==NULL)
     
    873953  LoadResult = iiLoadLIB(fp, libnamebuf, newlib, pl, autoexport, tellerror);
    874954#else /* HAVE_NAMESPACES */
     955#ifdef HAVE_NS
     956  pl = basePack->idroot->get(plib,0);
     957  if (pl==NULL)
     958  {
     959    pl = enterid( omStrDup(plib),0, PACKAGE_CMD,
     960                  &(basePack->idroot), TRUE );
     961    IDPACKAGE(pl)->language = LANG_SINGULAR;
     962    IDPACKAGE(pl)->libname=omStrDup(newlib);
     963  }
     964  else
     965  {
     966    if(IDTYP(pl)!=PACKAGE_CMD)
     967    {
     968      Warn("not of typ package.");
     969      fclose(fp);
     970      return TRUE;
     971    }
     972  }
     973  LoadResult = iiLoadLIB(fp, libnamebuf, newlib, pl, TRUE, tellerror);
     974#else /* HAVE_NS */
    875975  LoadResult = iiLoadLIB(fp, libnamebuf, newlib, NULL, FALSE, tellerror);
    876 #endif /* HAVE_NAMESPACES */
     976#endif /* HAVE_NS */
     977#endif /* HAVE_NAMESPACES */
     978
     979  omFree((ADDRESS)newlib);
    877980
    878981#ifdef HAVE_NAMESPACES
    879982  if(!LoadResult) IDPACKAGE(pl)->loaded = TRUE;
    880983  namespaceroot->pop();
    881 #endif /* HAVE_NAMESPACES */
    882 
    883   omFree((ADDRESS)newlib);
    884 #ifdef HAVE_NAMESPACES
    885984  omFree((ADDRESS)plib);
    886 #endif /* HAVE_LIBPARSER */
     985#endif /* HAVE_NAMESPACES */
     986#ifdef HAVE_NS
     987  if(!LoadResult) IDPACKAGE(pl)->loaded = TRUE;
     988  omFree((ADDRESS)plib);
     989#endif /* HAVE_NS */
     990
    887991 return LoadResult;
    888992}
     
    9391043    yylplex(newlib, libnamebuf, &lib_style, pl, autoexport);
    9401044  #else /* HAVE_NAMESPACES */
     1045  #ifdef HAVE_NS
     1046    yylplex(newlib, libnamebuf, &lib_style, pl, autoexport);
     1047  #else
    9411048    yylplex(newlib, libnamebuf, &lib_style);
     1049  #endif /* HAVE_NS */
    9421050  #endif /* HAVE_NAMESPACES */
    9431051  if(yylp_errno)
     
    10321140  pi->language = LANG_SINGULAR;
    10331141  pi->ref = 1;
     1142  pi->pack = NULL;
    10341143  pi->is_static = pstatic;
    10351144  pi->data.s.proc_start = pos;
  • Singular/ipshell.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipshell.cc,v 1.67 2001-09-27 13:13:03 Singular Exp $ */
     4/* $Id: ipshell.cc,v 1.68 2001-10-09 16:36:06 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    244244      {
    245245        idhdl nexth = IDNEXT(h);
    246         killhdl(h,localhdl);
     246        killhdl2(h,localhdl);
    247247        h = nexth;
    248248        //PrintS("kill\n");
     
    259259void killlocals(int v)
    260260{
     261#ifndef HAVE_NS
    261262  killlocals0(v,&IDROOT);
     263#else
     264  killlocals0(v,&(currPack->idroot));
     265  if (currPack!=basePack)
     266  {
     267    //PrintS("killlocals in Top\n");
     268    killlocals0(v,&(basePack->idroot));
     269  }
     270#endif
    262271
    263272  if ((iiRETURNEXPR_len > myynest)
     
    270279
    271280  idhdl sh=currRingHdl;
     281  ring sr=currRing;
    272282  BOOLEAN changed=FALSE;
    273283#ifndef HAVE_NAMESPACES
     284#ifdef HAVE_NS
     285  idhdl h = currPack->idroot;
     286#else
    274287  idhdl h = IDROOT;
    275 
     288#endif
     289
     290//  Print("killlocals in %s\n",IDID(currPackHdl));
    276291  while (h!=NULL)
    277292  {
     
    279294    && (IDRING(h)->idroot!=NULL))
    280295    {
    281       if (h!=currRingHdl) {changed=TRUE;rSetHdl(h);}
     296      if (IDRING(h)!=currRing) {changed=TRUE;rSetHdl(h);}
    282297      killlocals0(v,&(IDRING(h)->idroot));
    283298    }
    284299    h = IDNEXT(h);
    285300  }
     301#ifdef HAVE_NS
     302  if (currPack!=basePack)
     303  {
     304    //PrintS("killlocals in Top\n");
     305    h=basePack->idroot;
     306    while (h!=NULL)
     307    {
     308      if (((IDTYP(h)==QRING_CMD) || (IDTYP(h) == RING_CMD))
     309      && (IDRING(h)->idroot!=NULL))
     310      {
     311        //Print("go to %s\n",IDID(h));
     312        if (IDRING(h)!=currRing) {changed=TRUE;rSetHdl(h);}
     313        killlocals0(v,&(IDRING(h)->idroot));
     314      }
     315      h = IDNEXT(h);
     316    }
     317  }
     318#endif
    286319#else
    287320  idhdl h = NSROOT(namespaceroot->root);
     
    322355    currRingHdl=NULL;
    323356    if (sh!=NULL) rSetHdl(sh);
     357    else if (sr!=NULL)
     358    {
     359      sh=rFindHdl(sr,NULL,NULL);
     360      rSetHdl(sh);
     361    }
    324362  }
    325363
    326364  if (myynest<=1) iiNoKeepRing=TRUE;
     365  //Print("end killlocals  >= %d\n",v);
     366  //listall();
    327367}
    328368
     
    613653#else
    614654  r=IDROOT->get(theMap->preimage,myynest);
     655#ifdef HAVE_NS
     656  if ((currPack!=basePack)
     657  &&((r==NULL) || ((r->typ != RING_CMD) && (r->typ != QRING_CMD))))
     658    r=basePack->idroot->get(theMap->preimage,myynest);
     659#endif /* HAVE_NS */
    615660#endif /* HAVE_NAMESPACES */
    616661  if ((r!=NULL) && ((r->typ == RING_CMD) || (r->typ== QRING_CMD)))
     
    887932#endif /* HAVE_NAMESPACES */
    888933    {
     934      if (name->rtyp==IDHDL) { id=omStrDup(id); }
    889935      sy->data = (char *)enterid(id,lev,t,root,init_b);
    890936    }
     
    9591005            if (iiLocalRing[0]==IDRING(h)) iiLocalRing[0]=NULL;
    9601006#else
     1007#endif
    9611008            proclevel *p=procstack;
    9621009            while (p->next!=NULL) p=p->next;
     
    9661013              p->currRingHdl=NULL;
    9671014            }
    968 #endif
    969         killhdl(h,root);
     1015//#endif
     1016        killhdl2(h,root);
    9701017      }
    9711018      else
     
    10941141BOOLEAN iiExport (leftv v, int toLev)
    10951142{
     1143  checkall();
    10961144  BOOLEAN nok=FALSE;
    10971145  leftv r=v;
     
    11141162  }
    11151163  r->CleanUp();
     1164  checkall();
    11161165  return nok;
    11171166}
     
    11421191            Warn("redefining %s",IDID(old));
    11431192          }
    1144           killhdl(old,&root);
     1193          killhdl2(old,&root);
    11451194        }
    11461195        else
     
    11651214BOOLEAN iiExport (leftv v, int toLev, idhdl root)
    11661215{
     1216  checkall();
    11671217  BOOLEAN nok=FALSE;
    11681218  leftv rv=v;
     
    11861236            Warn("redefining %s",IDID(old));
    11871237          }
    1188           killhdl(old,&root);
     1238          killhdl2(old,&root);
    11891239        }
    11901240        else
     
    12031253  }
    12041254  rv->CleanUp();
     1255  checkall();
    12051256  return nok;
    12061257}
  • Singular/ipshell.h

    re58c4a ra3bc95e  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ipshell.h,v 1.25 2001-09-25 16:07:29 Singular Exp $ */
     6/* $Id: ipshell.h,v 1.26 2001-10-09 16:36:06 Singular Exp $ */
    77/*
    88* ABSTRACT
     
    171171sleftv * iiMake_proc(idhdl pn, sleftv* slpn, sleftv* sl);
    172172#else /* HAVE_NAMESPACES */
     173#ifdef HAVE_NS
     174sleftv * iiMake_proc(idhdl pn, package pack, sleftv* sl);
     175#else /* HAVE_NS */
    173176sleftv * iiMake_proc(idhdl pn, sleftv* sl);
     177#endif /* HAVE_NS */
    174178#endif /* HAVE_NAMESPACES */
    175179// from misc.cc:
     
    180184/* ================================================================== */
    181185void  singular_example(char *str);
     186
     187#ifdef HAVE_NS
     188void listall();
     189void checkall();
     190#endif
    182191#endif
    183192
  • Singular/kbuckets.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kbuckets.cc,v 1.23 2000-12-31 15:14:32 obachman Exp $ */
     4/* $Id: kbuckets.cc,v 1.24 2001-10-09 16:36:06 Singular Exp $ */
    55
    66#include "mod2.h"
     
    121121  *bucket_pt = NULL;
    122122}
    123  
     123
    124124
    125125void kBucketDeleteAndDestroy(kBucket_pt *bucket_pt)
     
    190190  assume(length <= 0 || length == pLength(lm));
    191191  assume(kBucketIsCleared(bucket));
    192  
     192
    193193  if (lm == NULL) return;
    194194
     
    322322///
    323323/// For changing the ring of the Bpoly to new_tailBin
    324 /// 
     324///
    325325void kBucketShallowCopyDelete(kBucket_pt bucket,
    326326                              ring new_tailRing, omBin new_tailBin,
     
    329329#ifndef HAVE_PSEUDO_BUCKETS
    330330  int i;
    331  
     331
    332332  kBucketCanonicalize(bucket);
    333333  for (i=0; i<= bucket->buckets_used; i++)
    334334    if (bucket->buckets[i] != NULL)
    335       bucket->buckets[i] = p_shallow_copy_delete(bucket->buckets[i], 
     335      bucket->buckets[i] = p_shallow_copy_delete(bucket->buckets[i],
    336336                                                 bucket->bucket_ring,
    337337                                                 new_tailRing,
     
    385385  else
    386386    l1 = *l;
    387  
     387
    388388  kBucketMergeLm(bucket);
    389389  kbTest(bucket);
     
    442442  {
    443443    p1 = p_Minus_mm_Mult_qq(bucket->buckets[i], m, p1,
    444                             bucket->buckets_length[i], l1, 
     444                            bucket->buckets_length[i], l1,
    445445                            spNoether, r);
    446446    l1 = bucket->buckets_length[i];
     
    462462    pSetCoeff0(m, nNeg(pGetCoeff(m)));
    463463  }
    464    
     464
    465465  while (bucket->buckets[i] != NULL)
    466466  {
     
    526526    p1 = r->p_Procs->pp_Mult_mm(p1, m, r, last);
    527527  }
    528    
     528
    529529  while (bucket->buckets[i] != NULL)
    530530  {
  • Singular/kbuckets.h

    re58c4a ra3bc95e  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: kbuckets.h,v 1.14 2000-12-31 15:14:32 obachman Exp $ */
     6/* $Id: kbuckets.h,v 1.15 2001-10-09 16:36:07 Singular Exp $ */
    77#include "structs.h"
    88#include "p_Procs.h"
     
    121121// first, do ExtractLarger
    122122// then add q
    123 inline poly 
     123inline poly
    124124kBucket_ExtractLarger_Add_q(kBucket_pt bucket, poly append, poly q, int *lq)
    125125{
     
    147147///
    148148/// For changing the ring of the Bpoly to new_tailBin
    149 /// 
    150 void kBucketShallowCopyDelete(kBucket_pt bucket, 
     149///
     150void kBucketShallowCopyDelete(kBucket_pt bucket,
    151151                              ring new_tailRing, omBin new_tailBin,
    152152                              pShallowCopyDeleteProc p_shallow_copy_delete);
     
    155155///
    156156/// Tests
    157 /// 
    158 /// 
    159 #ifdef KDEBUG 
     157///
     158///
     159#ifdef KDEBUG
    160160BOOLEAN kbTest(kBucket_pt bucket);
    161161#else
     
    169169
    170170// define this if length of bucket polys are 2, 4, 8, etc
    171 // instead of 4, 16, 64 ... -- 
     171// instead of 4, 16, 64 ... --
    172172// this seems to be less efficient, both, in theory and in practice
    173 // #define BUCKET_TWO_BASE 
     173// #define BUCKET_TWO_BASE
    174174#ifdef BUCKET_TWO_BASE
    175175#define MAX_BUCKET 28
  • Singular/kspoly.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kspoly.cc,v 1.24 2001-01-09 15:40:09 Singular Exp $ */
     4/* $Id: kspoly.cc,v 1.25 2001-10-09 16:36:07 Singular Exp $ */
    55/*
    66*  ABSTRACT -  Routines for Spoly creation and reductions
     
    2626 * Reduces PR with PW
    2727 * Assumes PR != NULL, PW != NULL, Lm(PR) divides Lm(PW)
    28  * 
     28 *
    2929 ***************************************************************/
    3030int ksReducePoly(LObject* PR,
     
    4848  kTest_L(PR);
    4949  kTest_T(PW);
    50  
     50
    5151  poly p1 = PR->GetLmTailRing();
    5252  poly p2 = PW->GetLmTailRing();
     
    5656  p_CheckPolyRing(p2, tailRing);
    5757
    58   pAssume1(p2 != NULL && p1 != NULL && 
     58  pAssume1(p2 != NULL && p1 != NULL &&
    5959           p_DivisibleBy(p2,  p1, tailRing));
    6060
    6161  pAssume1(p_GetComp(p1, tailRing) == p_GetComp(p2, tailRing) ||
    62            (p_GetComp(p2, tailRing) == 0 && 
     62           (p_GetComp(p2, tailRing) == 0 &&
    6363            p_MaxComp(pNext(p2),tailRing) == 0));
    6464
     
    7171
    7272  p_ExpVectorSub(lm, p2, tailRing);
    73  
     73
    7474  if (tailRing != currRing)
    7575  {
     
    9898    int ct = ksCheckCoeff(&an, &bn);
    9999    p_SetCoeff(lm, bn,tailRing);
    100     if ((ct == 0) || (ct == 2)) 
     100    if ((ct == 0) || (ct == 2))
    101101      PR->Tail_Mult_nn(an);
    102102    if (coef != NULL) *coef = an;
     
    107107    if (coef != NULL) *coef = n_Init(1, tailRing);
    108108  }
    109  
    110  
    111   // and finally, 
     109
     110
     111  // and finally,
    112112  PR->Tail_Minus_mm_Mult_qq(lm, t2, PW->GetpLength() - 1, spNoether);
    113113  PR->LmDeleteAndIter();
     
    124124 *
    125125 * Creates S-Poly of p1 and p2
    126  * 
     126 *
    127127 *
    128128 ***************************************************************/
    129 void ksCreateSpoly(LObject* Pair,   poly spNoether, 
    130                    int use_buckets, ring tailRing, 
     129void ksCreateSpoly(LObject* Pair,   poly spNoether,
     130                   int use_buckets, ring tailRing,
    131131                   poly m1, poly m2, TObject** R)
    132132{
     
    139139  poly last;
    140140  Pair->tailRing = tailRing;
    141  
     141
    142142  assume(p1 != NULL);
    143143  assume(p2 != NULL);
     
    149149
    150150  int l1=0, l2=0;
    151  
     151
    152152  if (p_GetComp(p1, currRing)!=p_GetComp(p2, currRing))
    153153  {
     
    168168  if (m1 == NULL)
    169169    k_GetLeadTerms(p1, p2, currRing, m1, m2, tailRing);
    170    
     170
    171171  pSetCoeff0(m1, lc2);
    172172  pSetCoeff0(m2, lc1);  // and now, m1 * LT(p1) == m2 * LT(p2)
     
    177177    l2 = (R[Pair->i_r2])->GetpLength() - 1;
    178178  }
    179  
     179
    180180  // get m2 * a2
    181181  if (spNoether != NULL)
     
    191191  // get m2*a2 - m1*a1
    192192  Pair->Tail_Minus_mm_Mult_qq(m1, a1, l1, spNoether);
    193  
     193
    194194  // Clean-up time
    195195  Pair->LmDeleteAndIter();
    196196  p_LmDelete(m1, tailRing);
    197  
     197
    198198  if (co != 0)
    199199  {
     
    215215  poly Lp =     PR->GetLmCurrRing();
    216216  poly Save =   PW->GetLmCurrRing();
    217  
     217
    218218  kTest_L(PR);
    219219  kTest_T(PW);
    220220  pAssume(pIsMonomOf(Lp, Current));
    221  
     221
    222222  assume(Lp != NULL && Current != NULL && pNext(Current) != NULL);
    223223  assume(PR->bucket == NULL);
     
    228228  pAssume(!pHaveCommonMonoms(Red.p, With.p));
    229229  ret = ksReducePoly(&Red, &With, spNoether, &coef);
    230  
     230
    231231  if (!ret)
    232232  {
     
    245245  }
    246246
    247   if (Lp == Save) 
     247  if (Lp == Save)
    248248    With.Delete();
    249249  return ret;
     
    253253 *
    254254 * Auxillary Routines
    255  * 
    256  * 
     255 *
     256 *
    257257 ***************************************************************/
    258258
     
    464464  }
    465465}
    466 
    467 
    468 
    469 
    470 
    471  
    472  
  • Singular/libparse.h

    re58c4a ra3bc95e  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: libparse.h,v 1.12 2000-04-27 10:07:08 obachman Exp $ */
     6/* $Id: libparse.h,v 1.13 2001-10-09 16:36:07 Singular Exp $ */
    77/*
    88* ABSTRACT: lib parsing
     
    1616procinfo *iiInitSingularProcinfo(procinfov pi, char *libname,
    1717                                 char *procname, int line, long pos,
    18                                 BOOLEAN pstatic = FALSE);
     18                                BOOLEAN pstatic = FALSE);
    1919#ifdef HAVE_NAMESPACES
    2020int yylplex(char *libname, char *libfile, lib_style_types *lib_style,
    2121           idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB);
    2222#else /* HAVE_NAMESPACES */
     23#ifdef HAVE_NS
    2324int yylplex(char *libname, char *libfile, lib_style_types *lib_style,
    24             lp_modes=LOAD_LIB);
     25           idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB);
     26#else
     27int yylplex(char *libname, char *libfile, lib_style_types *lib_style,
     28            lp_modes=LOAD_LIB);
     29#endif /* HAVE_NS */
    2530#endif /* HAVE_NAMESPACES */
    2631
  • Singular/libparse.l

    re58c4a ra3bc95e  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: libparse.l,v 1.47 2001-09-25 16:07:29 Singular Exp $ */
     5/* $Id: libparse.l,v 1.48 2001-10-09 16:36:08 Singular Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    3434#ifdef HAVE_NAMESPACES
    3535void copy_string(lp_modes mode, idhdl pl);
    36 extern void piCleanUp(procinfov pi);
    3736#else /* HAVE_NAMESPACES */
    3837void copy_string(lp_modes mode);
    3938#endif /* HAVE_NAMESPACES */
     39extern void piCleanUp(procinfov pi);
    4040void make_version(char *p, int what);
    4141
     
    119119extern namehdl namespaceroot;
    120120#endif /* HAVE_NAMESPACES */
     121#ifdef HAVE_NS
     122idhdl h_top;
     123#endif
    121124#define pi IDPROC(h0)
    122125extern "C"
     
    180183                           idhdl pl, BOOLEAN autoexport, lp_modes mode)
    181184#else /* HAVE_NAMESPACES */
     185#ifdef HAVE_NS
     186#define YY_DECL int yylex(char *newlib, char *libfile, \
     187                           lib_style_types *lib_style, \
     188                           idhdl pl, BOOLEAN autoexport, lp_modes mode)
     189#else
    182190#define YY_DECL int yylex(char *newlib, char *libfile, \
    183191                           lib_style_types *lib_style, \
    184192                           lp_modes mode)
     193#endif /* HAVE_NS */
    185194#endif /* HAVE_NAMESPACES */
    186195
     
    341350             if( mode == LOAD_LIB)
    342351             {
    343                 #ifdef HAVE_NAMESPACES
    344                 h0 = enterid( omStrDup(proc), 0 /*myynest*/, PROC_CMD,
    345                                   &IDPACKAGE(pl)->idroot, TRUE);
    346                 if(!p_static && autoexport)
    347                 {
    348                    namespaceroot->push( NSPACK(namespaceroot->root) ,"");
    349                    h_top = enterid( omStrDup(proc), myynest, PROC_CMD,
    350                                   &NSROOT(namespaceroot->root), FALSE );
    351                    namespaceroot->pop();
    352                 }
     352               #ifdef HAVE_NAMESPACES
     353               h0 = enterid( omStrDup(proc), 0 /*myynest*/, PROC_CMD,
     354                                 &IDPACKAGE(pl)->idroot, TRUE);
     355               if(!p_static && autoexport)
     356               {
     357                  namespaceroot->push( NSPACK(namespaceroot->root) ,"");
     358                  h_top = enterid( omStrDup(proc), myynest, PROC_CMD,
     359                                 &NSROOT(namespaceroot->root), FALSE );
     360                  namespaceroot->pop();
     361               }
    353362               #else /* HAVE_NAMESPACES */
     363               #ifdef HAVE_NS
     364               h0 = enterid( omStrDup(proc), 0 /*myynest*/, PROC_CMD,
     365                                 &(IDPACKAGE(pl)->idroot), TRUE);
     366               if(!p_static && autoexport)
     367               {
     368                  h_top = enterid( omStrDup(proc), 0 /*myynest*/, PROC_CMD,
     369                                 &(basePack->idroot), FALSE );
     370               }
     371               #else
    354372               h0 = enterid( omStrDup(proc), 0 /*myynest*/, PROC_CMD,
    355373                                   &IDROOT, TRUE );
     374               #endif /* HAVE_NS */
    356375               #endif /* HAVE_NAMESPACES */
    357376               /* omCheckAddr(IDID(h0)); */
     
    368387                 }
    369388                 #endif /* HAVE_NAMESPACES */
     389                 #ifdef HAVE_NS
     390                 if (!p_static && h_top != NULL && autoexport)
     391                 {
     392                   if(IDPROC(h_top)!=NULL) piCleanUp((procinfo *)IDPROC(h_top));
     393                   IDPROC(h_top)=IDPROC(h0);
     394                   IDPROC(h_top)->ref++;
     395                 }
     396                 IDPROC(h0)->pack=IDPACKAGE(pl);
     397                 #endif /* HAVE_NS */
    370398                 if (BVERBOSE(V_LOAD_PROC))
    371399                   Warn( "     proc '%s' registered", proc );
  • Singular/lists.h

    re58c4a ra3bc95e  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: lists.h,v 1.15 2001-08-27 14:47:08 Singular Exp $ */
     6/* $Id: lists.h,v 1.16 2001-10-09 16:36:08 Singular Exp $ */
    77/*
    88* ABSTRACT: handling of the list type
     
    1313#include "tok.h"
    1414
    15 #ifdef MDEBUG 
    16 #define INLINE_THIS 
     15#ifdef MDEBUG
     16#define INLINE_THIS
    1717#else
    1818#define INLINE_THIS inline
  • Singular/misc.cc

    re58c4a ra3bc95e  
    631631#endif
    632632#ifdef HAVE_NAMESPACES
     633              StringAppendS("Namespaces,");
     634#endif
     635#ifdef HAVE_NS
    633636              StringAppendS("namespaces,");
    634637#endif
     
    679682}
    680683
    681 
     684#ifdef HAVE_NS
     685void listall()
     686{
     687      idhdl hh=basePack->idroot;
     688      PrintS("====== Top ==============\n");
     689      while (hh!=NULL)
     690      {
     691        if (IDDATA(hh)==NULL) PrintS("(N)");
     692        else if (IDDATA(hh)==(void *)currRing) PrintS("(R)");
     693        else if (IDDATA(hh)==(void *)currPack) PrintS("(P)");
     694        else PrintS("   ");
     695        Print("::%s, typ %s level %d",
     696               IDID(hh),Tok2Cmdname(IDTYP(hh)),IDLEV(hh));
     697        if ((IDTYP(hh)==RING_CMD)
     698        || (IDTYP(hh)==QRING_CMD))
     699          Print(" ref: %d\n",IDRING(hh)->ref);
     700        else
     701          PrintLn();
     702        hh=IDNEXT(hh);
     703      }
     704      hh=basePack->idroot;
     705      while (hh!=NULL)
     706      {
     707        if (IDDATA(hh)==(void *)basePack)
     708          Print("(T)::%s, typ %s level %d\n",
     709          IDID(hh),Tok2Cmdname(IDTYP(hh)),IDLEV(hh));
     710        else
     711        if ((IDTYP(hh)==RING_CMD)
     712        || (IDTYP(hh)==QRING_CMD)
     713        || (IDTYP(hh)==PACKAGE_CMD))
     714        {
     715          Print("====== %s ==============\n",IDID(hh));
     716          idhdl h2=IDRING(hh)->idroot;
     717          while (h2!=NULL)
     718          {
     719            if (IDDATA(h2)==NULL) PrintS("(N)");
     720            else if (IDDATA(h2)==(void *)currRing) PrintS("(R)");
     721            else if (IDDATA(h2)==(void *)currPack) PrintS("(P)");
     722            else PrintS("   ");
     723            Print("%s::%s, typ %s level %d\n",
     724            IDID(hh),IDID(h2),Tok2Cmdname(IDTYP(h2)),IDLEV(h2));
     725            h2=IDNEXT(h2);
     726          }
     727        }
     728        hh=IDNEXT(hh);
     729      }
     730      Print("currRing:%x, currPack:%x,basePack:%x\n",currRing,currPack,basePack);
     731}
     732void checkall()
     733{
     734      idhdl hh=basePack->idroot;
     735      while (hh!=NULL)
     736      {
     737        omCheckAddr(hh);
     738        omCheckAddr(IDID(hh));
     739        if (RingDependend(IDTYP(hh))) Print("%s typ %d in Top\n",IDID(hh),IDTYP(hh));
     740        hh=IDNEXT(hh);
     741      }
     742      hh=basePack->idroot;
     743      while (hh!=NULL)
     744      {
     745        if (IDTYP(hh)==PACKAGE_CMD)
     746        {
     747          idhdl h2=IDPACKAGE(hh)->idroot;
     748          while (h2!=NULL)
     749          {
     750            omCheckAddr(h2);
     751            omCheckAddr(IDID(h2));
     752            if (RingDependend(IDTYP(h2))) Print("%s typ %d in %s\n",IDID(h2),IDTYP(h2),IDID(hh));
     753            h2=IDNEXT(h2);
     754          }
     755        }
     756        hh=IDNEXT(hh);
     757      }
     758}
     759#endif
  • Singular/mmalloc.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mmalloc.cc,v 1.4 2001-02-01 21:19:54 obachman Exp $ */
     4/* $Id: mmalloc.cc,v 1.5 2001-10-09 16:36:09 Singular Exp $ */
    55/*
    66* ABSTRACT: standard version of C++-memory management alloc func
     
    1212#include <omalloc.h>
    1313
    14 /* We define those, so that our values of 
     14/* We define those, so that our values of
    1515   OM_TRACK and OM_CHECK are used  */
    1616void* operator new ( size_t size )
  • Singular/mmalloc.h

    re58c4a ra3bc95e  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: mmalloc.h,v 1.2 2000-08-14 16:05:43 obachman Exp $ */
     6/* $Id: mmalloc.h,v 1.3 2001-10-09 16:36:09 Singular Exp $ */
    77/*
    88* ABSTRACT: declaration of routines for memory stuff
     
    1616
    1717#ifdef __cplusplus
    18 extern "C" 
     18extern "C"
    1919{
    2020#endif
  • Singular/modulop.h

    re58c4a ra3bc95e  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: modulop.h,v 1.15 2001-01-09 15:40:11 Singular Exp $ */
     6/* $Id: modulop.h,v 1.16 2001-10-09 16:36:09 Singular Exp $ */
    77/*
    88* ABSTRACT: numbers modulo p (<=32003)
     
    5353inline number npMultM(number a, number b)
    5454{
    55   return (number) 
     55  return (number)
    5656    ((((unsigned long) a)*((unsigned long) b)) % ((unsigned long) npPrimeM));
    5757}
  • Singular/mpr_complex.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpr_complex.cc,v 1.31 2001-08-27 14:47:13 Singular Exp $ */
     4/* $Id: mpr_complex.cc,v 1.32 2001-10-09 16:36:10 Singular Exp $ */
    55
    66/*
     
    5050 *  the size of mantissa consists of two parts:
    5151 *    the "output" part a and the "rest" part b.
    52  *  According to the GMP-precision digits is 
     52 *  According to the GMP-precision digits is
    5353 *  recomputed to bits (basis 2).
    5454 *  Two numbers a, b are equal if
     
    8686    *c_in = '0';
    8787    strcpy(&(c_in[1]), in);
    88    
     88
    8989    mpf_set_str( t, c_in, 10 );
    9090    omFreeSize((void*)c_in, len);
     
    233233bool operator >= ( const gmp_float & a, const gmp_float & b )
    234234{
    235   if (a.t == b.t) 
    236     return true; 
     235  if (a.t == b.t)
     236    return true;
    237237  return mpf_cmp( a.t, b.t ) >= 0;
    238238}
    239239bool operator <= ( const gmp_float & a, const gmp_float & b )
    240240{
    241   if (a.t == b.t) 
    242     return true;   
     241  if (a.t == b.t)
     242    return true;
    243243  return mpf_cmp( a.t, b.t ) <= 0;
    244244}
     
    365365  gmp_float r;
    366366
    367   switch (k) 
     367  switch (k)
    368368  {
    369369  case QTOF:
     
    665665      out=(char*)omAlloc( len );
    666666      memset(out,0,len);
    667       if ( !c.real().isZero() ) 
     667      if ( !c.real().isZero() )
    668668        sprintf(out,"(%s%s%s)",in_real,c.imag().sign()>=0?"+I*":"-I*",in_imag);
    669669      else
     
    673673    omFree( (ADDRESS) in_imag );
    674674  }
    675   else 
     675  else
    676676  {
    677677    out= floatToStr( c.real(), oprec );
  • Singular/mpr_complex.h

    re58c4a ra3bc95e  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: mpr_complex.h,v 1.17 2001-08-27 14:47:14 Singular Exp $ */
     6/* $Id: mpr_complex.h,v 1.18 2001-10-09 16:36:10 Singular Exp $ */
    77
    88/*
     
    100100  inline const mpf_t *mpfp() const;
    101101  inline mpf_t *_mpfp();
    102  
     102
    103103  inline operator double();
    104104  inline operator double() const;
     
    177177}
    178178
    179 inline mpf_t *gmp_float::_mpfp() 
     179inline mpf_t *gmp_float::_mpfp()
    180180{
    181181  return &t;
  • Singular/mpr_inout.h

    re58c4a ra3bc95e  
    55****************************************/
    66
    7 /* $Id: mpr_inout.h,v 1.6 1999-12-02 23:03:51 wenk Exp $ */
     7/* $Id: mpr_inout.h,v 1.7 2001-10-09 16:36:10 Singular Exp $ */
    88
    99/*
     
    4949
    5050/**
    51  * COMPUTE: polynomial p with values given by v at points p1,..,pN derived 
     51 * COMPUTE: polynomial p with values given by v at points p1,..,pN derived
    5252 * from p; more precisely: consider p as point in K^n and v as N elements in K,
    5353 * let p1,..,pN be the points in K^n obtained by evaluating all monomials
    54  * of degree 0,1,...,N at p in lexicographical order, then the procedure 
     54 * of degree 0,1,...,N at p in lexicographical order, then the procedure
    5555 * computes the polynomial f satisfying f(pi) = v[i]
    5656 * RETURN:  polynomial f of degree d
  • Singular/mpr_numeric.h

    re58c4a ra3bc95e  
    55****************************************/
    66
    7 /* $Id: mpr_numeric.h,v 1.5 1999-12-02 23:03:52 wenk Exp $ */
     7/* $Id: mpr_numeric.h,v 1.6 2001-10-09 16:36:11 Singular Exp $ */
    88
    99/*
     
    1818
    1919// define polish mode when finding roots
    20 #define PM_NONE    0 
     20#define PM_NONE    0
    2121#define PM_POLISH  1
    2222#define PM_CORRUPT 2
     
    176176{
    177177public:
    178  
     178
    179179  int m;         // number of constraints, make sure m == m1 + m2 + m3 !!
    180180  int n;         // # of independent variables
    181181  int m1,m2,m3;  // constraints <=, >= and ==
    182   int icase;     // == 0: finite solution found; 
     182  int icase;     // == 0: finite solution found;
    183183                 // == +1 objective funtion unbound; == -1: no solution
    184   int *izrov,*iposv;   
     184  int *izrov,*iposv;
    185185
    186186  mprfloat **LiPM; // the matrix (of size [m+2, n+1])
    187187
    188   /** #rows should be >= m+2, #cols >= n+1 
     188  /** #rows should be >= m+2, #cols >= n+1
    189189   */
    190190  simplex( int rows, int cols );
  • Singular/mpsr_Get.cc

    re58c4a ra3bc95e  
    33****************************************/
    44
    5 /* $Id: mpsr_Get.cc,v 1.37 2001-09-25 15:45:43 Singular Exp $ */
     5/* $Id: mpsr_Get.cc,v 1.38 2001-10-09 16:36:11 Singular Exp $ */
    66/***************************************************************
    77 *
     
    173173{
    174174  number n = (number) omAllocBin(rnumber_bin);
    175 #if defined(LDEBUG) 
     175#if defined(LDEBUG)
    176176    n->debug=123456;
    177177#endif
     
    214214    {
    215215      poly p;
    216      
     216
    217217      pos = mpsr_rDefault(0, name, mlv->r);
    218218      mpsr_SetCurrRing(mlv->r, TRUE);
  • Singular/mpsr_sl.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 12/00
    9  *  Version: $Id: mpsr_sl.cc,v 1.3 2001-09-19 09:49:37 Singular Exp $
     9 *  Version: $Id: mpsr_sl.cc,v 1.4 2001-10-09 16:36:11 Singular Exp $
    1010 *******************************************************************/
    1111
     
    404404#ifdef HPUX_9
    405405  signal(SIGCHLD, (void (*)(int))SIG_DFL);
    406 #endif 
     406#endif
    407407  if ((strcmp(l->mode, "launch") == 0 || strcmp(l->mode, "fork") == 0) &&
    408408      (MP_GetLinkStatus((MP_Link_pt)l->data,MP_LinkReadyWriting) == MP_TRUE))
     
    411411#ifdef HPUX_9
    412412  signal(SIGCHLD, (void (*)(int))SIG_IGN);
    413 #endif 
     413#endif
    414414  SI_LINK_SET_CLOSE_P(l);
    415415  return FALSE;
  • Singular/omSingularConfig.h

    re58c4a ra3bc95e  
    11/*******************************************************************
    22 *  File:    omSingularConfig.h
    3  *  Purpose: declaration of External Config stuff for omalloc 
    4  *           This file is inlcuded by omDefaultConfig.h, i.e., at the the time 
    5  *           the omalloc library is built. Any changes to the default config 
    6  *           of omalloc should be done here (and, of course, you need to 
     3 *  Purpose: declaration of External Config stuff for omalloc
     4 *           This file is inlcuded by omDefaultConfig.h, i.e., at the the time
     5 *           the omalloc library is built. Any changes to the default config
     6 *           of omalloc should be done here (and, of course, you need to
    77 *           rebuilt the library).
    88 *  Author:  obachman@mathematik.uni-kl.de (Olaf Bachmann)
    99 *  Created: 8/00
    10  *  Version: $Id: omSingularConfig.h,v 1.3 2000-12-18 15:44:42 obachman Exp $
     10 *  Version: $Id: omSingularConfig.h,v 1.4 2001-10-09 16:36:12 Singular Exp $
    1111 *******************************************************************/
    1212#ifndef OM_SINGULAR_CONFIG_H
     
    1414
    1515#ifdef __cplusplus
    16 extern "C" 
     16extern "C"
    1717{
    1818#endif
    19  
     19
    2020#include <stdlib.h>
    2121#include <stdio.h>
     
    3535
    3636/* number of bytes for difference to report: every 1 MByte */
    37 #define SING_REPORT_THRESHOLD 1000*1024 
     37#define SING_REPORT_THRESHOLD 1000*1024
    3838#define OM_SINGULAR_HOOK                                                        \
    3939do                                                                              \
  • Singular/pInline1.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pInline1.cc,v 1.3 2000-10-30 13:40:21 obachman Exp $
     9 *  Version: $Id: pInline1.cc,v 1.4 2001-10-09 16:36:12 Singular Exp $
    1010 *******************************************************************/
    1111#ifndef PINLINE1_CC
     
    2222
    2323#undef NO_INLINE1
    24 #define NO_INLINE1 
     24#define NO_INLINE1
    2525
    2626#endif // PDEBUG
  • Singular/pShallowCopyDelete.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pShallowCopyDelete.cc,v 1.3 2000-10-26 16:31:37 obachman Exp $
     9 *  Version: $Id: pShallowCopyDelete.cc,v 1.4 2001-10-09 16:36:12 Singular Exp $
    1010 *******************************************************************/
    1111#include "mod2.h"
     
    2727  int N = d_r->N;
    2828  int i;
    29  
     29
    3030
    3131  while (s_p != NULL)
     
    3333    d_p->next = p_Init(d_r, d_bin);
    3434    pIter(d_p);
    35    
     35
    3636    pSetCoeff0(d_p, pGetCoeff(s_p));
    3737    for (i=1; i<= N; i++)
     
    4141      p_SetComp(d_p, p_GetComp(s_p, s_r), d_r);
    4242    p_Setm(d_p, d_r);
    43    
     43
    4444    s_p = p_LmFreeAndNext(s_p, s_r);
    4545  }
     
    5353  return pShallowCopyDelete_General;
    5454}
    55 
    56 
    57  
    58  
    59  
  • Singular/pShallowCopyDelete.h

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pShallowCopyDelete.h,v 1.1 2000-10-23 16:32:27 obachman Exp $
     9 *  Version: $Id: pShallowCopyDelete.h,v 1.2 2001-10-09 16:36:12 Singular Exp $
    1010 *******************************************************************/
    1111
    1212// returns a poly from dest_r which is a ShallowCopy of s_p from source_r
    13 typedef poly (*pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r, 
     13typedef poly (*pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r,
    1414                                       omBin dest_bin);
    1515pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring source_r, ring dest_r);
  • Singular/p_Add_q__T.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Add_q__T.cc,v 1.2 2001-08-27 14:47:21 Singular Exp $
     9 *  Version: $Id: p_Add_q__T.cc,v 1.3 2001-10-09 16:36:13 Singular Exp $
    1010 *******************************************************************/
    1111
    1212/***************************************************************
    1313 *
    14  * Returns:  p + q, 
     14 * Returns:  p + q,
    1515 *           Shorter, where Shorter == Length(p) + Length(q) - Length(p+q);
    1616 * Destroys: p, q
    17  * 
     17 *
    1818 ***************************************************************/
    1919LINKAGE poly p_Add_q(poly p, poly q, int &Shorter, const ring r)
     
    2424  int l = pLength(p) + pLength(q);
    2525#endif
    26  
     26
    2727  // test for trivial cases
    2828  Shorter = 0;
    2929  if (q == NULL) return p;
    3030  if (p == NULL) return q;
    31  
     31
    3232  number t, n1, n2;
    3333  int shorter = 0;
     
    4747  n_Delete(&n2, r);
    4848  q = p_LmFreeAndNext(q, r);
    49  
     49
    5050  if (n_IsZero(t, r))
    5151  {
     
    6464  if (q==NULL) { pNext(a) = p; goto Finish;}
    6565  goto Top;
    66      
     66
    6767  Greater:
    6868  a = pNext(a) = p;
     
    7070  if (p==NULL) { pNext(a) = q; goto Finish;}
    7171  goto Top;
    72    
     72
    7373  Smaller:
    7474  a = pNext(a) = q;
     
    7676  if (q==NULL) { pNext(a) = p; goto Finish;}
    7777  goto Top;
    78  
     78
    7979
    8080  Finish:
     
    8484#if PDEBUG > 0
    8585  pAssume1(l - pLength(pNext(&rp)) == Shorter);
    86 #endif 
     86#endif
    8787  return pNext(&rp);
    8888}
  • Singular/p_Copy__T.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Copy__T.cc,v 1.2 2001-08-27 14:47:22 Singular Exp $
     9 *  Version: $Id: p_Copy__T.cc,v 1.3 2001-10-09 16:36:13 Singular Exp $
    1010 *******************************************************************/
    1111
     
    1818  omBin bin = r->PolyBin;
    1919  poly h;
    20  
     20
    2121  DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
    2222
  • Singular/p_Delete__T.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Delete__T.cc,v 1.2 2001-08-27 14:47:23 Singular Exp $
     9 *  Version: $Id: p_Delete__T.cc,v 1.3 2001-10-09 16:36:13 Singular Exp $
    1010 *******************************************************************/
    1111
     
    1313{
    1414  poly p = *pp;
    15  
     15
    1616  while (p != NULL)
    1717  {
  • Singular/p_MemCmp.h

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_MemCmp.h,v 1.2 2000-12-31 15:14:37 obachman Exp $
     9 *  Version: $Id: p_MemCmp.h,v 1.3 2001-10-09 16:36:13 Singular Exp $
    1010 *******************************************************************/
    1111#ifndef P_MEM_CMP_H
     
    1313
    1414/***************************************************************
    15  * 
     15 *
    1616 *  auxiallary macros
    17  * 
     17 *
    1818 *******************************************************************/
    1919#define _p_MemCmp_Declare(s1, s2)                   \
     
    6363}                                                                   \
    6464while (0)
    65  
    66 /***************************************************************
    67  * 
     65
     66/***************************************************************
     67 *
    6868 *  Pomog
    69  * 
     69 *
    7070 *******************************************************************/
    7171#define p_MemCmp_LengthOne_OrdPomog(s1, s2, length, ordsgn, actionE, actionG, actionS) \
     
    144144
    145145/***************************************************************
    146  * 
     146 *
    147147 *  Nomog
    148  * 
     148 *
    149149 *******************************************************************/
    150150#define p_MemCmp_LengthOne_OrdNomog(s1, s2, length, ordsgn, actionE, actionG, actionS)     \
     
    168168
    169169/***************************************************************
    170  * 
     170 *
    171171 *  PomogZero
    172  * 
     172 *
    173173 *******************************************************************/
    174174#define p_MemCmp_LengthTwo_OrdPomogZero(s1, s2, length, ordsgn, actionE, actionG, actionS)     \
     
    190190
    191191/***************************************************************
    192  * 
     192 *
    193193 *  NomogZero
    194  * 
     194 *
    195195 *******************************************************************/
    196196#define p_MemCmp_LengthTwo_OrdNomogZero(s1, s2, length, ordsgn, actionE, actionG, actionS)     \
     
    212212
    213213/***************************************************************
    214  * 
     214 *
    215215 *  NegPomog
    216  * 
     216 *
    217217 *******************************************************************/
    218218#define p_MemCmp_LengthTwo_OrdNegPomog(s1, s2, length, ordsgn, actionE, actionG, actionS)  \
     
    250250
    251251/***************************************************************
    252  * 
     252 *
    253253 *  PomogNeg
    254  * 
     254 *
    255255 *******************************************************************/
    256256#define p_MemCmp_LengthTwo_OrdPomogNeg(s1, s2, length, ordsgn, actionE, actionG, actionS)  \
     
    288288
    289289/***************************************************************
    290  * 
     290 *
    291291 *  PosNomog
    292  * 
     292 *
    293293 *******************************************************************/
    294294#define p_MemCmp_LengthThree_OrdPosNomog(s1, s2, length, ordsgn, actionE, actionG, actionS)    \
     
    306306#define p_MemCmp_LengthGeneral_OrdPosNomog(s1, s2, length, ordsgn, actionE, actionG, actionS)  \
    307307  p_MemCmp_LengthGeneral_OrdNegPomog(s1, s2, length, ordsgn, actionE, actionS, actionG)
    308  
    309 /***************************************************************
    310  * 
     308
     309/***************************************************************
     310 *
    311311 *  NomogPos
    312  * 
     312 *
    313313 *******************************************************************/
    314314#define p_MemCmp_LengthThree_OrdNomogPos(s1, s2, length, ordsgn, actionE, actionG, actionS)    \
     
    329329
    330330/***************************************************************
    331  * 
     331 *
    332332 *  PomogNegZero
    333  * 
     333 *
    334334 *******************************************************************/
    335335#define p_MemCmp_LengthThree_OrdPomogNegZero(s1, s2, length, ordsgn, actionE, actionG, actionS)   \
     
    349349
    350350/***************************************************************
    351  * 
     351 *
    352352 *  NegPomogZero
    353  * 
     353 *
    354354 *******************************************************************/
    355355#define p_MemCmp_LengthThree_OrdNegPomogZero(s1, s2, length, ordsgn, actionE, actionG, actionS)   \
     
    369369
    370370/***************************************************************
    371  * 
     371 *
    372372 *  NomogPosZero
    373  * 
     373 *
    374374 *******************************************************************/
    375375#define p_MemCmp_LengthFour_OrdNomogPosZero(s1, s2, length, ordsgn, actionE, actionG, actionS)    \
     
    387387
    388388/***************************************************************
    389  * 
     389 *
    390390 *  PosNomogZero
    391  * 
     391 *
    392392 *******************************************************************/
    393393#define p_MemCmp_LengthFour_OrdPosNomogZero(s1, s2, length, ordsgn, actionE, actionG, actionS)    \
     
    405405
    406406/***************************************************************
    407  * 
    408  * PosPosNomog 
    409  * 
     407 *
     408 * PosPosNomog
     409 *
    410410 *******************************************************************/
    411411#define p_MemCmp_LengthThree_OrdPosPosNomog(s1, s2, length, ordsgn, actionE, actionG, actionS)             \
     
    446446
    447447/***************************************************************
    448  * 
    449  * NegPosNomog 
    450  * 
     448 *
     449 * NegPosNomog
     450 *
    451451 *******************************************************************/
    452452#define p_MemCmp_LengthThree_OrdNegPosNomog(s1, s2, length, ordsgn, actionE, actionG, actionS)             \
     
    488488
    489489/***************************************************************
    490  * 
    491  * PosNomogPos 
    492  * 
     490 *
     491 * PosNomogPos
     492 *
    493493 *******************************************************************/
    494494#define p_MemCmp_LengthThree_OrdPosNomogPos(s1, s2, length, ordsgn, actionE, actionG, actionS)             \
     
    530530
    531531/***************************************************************
    532  * 
     532 *
    533533 *  PosPosNomogZero
    534  * 
     534 *
    535535 *******************************************************************/
    536536#define p_MemCmp_LengthFour_OrdPosPosNomogZero(s1, s2, length, ordsgn, actionE, actionG, actionS)    \
     
    548548
    549549/***************************************************************
    550  * 
     550 *
    551551 *  PosNomogPosZero
    552  * 
     552 *
    553553 *******************************************************************/
    554554#define p_MemCmp_LengthFour_OrdPosNomogPosZero(s1, s2, length, ordsgn, actionE, actionG, actionS)    \
     
    566566
    567567/***************************************************************
    568  * 
     568 *
    569569 *  NegPosNomogZero
    570  * 
     570 *
    571571 *******************************************************************/
    572572#define p_MemCmp_LengthFour_OrdNegPosNomogZero(s1, s2, length, ordsgn, actionE, actionG, actionS)    \
     
    585585
    586586/***************************************************************
    587  * 
     587 *
    588588 *  OrdGeneral
    589  * 
     589 *
    590590 *******************************************************************/
    591591#define _p_MemCmp_OrdGeneral_Declare(s1, s2)    \
     
    608608  actionG;                                                      \
    609609}                                                               \
    610 while (0)                         
     610while (0)
    611611
    612612#define _p_MemCmp_OrdGeneral(i, actionE)         \
     
    618618  if (_v1 == _v2) actionE;                      \
    619619}                                               \
    620 while(0)                         
     620while(0)
    621621
    622622#define _p_MemCmp_LengthTwo_OrdGeneral(actionE)          \
     
    714714
    715715/***************************************************************
    716  * 
     716 *
    717717 *  Last but not least LengthGeneral_OrdGeneral
    718  * 
     718 *
    719719 *******************************************************************/
    720720#define p_MemCmp_LengthGeneral_OrdGeneral(s1, s2, length, ordsgn, actionE, actionG, actionS)    \
     
    766766
    767767/***************************************************************
    768  * 
     768 *
    769769 *  Bitmask
    770  * 
     770 *
    771771 *******************************************************************/
    772772#define _p_MemCmp_Bitmask_Declare(s1, s2, bitmask)  \
     
    813813}                                                                           \
    814814while (0)
    815  
     815
    816816#define _p_MemCmp_Bitmask_LengthTwo(actionS)    \
    817817  do                                            \
  • Singular/p_Merge_q__T.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Merge_q__T.cc,v 1.2 2001-08-27 14:47:24 Singular Exp $
     9 *  Version: $Id: p_Merge_q__T.cc,v 1.3 2001-10-09 16:36:14 Singular Exp $
    1010 *******************************************************************/
    1111
     
    1414 * Returns:  p merged with q
    1515 * Destroys: p, q
    16  * 
     16 *
    1717 ***************************************************************/
    1818LINKAGE poly p_Merge_q(poly p, poly q, const ring r)
     
    2424  int l = pLength(p) + pLength(q);
    2525#endif
    26  
     26
    2727  spolyrec rp;
    2828  poly a = &rp;
     
    3737  dReportError("Equal monomials in p_Merge_q");
    3838  return NULL;
    39  
     39
    4040  Greater:
    4141  a = pNext(a) = p;
     
    4343  if (p==NULL) { pNext(a) = q; goto Finish;}
    4444  goto Top;
    45    
     45
    4646  Smaller:
    4747  a = pNext(a) = q;
     
    4949  if (q==NULL) { pNext(a) = p; goto Finish;}
    5050  goto Top;
    51  
     51
    5252  Finish:
    5353
     
    5555#if PDEBUG > 0
    5656  pAssume1(l - pLength(pNext(&rp)) == 0);
    57 #endif 
     57#endif
    5858  return pNext(&rp);
    5959}
  • Singular/p_Minus_mm_Mult_qq__T.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Minus_mm_Mult_qq__T.cc,v 1.2 2001-08-27 14:47:25 Singular Exp $
     9 *  Version: $Id: p_Minus_mm_Mult_qq__T.cc,v 1.3 2001-10-09 16:36:14 Singular Exp $
    1010 *******************************************************************/
    1111
     
    1616 * Destroys: p
    1717 * Const:    m, q
    18  * 
     18 *
    1919 ***************************************************************/
    2020LINKAGE poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, int& Shorter, const poly spNoether, const ring r, poly &last)
     
    3131  // we are done if q == NULL || m == NULL
    3232  if (q == NULL || m == NULL) return p;
    33  
     33
    3434  spolyrec rp;
    3535  poly a = &rp,                    // collects the result
     
    5050  const unsigned long* m_e = m->exp;
    5151  omBin bin = r->PolyBin;
    52  
     52
    5353  if (p == NULL) goto Finish;           // return tneg*q if (p == NULL)
    54  
     54
    5555  pAssume(p_GetComp(q, r) == 0 || p_GetComp(m, r) == 0);
    5656
     
    6060  p_MemSum(qm->exp, q->exp, m_e, length);
    6161  p_MemAddAdjust(qm, r);
    62  
    63   CmpTop:     
     62
     63  CmpTop:
    6464  // compare qm = m*q and p w.r.t. monomial ordering
    6565  p_MemCmp(qm->exp, p->exp, length, ordsgn, goto Equal, goto Greater, goto Smaller );
    66  
     66
    6767  Equal:   // qm equals p
    6868  tb = n_Mult(pGetCoeff(q), tm, r);
     
    7878  }
    7979  else
    80   { // coeffs are equal, so their difference is 0: 
     80  { // coeffs are equal, so their difference is 0:
    8181    shorter += 2;
    8282    n_Delete(&tc, r);
     
    8888  // no, so update qm
    8989  goto SumTop;
    90  
     90
    9191
    9292  Greater:
     
    9797  {
    9898    qm = NULL;
    99     goto Finish; 
     99    goto Finish;
    100100  }
    101   // construct new qm 
     101  // construct new qm
    102102  goto AllocTop;
    103    
    104   Smaller:     
     103
     104  Smaller:
    105105  a = pNext(a) = p;// append p to result and advance p
    106106  pIter(p);
    107107  if (p == NULL) goto Finish;
    108108  goto CmpTop;
    109  
     109
    110110
    111111  Finish: // q or p is NULL: Clean-up time
     
    129129    pSetCoeff0(m, tm);
    130130  }
    131    
     131
    132132  n_Delete(&tneg, r);
    133133  if (qm != NULL) p_FreeBinAddr(qm, r);
     
    135135  p_Test(pNext(&rp), r);
    136136  return pNext(&rp);
    137 } 
     137}
  • Singular/p_Mult_mm__T.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Mult_mm__T.cc,v 1.2 2001-08-27 14:47:25 Singular Exp $
     9 *  Version: $Id: p_Mult_mm__T.cc,v 1.3 2001-10-09 16:36:15 Singular Exp $
    1010 *******************************************************************/
    1111
     
    1414 *   Returns:  p*m
    1515 *   Const:    m
    16  *   Destroys: p 
     16 *   Destroys: p
    1717 *
    1818 ***************************************************************/
  • Singular/p_Mult_nn__T.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Mult_nn__T.cc,v 1.2 2001-08-27 14:47:26 Singular Exp $
     9 *  Version: $Id: p_Mult_nn__T.cc,v 1.3 2001-10-09 16:36:15 Singular Exp $
    1010 *******************************************************************/
    1111
     
    2121  pAssume(!n_IsZero(n,r));
    2222  p_Test(p, r);
    23  
     23
    2424  poly q = p;
    2525  while (p != NULL)
  • Singular/p_Mult_q.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Mult_q.cc,v 1.7 2000-12-31 15:14:38 obachman Exp $
     9 *  Version: $Id: p_Mult_q.cc,v 1.8 2001-10-09 16:36:15 Singular Exp $
    1010 *******************************************************************/
    1111#include "mod2.h"
     
    1313/***************************************************************
    1414 *
    15  * Returns:  p * q, 
     15 * Returns:  p * q,
    1616 * Destroys: if !copy then p, q
    1717 * Assumes: pLength(p) >= 2 pLength(q) >=2
     
    2727{
    2828  int l = 0;
    29  
     29
    3030  do
    3131  {
     
    6262}
    6363
    64      
    65 static poly _p_Mult_q_Bucket(poly p, const int lp, 
    66                              poly q, const int lq, 
     64
     65static poly _p_Mult_q_Bucket(poly p, const int lp,
     66                             poly q, const int lq,
    6767                             const int copy, const ring r)
    6868{
     
    8080  poly rn = pNext(res);             // pNext(rr)
    8181  number n, n1;
    82  
     82
    8383  kBucket_pt bucket = kBucketCreate(r);
    84  
     84
    8585  // initialize bucket
    8686  kBucketInit(bucket, pNext(rn), lp - 2);
     
    9191  if (rn == NULL) goto Smaller;
    9292  p_LmCmpAction(rn, qn, r, goto Equal, goto Greater, goto Smaller);
    93  
     93
    9494  Greater:
    9595  // rn > qn, so iter
     
    9898  pIter(rn);
    9999  goto Top;
    100  
     100
    101101  // rn < qn, append qn to rr, and compute next Lm(qq)*pp
    102102  Smaller:
     
    117117    pNext(rr) = kBucketExtractLm(bucket);
    118118  }
    119  
     119
    120120  pIter(qq);
    121121  if (qq == NULL) goto Finish;
    122122  rn = pNext(rr);
    123123  goto Top;
    124  
     124
    125125  Equal:
    126126  n1 = pGetCoeff(rn);
     
    141141  qn = p_LmFreeAndNext(qn, r);
    142142  goto Work;
    143  
     143
    144144  Finish:
    145145  assume(rr != NULL && pNext(rr) != NULL);
    146146  pNext(pNext(rr)) = kBucketClear(bucket);
    147147  kBucketDestroy(&bucket);
    148  
     148
    149149  if (!copy)
    150150  {
     
    171171  poly rn = pNext(res);             // pNext(rr)
    172172  number n, n1;
    173  
     173
    174174  // now the main loop
    175175  Top:
    176176  if (rn == NULL) goto Smaller;
    177177  p_LmCmpAction(rn, qn, r, goto Equal, goto Greater, goto Smaller);
    178  
     178
    179179  Greater:
    180180  // rn > qn, so iter
     
    182182  pIter(rn);
    183183  goto Top;
    184  
     184
    185185  // rn < qn, append qn to rr, and compute next Lm(qq)*pp
    186186  Smaller:
     
    195195    pNext(rr) = p_Plus_mm_Mult_qq(rn, qq, pp, r);
    196196  }
    197  
     197
    198198  pIter(qq);
    199199  if (qq == NULL) goto Finish;
    200200  rn = pNext(rr);
    201201  goto Top;
    202  
     202
    203203  Equal:
    204204  n1 = pGetCoeff(rn);
     
    219219  qn = p_LmFreeAndNext(qn, r);
    220220  goto Work;
    221  
     221
    222222  Finish:
    223223  if (!copy)
     
    235235  int lp, lq, l;
    236236  poly pt;
    237  
     237
    238238  pqLength(p, q, lp, lq, MIN_LENGTH_BUCKET);
    239  
     239
    240240  if (lp < lq)
    241241  {
  • Singular/p_Mult_q.h

    re58c4a ra3bc95e  
    44/***************************************************************
    55 *  File:    p_Mult_q.h
    6  *  Purpose: declaration of some auxillary routines for 
     6 *  Purpose: declaration of some auxillary routines for
    77 *           p_Mult_q
    88 *  Author:  obachman (Olaf Bachmann)
    99 *  Created: 8/00
    10  *  Version: $Id: p_Mult_q.h,v 1.1 2000-12-31 15:14:39 obachman Exp $
     10 *  Version: $Id: p_Mult_q.h,v 1.2 2001-10-09 16:36:15 Singular Exp $
    1111 *******************************************************************/
    1212#include "mod2.h"
  • Singular/p_Procs.h

    re58c4a ra3bc95e  
    88 *  Author:  obachman (Olaf Bachmann)
    99 *  Created: 8/00
    10  *  Version: $Id: p_Procs.h,v 1.13 2001-08-27 14:47:28 Singular Exp $
     10 *  Version: $Id: p_Procs.h,v 1.14 2001-10-09 16:36:16 Singular Exp $
    1111 *******************************************************************/
    1212#ifndef P_PROCS_H
     
    2121typedef poly (*pp_Mult_nn_Proc_Ptr)(poly p, const number n, const ring r);
    2222typedef poly (*p_Mult_mm_Proc_Ptr)(poly p, const poly m, const ring r);
    23 typedef poly (*pp_Mult_mm_Proc_Ptr)(poly p, const poly m, 
    24                                     const ring r, 
     23typedef poly (*pp_Mult_mm_Proc_Ptr)(poly p, const poly m,
     24                                    const ring r,
    2525                                    poly &last);
    26 typedef poly (*pp_Mult_mm_Noether_Proc_Ptr)(poly p, const poly m, 
     26typedef poly (*pp_Mult_mm_Noether_Proc_Ptr)(poly p, const poly m,
    2727                                            const poly spNoether, int &ll,
    2828                                            const ring r, poly &last);
    2929typedef poly (*p_Add_q_Proc_Ptr)(poly p, poly q, int & shorter, const ring r);
    30 typedef poly (*p_Minus_mm_Mult_qq_Proc_Ptr)(poly p, poly m, poly q, 
     30typedef poly (*p_Minus_mm_Mult_qq_Proc_Ptr)(poly p, poly m, poly q,
    3131                                            int &shorter, const poly spNoether,
    3232                                            const ring r, poly &last);
     
    5959} pProcs_s;
    6060
    61  
     61
    6262void p_ProcsSet(ring r, p_Procs_s* p_Procs);
    6363#ifdef RDEBUG
    64 void p_Debug_GetSpecNames(const ring r, char* &field, char* &length, 
     64void p_Debug_GetSpecNames(const ring r, char* &field, char* &length,
    6565                          char* &ord);
    6666void p_Debug_GetProcNames(const ring r, p_Procs_s* p_Procs);
  • Singular/p_Procs_Dynamic.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 12/00
    9  *  Version: $Id: p_Procs_Dynamic.cc,v 1.4 2001-01-30 12:19:24 Singular Exp $
     9 *  Version: $Id: p_Procs_Dynamic.cc,v 1.5 2001-10-09 16:36:16 Singular Exp $
    1010 *******************************************************************/
    1111#include "mod2.h"
     
    5858{
    5959  const char* module =  p_ProcField_2_Module(proc, field);
    60  
    61   if (strcmp(module, "FieldIndep") == 0) 
     60
     61  if (strcmp(module, "FieldIndep") == 0)
    6262    return p_ProcInitHandle(&p_procs_handle_FieldIndep, module);
    63   else if (strcmp(module, "FieldZp") == 0) 
     63  else if (strcmp(module, "FieldZp") == 0)
    6464    return p_ProcInitHandle(&p_procs_handle_FieldZp, module);
    65   else if (strcmp(module, "FieldQ") == 0) 
     65  else if (strcmp(module, "FieldQ") == 0)
    6666    return p_ProcInitHandle(&p_procs_handle_FieldQ, module);
    67   else if (strcmp(module, "FieldGeneral") == 0) 
     67  else if (strcmp(module, "FieldGeneral") == 0)
    6868    return p_ProcInitHandle(&p_procs_handle_FieldGeneral, module);
    6969  else
     
    7474}
    7575
    76  
     76
    7777#define InitSetProcs(f, l, o) ((void)0)
    7878
     
    8181  switch(proc)
    8282  {
    83       case p_Copy_Proc: 
     83      case p_Copy_Proc:
    8484        return (void *)p_Copy__FieldGeneral_LengthGeneral_OrdGeneral;
    85       case p_Delete_Proc: 
     85      case p_Delete_Proc:
    8686        return (void *)p_Delete__FieldGeneral_LengthGeneral_OrdGeneral;
    87       case p_ShallowCopyDelete_Proc: 
     87      case p_ShallowCopyDelete_Proc:
    8888        return (void *)p_ShallowCopyDelete__FieldGeneral_LengthGeneral_OrdGeneral;
    89       case p_Mult_nn_Proc: 
     89      case p_Mult_nn_Proc:
    9090        return (void *)p_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral;
    91       case pp_Mult_nn_Proc: 
     91      case pp_Mult_nn_Proc:
    9292        return (void *)pp_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral;
    93       case pp_Mult_mm_Proc: 
     93      case pp_Mult_mm_Proc:
    9494        return (void *)pp_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral;
    95       case pp_Mult_mm_Noether_Proc: 
     95      case pp_Mult_mm_Noether_Proc:
    9696        return (void *)pp_Mult_mm_Noether__FieldGeneral_LengthGeneral_OrdGeneral;
    97       case p_Mult_mm_Proc: 
     97      case p_Mult_mm_Proc:
    9898        return (void *)p_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral;
    99       case p_Add_q_Proc: 
     99      case p_Add_q_Proc:
    100100        return (void *)p_Add_q__FieldGeneral_LengthGeneral_OrdGeneral;
    101       case p_Minus_mm_Mult_qq_Proc: 
     101      case p_Minus_mm_Mult_qq_Proc:
    102102        return (void *)p_Minus_mm_Mult_qq__FieldGeneral_LengthGeneral_OrdGeneral;
    103       case p_Neg_Proc: 
     103      case p_Neg_Proc:
    104104        return (void *)p_Neg__FieldGeneral_LengthGeneral_OrdGeneral;
    105       case pp_Mult_Coeff_mm_DivSelect_Proc: 
     105      case pp_Mult_Coeff_mm_DivSelect_Proc:
    106106        return (void *)pp_Mult_Coeff_mm_DivSelect__FieldGeneral_LengthGeneral_OrdGeneral;
    107       case pp_Mult_Coeff_mm_DivSelectMult_Proc: 
     107      case pp_Mult_Coeff_mm_DivSelectMult_Proc:
    108108        return (void *)pp_Mult_Coeff_mm_DivSelectMult__FieldGeneral_LengthGeneral_OrdGeneral;
    109       case p_Merge_q_Proc: 
     109      case p_Merge_q_Proc:
    110110        return (void *)p_Merge_q__FieldGeneral_LengthGeneral_OrdGeneral;
    111       case p_kBucketSetLm_Proc: 
     111      case p_kBucketSetLm_Proc:
    112112        return (void *)p_kBucketSetLm__FieldGeneral_LengthGeneral_OrdGeneral;
    113113      case p_Unknown_Proc:
     
    125125  switch(proc)
    126126  {
    127       case p_Copy_Proc: 
     127      case p_Copy_Proc:
    128128        return "p_Copy__FieldGeneral_LengthGeneral_OrdGeneral";
    129       case p_Delete_Proc: 
     129      case p_Delete_Proc:
    130130        return "p_Delete__FieldGeneral_LengthGeneral_OrdGeneral";
    131       case p_ShallowCopyDelete_Proc: 
     131      case p_ShallowCopyDelete_Proc:
    132132        return "p_ShallowCopyDelete__FieldGeneral_LengthGeneral_OrdGeneral";
    133       case p_Mult_nn_Proc: 
     133      case p_Mult_nn_Proc:
    134134        return "p_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral";
    135       case pp_Mult_nn_Proc: 
     135      case pp_Mult_nn_Proc:
    136136        return "pp_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral";
    137       case pp_Mult_mm_Proc: 
     137      case pp_Mult_mm_Proc:
    138138        return "pp_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral";
    139       case pp_Mult_mm_Noether_Proc: 
     139      case pp_Mult_mm_Noether_Proc:
    140140        return "pp_Mult_mm_Noether__FieldGeneral_LengthGeneral_OrdGeneral";
    141       case p_Mult_mm_Proc: 
     141      case p_Mult_mm_Proc:
    142142        return "p_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral";
    143       case p_Add_q_Proc: 
     143      case p_Add_q_Proc:
    144144        return "p_Add_q__FieldGeneral_LengthGeneral_OrdGeneral";
    145       case p_Minus_mm_Mult_qq_Proc: 
     145      case p_Minus_mm_Mult_qq_Proc:
    146146        return "p_Minus_mm_Mult_qq__FieldGeneral_LengthGeneral_OrdGeneral";
    147       case p_Neg_Proc: 
     147      case p_Neg_Proc:
    148148        return "p_Neg__FieldGeneral_LengthGeneral_OrdGeneral";
    149       case pp_Mult_Coeff_mm_DivSelect_Proc: 
     149      case pp_Mult_Coeff_mm_DivSelect_Proc:
    150150        return "pp_Mult_Coeff_mm_DivSelect__FieldGeneral_LengthGeneral_OrdGeneral";
    151       case pp_Mult_Coeff_mm_DivSelectMult_Proc: 
     151      case pp_Mult_Coeff_mm_DivSelectMult_Proc:
    152152        return "pp_Mult_Coeff_mm_DivSelectMult__FieldGeneral_LengthGeneral_OrdGeneral";
    153       case p_Merge_q_Proc: 
     153      case p_Merge_q_Proc:
    154154        return "p_Merge_q__FieldGeneral_LengthGeneral_OrdGeneral";
    155       case p_kBucketSetLm_Proc: 
     155      case p_kBucketSetLm_Proc:
    156156        return "p_kBucketSetLm__FieldGeneral_LengthGeneral_OrdGeneral";
    157157      case p_Unknown_Proc:
     
    163163
    164164
    165 static void* GetDynamicProc(const char* proc_s, p_Proc proc, 
     165static void* GetDynamicProc(const char* proc_s, p_Proc proc,
    166166                            p_Field field, p_Length length, p_Ord ord
    167167#ifdef RDEBUG
     
    172172  void* proc_ptr = NULL;
    173173  char proc_name[MAX_PROCNAME_LEN];
    174   sprintf(proc_name, "%s__%s_%s_%s", proc_s, 
    175           p_FieldEnum_2_String(field), 
    176           p_LengthEnum_2_String(length), 
     174  sprintf(proc_name, "%s__%s_%s_%s", proc_s,
     175          p_FieldEnum_2_String(field),
     176          p_LengthEnum_2_String(length),
    177177          p_OrdEnum_2_String(ord));
    178178  // first, try to get the proc from the kernel
     
    187187#ifdef RDEBUG
    188188      sprintf(proc_name, GetGeneralProcName(proc));
    189 #endif     
     189#endif
    190190    }
    191191  }
     
    200200  return  proc_ptr;
    201201}
    202  
     202
    203203
    204204#define DoReallySetProc(what, field, length, ord)           \
     
    221221#endif
    222222
    223      
     223
    224224#include "p_Procs_Set.h"
    225225
  • Singular/p_Procs_Impl.h

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 12/00
    9  *  Version: $Id: p_Procs_Impl.h,v 1.5 2000-12-31 15:54:46 obachman Exp $
     9 *  Version: $Id: p_Procs_Impl.h,v 1.6 2001-10-09 16:36:16 Singular Exp $
    1010 *******************************************************************/
    1111#ifndef P_PROCS_IMPL_H
     
    1313
    1414/***************************************************************
    15  * 
     15 *
    1616 * Configurations
    17  * 
     17 *
    1818 *******************************************************************/
    1919
    2020/***************************************************************
    2121 Here is how it works:
    22  At run-time, SetProcs is used to choose the appropriate PolyProcs 
     22 At run-time, SetProcs is used to choose the appropriate PolyProcs
    2323              based on the ring properies.
    24  At generate-time, SetProcs is used to generate all 
     24 At generate-time, SetProcs is used to generate all
    2525              possible PolyProcs.
    26  Which PolyProcs are generated/used can be controled by values of 
     26 Which PolyProcs are generated/used can be controled by values of
    2727 HAVE_FAST_P_PROCS, HAVE_FAST_LENGTH, HAVE_FAST_ORD, and FAST_FIELD
    28  
     28
    2929 At generate-time, the file p_Procs.inc is generated,
    3030 which provides implementations of the p_Procs, based on
     
    3232 macros.
    3333
    34  At run-time, a fast proc is set/choosen if found/generated, else 
     34 At run-time, a fast proc is set/choosen if found/generated, else
    3535 a general proc is set/choosen.
    3636 *******************************************************************/
     
    5252//   2 -- plus special cases for FieldQ
    5353//   nothing else is implemented, yet
    54 #ifndef HAVE_FAST_FIELD 
     54#ifndef HAVE_FAST_FIELD
    5555#define HAVE_FAST_FIELD 0
    5656#endif
     
    6262//   3 -- special cases for length <= 4
    6363//   4 -- special cases for length <= 8
    64 #ifndef HAVE_FAST_LENGTH 
     64#ifndef HAVE_FAST_LENGTH
    6565#define HAVE_FAST_LENGTH 0
    6666#endif
     
    7272//  3  -- special ords for with n_min <= 3
    7373//  4  -- special for all ords
    74 #ifndef HAVE_FAST_ORD 
     74#ifndef HAVE_FAST_ORD
    7575#define HAVE_FAST_ORD 0
    7676#endif
    7777
    7878// Define HAVE_FAST_ZERO_ORD to:
    79 //  0 -- no zero ords are considered 
     79//  0 -- no zero ords are considered
    8080//  1 -- only ZeroOrds for OrdPosNomogPosZero, OrdNomogPosZero, OrdPomogNegZero
    8181//  2 -- ZeroOrds for all
    82 #ifndef HAVE_FAST_ZERO_ORD 
     82#ifndef HAVE_FAST_ZERO_ORD
    8383#define HAVE_FAST_ZERO_ORD 0
    8484#endif
     
    9494
    9595/***************************************************************
    96  * 
     96 *
    9797 * Definitions of our fields, lengths, ords, procs we work with
    98  * 
     98 *
    9999 *******************************************************************/
    100100
     
    106106{
    107107  FieldGeneral = 0,
    108   FieldZp,         
     108  FieldZp,
    109109  FieldQ,
    110110  FieldR,
     
    121121{
    122122  LengthGeneral = 0, // n >= 1
    123   LengthEight,       // n == 8   
     123  LengthEight,       // n == 8
    124124  LengthSeven,
    125125  LengthSix,
     
    131131  LengthUnknown
    132132};
    133 typedef enum p_Ord 
    134 {                   
    135   OrdGeneral = 0,   
    136                     //     ordsgn   
     133typedef enum p_Ord
     134{
     135  OrdGeneral = 0,
     136                    //     ordsgn
    137137                    //  0   1   i   n-1 n   n_min   Example
    138138  OrdPomog,         //  +   +   +   +   +   1       (lp,C)
     
    199199  {
    200200      case FieldGeneral: return "FieldGeneral";
    201       case FieldZp: return "FieldZp";         
     201      case FieldZp: return "FieldZp";
    202202      case FieldQ: return "FieldQ";
    203203      case FieldR: return "FieldR";
     
    218218  switch(length)
    219219  {
    220       case LengthGeneral: return "LengthGeneral"; 
    221       case LengthEight: return "LengthEight";       
     220      case LengthGeneral: return "LengthGeneral";
     221      case LengthEight: return "LengthEight";
    222222      case LengthSeven: return "LengthSeven";
    223223      case LengthSix: return "LengthSix";
     
    236236  switch(ord)
    237237  {
    238       case OrdGeneral: return "OrdGeneral";   
    239       case OrdPomog: return "OrdPomog";         
    240       case OrdNomog: return "OrdNomog";         
    241       case OrdNegPomog: return "OrdNegPomog";     
    242       case OrdPomogNeg: return "OrdPomogNeg";     
    243       case OrdPosNomog: return "OrdPosNomog";     
    244       case OrdNomogPos: return "OrdNomogPos";     
    245       case OrdPosPosNomog: return "OrdPosPosNomog";   
    246       case OrdPosNomogPos: return "OrdPosNomogPos";   
    247       case OrdNegPosNomog: return "OrdNegPosNomog";   
     238      case OrdGeneral: return "OrdGeneral";
     239      case OrdPomog: return "OrdPomog";
     240      case OrdNomog: return "OrdNomog";
     241      case OrdNegPomog: return "OrdNegPomog";
     242      case OrdPomogNeg: return "OrdPomogNeg";
     243      case OrdPosNomog: return "OrdPosNomog";
     244      case OrdNomogPos: return "OrdNomogPos";
     245      case OrdPosPosNomog: return "OrdPosPosNomog";
     246      case OrdPosNomogPos: return "OrdPosNomogPos";
     247      case OrdNegPosNomog: return "OrdNegPosNomog";
    248248#ifdef HAVE_LENGTH_DIFF
    249       case OrdNegPomogZero: return "OrdNegPomogZero"; 
    250       case OrdPomogNegZero: return "OrdPomogNegZero"; 
    251       case OrdPomogZero: return "OrdPomogZero";     
    252       case OrdNomogZero: return "OrdNomogZero";     
    253       case OrdNomogPosZero: return "OrdNomogPosZero"; 
    254       case OrdPosNomogZero: return "OrdPosNomogZero"; 
     249      case OrdNegPomogZero: return "OrdNegPomogZero";
     250      case OrdPomogNegZero: return "OrdPomogNegZero";
     251      case OrdPomogZero: return "OrdPomogZero";
     252      case OrdNomogZero: return "OrdNomogZero";
     253      case OrdNomogPosZero: return "OrdNomogPosZero";
     254      case OrdPosNomogZero: return "OrdPosNomogZero";
    255255      case OrdPosPosNomogZero: return "OrdPosPosNomogZero";
    256256      case OrdPosNomogPosZero: return "OrdPosNomogPosZero";
     
    304304      case p_Merge_q_Proc:
    305305        return 1;
    306        
     306
    307307      default:
    308308        return 0;
     
    318318      case p_Neg_Proc:
    319319        return 0;
    320        
     320
    321321      default:
    322322        return 1;
    323323  }
    324324}
    325  
     325
    326326// returns string specifying the module into which the p_Proc
    327327// should go
     
    338338
    339339/***************************************************************
    340  * 
    341  * 
     340 *
     341 *
    342342 * Deal with OrdZero
    343  * 
     343 *
    344344 *******************************************************************/
    345345#ifdef HAVE_LENGTH_DIFF
     
    365365        case OrdPosPosNomogZero:    return OrdPosPosNomog;
    366366        case OrdNegPosNomogZero:    return OrdNegPosNomog;
    367         default:   
     367        default:
    368368          if (strict) return OrdGeneral;
    369369          else if (ord == OrdPomogNegZero) return OrdPomogNeg;
     
    384384
    385385/***************************************************************
    386  * 
    387  * Filters which are applied to field/length/ord, before a proc is 
     386 *
     387 * Filters which are applied to field/length/ord, before a proc is
    388388 * choosen
    389  * 
     389 *
    390390 *******************************************************************/
    391391#ifdef p_Procs_Static
    392 static inline void StaticKernelFilter(p_Field &field, p_Length &length, 
     392static inline void StaticKernelFilter(p_Field &field, p_Length &length,
    393393                                      p_Ord &ord, const p_Proc proc)
    394394{
     
    407407{
    408408  if (HAVE_FAST_P_PROCS >= 5) return;
    409  
     409
    410410  if (HAVE_FAST_P_PROCS < 3 && field == FieldQ)
    411411    field = FieldGeneral;
    412  
     412
    413413  if ((HAVE_FAST_P_PROCS == 0) ||
    414414      (HAVE_FAST_P_PROCS <= 4 && field != FieldZp && field != FieldQ &&
     
    420420    return;
    421421  }
    422   if (HAVE_FAST_P_PROCS == 1 || 
     422  if (HAVE_FAST_P_PROCS == 1 ||
    423423      (HAVE_FAST_P_PROCS == 4 && field != FieldZp && proc != p_Merge_q_Proc))
    424424    ord = OrdGeneral;
     
    427427static inline void FastFieldFilter(p_Field &field)
    428428{
    429   if (HAVE_FAST_FIELD <= 0 || 
     429  if (HAVE_FAST_FIELD <= 0 ||
    430430      (HAVE_FAST_FIELD == 1 && field != FieldZp) ||
    431431      (field != FieldZp && field != FieldQ))
    432432    field = FieldGeneral;
    433433}
    434      
     434
    435435static inline void FastLengthFilter(p_Length &length)
    436436{
     
    457457  if (IsZeroOrd(ord))
    458458  {
    459     if ((HAVE_FAST_ZERO_ORD == 1 && (ord != OrdPosNomogPosZero && 
    460                                      ord != OrdNomogPosZero && 
     459    if ((HAVE_FAST_ZERO_ORD == 1 && (ord != OrdPosNomogPosZero &&
     460                                     ord != OrdNomogPosZero &&
    461461                                     ord != OrdPomogNegZero)) ||
    462462        (HAVE_FAST_ZERO_ORD <= 0))
     
    484484}
    485485
    486 static inline void pp_Mult_mm_Noether_Filter(p_Field &field, 
     486static inline void pp_Mult_mm_Noether_Filter(p_Field &field,
    487487                                             p_Length &length, p_Ord &ord)
    488488{
    489   if (ord == OrdPomog 
     489  if (ord == OrdPomog
    490490      || ord == OrdPomogZero
    491       || (ord == OrdPomogNeg && length > LengthTwo) 
     491      || (ord == OrdPomogNeg && length > LengthTwo)
    492492#ifdef HAVE_LENGTH_DIFF
    493493      || (ord == OrdPomogZero)
     
    502502  }
    503503}
    504      
    505 static inline void FastProcFilter(p_Proc proc, p_Field &field, 
     504
     505static inline void FastProcFilter(p_Proc proc, p_Field &field,
    506506                                  p_Length &length, p_Ord &ord)
    507507{
     
    512512        p_Add_q__Filter(length, ord);
    513513        break;
    514        
     514
    515515      case p_Copy_Proc:
    516516      case p_Delete_Proc:
    517517        NCopy__Filter(field);
    518518        break;
    519        
     519
    520520      case pp_Mult_mm_Noether_Proc:
    521521        pp_Mult_mm_Noether_Filter(field, length, ord);
     
    531531          }
    532532          break;
    533          
     533
    534534      default: break;
    535535  }
     
    554554      ord > ORD_MAX_N_3)       //  i.e. OrdNomogPosZero and below
    555555    return 0;
    556  
     556
    557557  if (length >= LengthTwo &&    // i.e. 1 or 2
    558558      ord > ORD_MAX_N_2)        // i.e. PosNomog and below
    559559    return 0;
    560560
    561   if (length == LengthOne && 
     561  if (length == LengthOne &&
    562562      ord > ORD_MAX_N_1)           // i.e. PosPomogZero and below
    563563    return 0;
     
    569569}
    570570
    571  
     571
    572572static inline int index(p_Length length, p_Ord ord)
    573573{
     
    593593      case p_Neg_Proc:
    594594        return field;
    595        
     595
    596596      case p_ShallowCopyDelete_Proc:
    597597        return length;
    598        
     598
    599599      case p_Copy_Proc:
    600600      case pp_Mult_mm_Proc:
     
    610610      case p_kBucketSetLm_Proc:
    611611        return index(field, length, ord);
    612        
     612
    613613      case p_Merge_q_Proc:
    614614        return index(length, ord);
    615        
     615
    616616      default:
    617617        assume(0);
     
    623623
    624624/***************************************************************
    625  * 
    626  * Macros for setting procs -- these are used for 
     625 *
     626 * Macros for setting procs -- these are used for
    627627 * generation and setting
    628628 *
     
    639639}                                                           \
    640640while (0)                                                   \
    641  
     641
    642642#define SetProcs(field, length, ord)                                    \
    643643do                                                                      \
  • Singular/p_Procs_Static.h

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 12/00
    9  *  Version: $Id: p_Procs_Static.h,v 1.3 2000-12-20 17:18:53 obachman Exp $
     9 *  Version: $Id: p_Procs_Static.h,v 1.4 2001-10-09 16:36:16 Singular Exp $
    1010 *******************************************************************/
    1111
     
    4646
    4747// Set HAVE_FAST_ZERO_ORD to:
    48 //  0 -- no zero ords are considered 
     48//  0 -- no zero ords are considered
    4949//  1 -- only ZeroOrds for OrdPosNomogPosZero, OrdNomogPosZero, OrdPomogNegZero
    5050//  2 -- ZeroOrds for all
  • Singular/p_ShallowCopyDelete__T.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_ShallowCopyDelete__T.cc,v 1.2 2001-08-27 14:47:29 Singular Exp $
     9 *  Version: $Id: p_ShallowCopyDelete__T.cc,v 1.3 2001-10-09 16:36:17 Singular Exp $
    1010 *******************************************************************/
    1111
     
    1313 *
    1414 * Destroys: p
    15  * Assumes:  Monoms of p are from 
    16  * Returns: 
     15 * Assumes:  Monoms of p are from
     16 * Returns:
    1717 ***************************************************************/
    1818LINKAGE poly p_ShallowCopyDelete(poly s_p, const ring r, omBin d_bin)
     
    2222  unsigned long* s_e;
    2323  poly h;
    24  
     24
    2525  DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
    2626
  • Singular/p_polys.h

    re58c4a ra3bc95e  
    44/***************************************************************
    55 *  File:    p_Polys.h
    6  *  Purpose: declaration of poly stuf which are independent of 
     6 *  Purpose: declaration of poly stuf which are independent of
    77 *           currRing
    88 *  Author:  obachman (Olaf Bachmann)
    99 *  Created: 9/00
    10  *  Version: $Id: p_polys.h,v 1.19 2000-12-31 15:14:40 obachman Exp $
     10 *  Version: $Id: p_polys.h,v 1.20 2001-10-09 16:36:17 Singular Exp $
    1111 *******************************************************************/
    1212#ifndef P_POLYS_H
     
    2424          - debugging only if PDEBUG >= 2
    2525          - normally inlined, unless PDEBUG >= 2 || NO_INLINE2
    26  Level 1: operations on monomials with time proportional to length 
     26 Level 1: operations on monomials with time proportional to length
    2727          - implemented in: pInline1.h
    2828          - debugging only if PDEBUG >= 1
    29           - normally inlined, unless PDEBUG >= 1 || NO_INLINE1 
     29          - normally inlined, unless PDEBUG >= 1 || NO_INLINE1
    3030 Level 0: short operations on polynomials with time proportional to
    3131          length of poly
     
    3535            #define DO_PINLINE0
    3636            #include "pInline0.h"
    37  Misc   : operations on polynomials which do not fit in any of the 
     37 Misc   : operations on polynomials which do not fit in any of the
    3838          above categories
    3939          - implemented in: polys*.cc
     
    6666PINLINE2 number p_SetCoeff(poly p, number n, ring r);
    6767
    68 // get Order 
     68// get Order
    6969PINLINE2 Order_t p_GetOrder(poly p, ring r);
    7070// don't use this
     
    9292/***************************************************************
    9393 *
    94  * Allocation/Initalization/Deletion 
     94 * Allocation/Initalization/Deletion
    9595 * except for pDeleteLm and pHead, all polys must be != NULL
    9696 *
     
    158158PINLINE2 int p_Cmp(poly p1, poly p2, ring r);
    159159
    160  
    161 /***************************************************************
    162  *
    163  * Divisiblity tests, args must be != NULL, except for 
     160
     161/***************************************************************
     162 *
     163 * Divisiblity tests, args must be != NULL, except for
    164164 * pDivisbleBy
    165165 *
     
    169169PINLINE1 BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, ring r);
    170170unsigned long p_GetShortExpVector(poly a, ring r);
    171 PINLINE1 BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, 
     171PINLINE1 BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a,
    172172                                      poly b, unsigned long not_sev_b, ring r);
    173173
     
    183183 ***************************************************************/
    184184// test if the monomial is a constant as a vector component
    185 // i.e., test if all exponents are zero 
     185// i.e., test if all exponents are zero
    186186PINLINE1 BOOLEAN p_LmIsConstantComp(const poly p, const ring r);
    187187PINLINE1 BOOLEAN p_LmIsConstant(const poly p, const ring r);
     
    282282// like p_Minus_mm_Mult_qq, except that if lp == pLength(lp) lq == pLength(lq)
    283283// then lp == pLength(p -m*q)
    284 PINLINE2 poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq, 
     284PINLINE2 poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq,
    285285                                 poly spNoether, const ring r);
    286286// returns p + m*q destroys p, const: q, m
     
    288288
    289289// returns p + m*q destroys p, const: q, m
    290 PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq, 
     290PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq,
    291291                                const ring r);
    292292
     
    402402// check if Lm(p) is from ring r
    403403BOOLEAN p_LmCheckIsFromRing(poly p, ring r);
    404 // check if Lm(p) != NULL, r != NULL and initialized && Lm(p) is from r 
     404// check if Lm(p) != NULL, r != NULL and initialized && Lm(p) is from r
    405405BOOLEAN p_LmCheckPolyRing(poly p, ring r);
    406406// check if all monoms of p are from ring r
  • Singular/pcv.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: pcv.cc,v 1.32 2001-02-13 13:10:38 Singular Exp $ */
     4/* $Id: pcv.cc,v 1.33 2001-10-09 16:36:17 Singular Exp $ */
    55/*
    66* ABSTRACT: conversion between polys and coef vectors
     
    154154    {
    155155      res->rtyp=INT_CMD;
    156       res->data=(void*)pcvMinDeg((matrix)h->Data());     
     156      res->data=(void*)pcvMinDeg((matrix)h->Data());
    157157      return FALSE;
    158158    }
  • Singular/polys.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys.cc,v 1.77 2001-09-25 16:07:31 Singular Exp $ */
     4/* $Id: polys.cc,v 1.78 2001-10-09 16:36:18 Singular Exp $ */
    55
    66/*
     
    7171  pFDeg = new_FDeg;
    7272  currRing->pFDeg = new_FDeg;
    73  
     73
    7474  if (new_lDeg == NULL)
    7575    new_lDeg = currRing->pLDegOrig;
     
    8080
    8181
    82 // restores pFDeg and pLDeg: 
     82// restores pFDeg and pLDeg:
    8383extern void pRestoreDegProcs(pFDegProc old_FDeg, pLDegProc old_lDeg)
    8484{
  • Singular/pp_Mult_Coeff_mm_DivSelectMult__T.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pp_Mult_Coeff_mm_DivSelectMult__T.cc,v 1.2 2001-08-27 14:47:33 Singular Exp $
     9 *  Version: $Id: pp_Mult_Coeff_mm_DivSelectMult__T.cc,v 1.3 2001-10-09 16:36:18 Singular Exp $
    1010 *******************************************************************/
    1111
     
    1414 *   Returns:  p*Coeff(m)*a/b for such monomials pm of p, for which
    1515 *             m is divisble by pm, shorter == #of monomials left out
    16  *   Assumes:  m, a, b are monomials, ordering is (c, dp), 
     16 *   Assumes:  m, a, b are monomials, ordering is (c, dp),
    1717 *            (p*a) is divisble by b for all monimials in question
    1818 *   Const:    p, m, a, b
     
    4040  unsigned long* ab_e = &(ab->exp[0]);
    4141
    42   p_MemDiff(ab_e, ((unsigned long*) &(a->exp[0])), ((unsigned long*) &(b->exp[0])), 
     42  p_MemDiff(ab_e, ((unsigned long*) &(a->exp[0])), ((unsigned long*) &(b->exp[0])),
    4343            length);
    44  
     44
    4545  int Shorter = 0;
    4646  poly q = &rp;
     
    5050    p_MemCmp_Bitmask_2(m_e, &(p->exp[2]), bitmask, length_2,
    5151                       goto Divisible, goto NotDivisible);
    52    
     52
    5353    NotDivisible:
    5454    pAssume(!p_LmDivisibleByNoComp(m, p, r));
    5555    Shorter++;
    5656    goto Iter;
    57    
     57
    5858    Divisible:
    5959    pAssume(p_LmDivisibleByNoComp(m, p, r));
  • Singular/pp_Mult_Coeff_mm_DivSelect__T.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pp_Mult_Coeff_mm_DivSelect__T.cc,v 1.2 2001-08-27 14:47:34 Singular Exp $
     9 *  Version: $Id: pp_Mult_Coeff_mm_DivSelect__T.cc,v 1.3 2001-10-09 16:36:19 Singular Exp $
    1010 *******************************************************************/
    1111
     
    1717 *
    1818 ***************************************************************/
    19 LINKAGE poly pp_Mult_Coeff_mm_DivSelect(poly p, const poly m, int &shorter, 
     19LINKAGE poly pp_Mult_Coeff_mm_DivSelect(poly p, const poly m, int &shorter,
    2020                                        const ring r)
    2121{
  • Singular/pp_Mult_mm_Noether__T.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pp_Mult_mm_Noether__T.cc,v 1.2 2001-08-27 14:47:35 Singular Exp $
     9 *  Version: $Id: pp_Mult_mm_Noether__T.cc,v 1.3 2001-10-09 16:36:19 Singular Exp $
    1010 *******************************************************************/
    1111
     
    2323  p_LmTest(m, ri);
    2424  assume(spNoether != NULL);
    25   if (p == NULL) 
     25  if (p == NULL)
    2626  {
    2727    ll = 0;
     
    4040  pAssume1(p_GetComp(m, ri) == 0 || p_MaxComp(p, ri) == 0);
    4141  int l = 0;
    42  
     42
    4343  do
    4444  {
     
    4848
    4949    p_MemCmp(r->exp, spNoether_exp, length, ordsgn, goto Continue, goto Continue, goto Break);
    50    
     50
    5151    Break:
    5252    p_FreeBinAddr(r, ri);
     
    6464  else
    6565    ll = pLength(p);
    66  
    67   if (q != &rp) 
     66
     67  if (q != &rp)
    6868    last = q;
    6969  pNext(q) = NULL;
  • Singular/pp_Mult_mm__T.cc

    re58c4a ra3bc95e  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pp_Mult_mm__T.cc,v 1.2 2001-08-27 14:47:35 Singular Exp $
     9 *  Version: $Id: pp_Mult_mm__T.cc,v 1.3 2001-10-09 16:36:19 Singular Exp $
    1010 *******************************************************************/
    1111
     
    2020  p_Test(p, ri);
    2121  p_LmTest(m, ri);
    22   if (p == NULL) 
     22  if (p == NULL)
    2323  {
    2424    last = NULL;
  • Singular/prCopy.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: prCopy.cc,v 1.11 2000-12-31 15:14:43 obachman Exp $ */
     4/* $Id: prCopy.cc,v 1.12 2001-10-09 16:36:19 Singular Exp $ */
    55/*
    66* ABSTRACT - implementation of functions for Copy/Move/Delete for Polys
     
    1616#include "sbuckets.h"
    1717
    18 static inline void 
     18static inline void
    1919prCopyEvector(poly dest, ring dest_r, poly src, ring src_r,int max)
    2020{
     
    4141{
    4242  poly res;
    43  
     43
    4444  if (rField_has_simple_Alloc(currRing))
    4545    res = pr_Copy_REqual_NSimple_NoSort(p, currRing, currRing);
     
    9292  else
    9393    res =  pr_Move_NoREqual_NoNSimple_NoSort(p, src_r, currRing);
    94   pTest(res); 
    95   return res;
    96 }
    97  
     94  pTest(res);
     95  return res;
     96}
     97
    9898/////////////////////////////////////////////////////////////////////////
    9999// prHead
     
    114114{
    115115  prCopyProc_t prproc;
    116   if (rField_has_simple_Alloc(currRing)) 
     116  if (rField_has_simple_Alloc(currRing))
    117117    prproc = pr_Copy_NoREqual_NSimple_NoSort;
    118118  else
    119     prproc = pr_Copy_NoREqual_NoNSimple_NoSort; 
    120  
     119    prproc = pr_Copy_NoREqual_NoNSimple_NoSort;
     120
    121121  return prHeadR(p, src_r, prproc);
    122122}
     
    124124/////////////////////////////////////////////////////////////////////////
    125125// idrCopy
    126 static inline ideal 
     126static inline ideal
    127127idrCopy(ideal id, ring src_r, ring dest_r, prCopyProc_t prproc)
    128128{
     
    131131  ideal res = idInit(IDELEMS(id), id->rank);
    132132  int i;
    133  
     133
    134134  for (i=IDELEMS(id)-1; i>=0; i--)
    135135  {
     
    145145  ideal res;
    146146  prCopyProc_t prproc;
    147   if (rField_has_simple_Alloc(currRing)) 
     147  if (rField_has_simple_Alloc(currRing))
    148148    prproc = pr_Copy_REqual_NSimple_NoSort;
    149149  else
     
    157157  ideal res;
    158158  prCopyProc_t prproc;
    159   if (rField_has_simple_Alloc(currRing)) 
     159  if (rField_has_simple_Alloc(currRing))
    160160    prproc = pr_Copy_NoREqual_NSimple_Sort;
    161161  else
     
    164164  return res;
    165165}
    166  
     166
    167167ideal idrCopyR_NoSort(ideal id, ring src_r)
    168168{
    169169  ideal res;
    170170  prCopyProc_t prproc;
    171   if (rField_has_simple_Alloc(currRing)) 
     171  if (rField_has_simple_Alloc(currRing))
    172172    prproc = pr_Copy_NoREqual_NSimple_NoSort;
    173173  else
     
    176176  return res;
    177177}
    178  
     178
    179179/////////////////////////////////////////////////////////////////////////
    180180// idrMove
    181 static inline ideal 
     181static inline ideal
    182182idrMove(ideal &id, ring src_r, ring dest_r, prCopyProc_t prproc)
    183183{
    184184  if (id == NULL) return NULL;
    185185  ideal res = id;
    186  
     186
    187187  int i;
    188188  for (i=IDELEMS(id)-1; i>=0; i--)
     
    196196  prCopyProc_t prproc;
    197197  ideal res;
    198  
    199   if (rField_has_simple_Alloc(currRing)) 
     198
     199  if (rField_has_simple_Alloc(currRing))
    200200    prproc = pr_Move_NoREqual_NSimple_Sort;
    201201  else
     
    204204  return res;
    205205}
    206  
     206
    207207ideal idrMoveR_NoSort(ideal &id, ring src_r)
    208208{
    209209  prCopyProc_t prproc;
    210210  ideal res;
    211  
    212   if (rField_has_simple_Alloc(currRing)) 
     211
     212  if (rField_has_simple_Alloc(currRing))
    213213    prproc = pr_Move_NoREqual_NSimple_NoSort;
    214214  else
  • Singular/prCopyMacros.h

    re58c4a ra3bc95e  
    3232#undef PR_NDELETE
    3333#undef PR_NUMBER_SIMPLE_NAME
    34 #if PR_NUMBER_SIMPLE > 0 
     34#if PR_NUMBER_SIMPLE > 0
    3535#define PR_NCOPY(n, r) n
    3636#define PR_NDELETE(n, r) ((void)0)
  • Singular/prCopyTemplate.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: prCopyTemplate.cc,v 1.5 2000-12-07 15:42:30 obachman Exp $ */
     4/* $Id: prCopyTemplate.cc,v 1.6 2001-10-09 16:36:20 Singular Exp $ */
    55/*
    66* ABSTRACT - templates for pr routines
     
    88
    99
    10 static poly PR_NAME 
     10static poly PR_NAME
    1111(poly &src, ring r_src, ring r_dest)
    1212{
     
    1414  poly dest = &dest_s;
    1515  poly tmp;
    16   PR_INIT_EVECTOR_COPY(r_src, r_dest); 
     16  PR_INIT_EVECTOR_COPY(r_src, r_dest);
    1717
    1818  while (src != NULL)
     
    3232  return dest;
    3333}
    34 
    35    
  • Singular/ring.h

    re58c4a ra3bc95e  
    77* ABSTRACT - the interpreter related ring operations
    88*/
    9 /* $Id: ring.h,v 1.66 2001-05-22 13:20:00 Singular Exp $ */
     9/* $Id: ring.h,v 1.67 2001-10-09 16:36:20 Singular Exp $ */
    1010
    1111/* includes */
     
    235235rOrderType_t    rGetOrderType(ring r);
    236236/* returns TRUE if var(i) belongs to p-block */
    237 BOOLEAN rIsPolyVar(int i, ring r = currRing); 
     237BOOLEAN rIsPolyVar(int i, ring r = currRing);
    238238
    239239inline BOOLEAN rOrd_is_Comp_dp(ring r)
    240240{
    241241  return ((r->order[0] == ringorder_c || r->order[0] == ringorder_C) &&
    242           r->order[1] == ringorder_dp && 
     242          r->order[1] == ringorder_dp &&
    243243          r->order[2] == 0);
    244244}
  • Singular/run.h

    re58c4a ra3bc95e  
    2323#ifdef B19
    2424#define CYGWIN_ATTACH_HANDLE_TO_FD(a)      cygwin32_attach_handle_to_fd      a
    25 #define CYGWIN_CONV_TO_FULL_POSIX_PATH(a)  cygwin32_conv_to_full_posix_path  a 
     25#define CYGWIN_CONV_TO_FULL_POSIX_PATH(a)  cygwin32_conv_to_full_posix_path  a
    2626#define CYGWIN_CONV_TO_FULL_WIN32_PATH(a)  cygwin32_conv_to_full_win32_path  a
    2727#define CYGWIN_CONV_TO_POSIX_PATH(a)       cygwin32_conv_to_posix_path       a
     
    3939#else
    4040#define CYGWIN_ATTACH_HANDLE_TO_FD(a)      cygwin_attach_handle_to_fd      a
    41 #define CYGWIN_CONV_TO_FULL_POSIX_PATH(a)  cygwin_conv_to_full_posix_path  a 
     41#define CYGWIN_CONV_TO_FULL_POSIX_PATH(a)  cygwin_conv_to_full_posix_path  a
    4242#define CYGWIN_CONV_TO_FULL_WIN32_PATH(a)  cygwin_conv_to_full_win32_path  a
    4343#define CYGWIN_CONV_TO_POSIX_PATH(a)       cygwin_conv_to_posix_path       a
     
    9191int fileExists(char* fullname, const char* path, const char* name);
    9292int endsWith(const char* s1, const char* s2);
    93 int fileExistsMulti(char* fullname, const char* path, 
     93int fileExistsMulti(char* fullname, const char* path,
    9494                    const char* name_noext, const char* exts[],
    9595                    const int extcnt);
  • Singular/sbuckets.cc

    re58c4a ra3bc95e  
    44/***************************************************************
    55 *  File:    sbuckets.cc
    6  *  Purpose: implementation of routines for sorting polys using 
     6 *  Purpose: implementation of routines for sorting polys using
    77 *           a bucket sort
    88 *  Author:  obachman (Olaf Bachmann)
    99 *  Created: 9/00
    10  *  Version: $Id: sbuckets.cc,v 1.1 2000-12-31 15:17:47 obachman Exp $
     10 *  Version: $Id: sbuckets.cc,v 1.2 2001-10-09 16:36:21 Singular Exp $
    1111 *******************************************************************/
    1212#include "sbuckets.h"
     
    5656  }
    5757  while (1);
    58  
     58
    5959  return j;
    6060}
    61  
     61
    6262//////////////////////////////////////////////////////////////////////////
    6363// Creation/Destruction of buckets
     
    9696    assume(LOG2(length) == i);
    9797  }
    98  
     98
    9999  bucket->buckets[i].p = p;
    100100  bucket->buckets[i].length = length;
    101101  if (i > bucket->max_bucket) bucket->max_bucket = i;
    102102}
    103  
     103
    104104void sBucket_Merge_p(sBucket_pt bucket, poly p, int length)
    105105{
    106106  assume(bucket != NULL);
    107107  assume(length <= 0 || length == pLength(p));
    108  
     108
    109109  if (p == NULL) return;
    110110  if (length <= 0) length = pLength(p);
    111  
     111
    112112  int i = LOG2(length);
    113  
     113
    114114  while (bucket->buckets[i].p != NULL)
    115115  {
     
    121121    assume(LOG2(length) == i);
    122122  }
    123  
     123
    124124  bucket->buckets[i].p = p;
    125125  bucket->buckets[i].length = length;
     
    131131  assume(bucket != NULL);
    132132  assume(length <= 0 || length == pLength(p));
    133  
     133
    134134  if (p == NULL) return;
    135135  if (length <= 0) length = pLength(p);
    136  
     136
    137137  int i = LOG2(length);
    138  
     138
    139139  while (bucket->buckets[i].p != NULL)
    140140  {
    141     p = p_Add_q(p, bucket->buckets[i].p, length, bucket->buckets[i].length, 
     141    p = p_Add_q(p, bucket->buckets[i].p, length, bucket->buckets[i].length,
    142142                bucket->bucket_ring);
    143143    bucket->buckets[i].p = NULL;
     
    145145    i = LOG2(length);
    146146  }
    147  
     147
    148148  bucket->buckets[i].p = p;
    149149  bucket->buckets[i].length = length;
     
    158158  int  lr = 0;
    159159  int i = 0;
    160  
     160
    161161  while (bucket->buckets[i].p == NULL)
    162162  {
     
    170170  bucket->buckets[i].length = 0;
    171171  i++;
    172  
     172
    173173  while (i <= bucket->max_bucket)
    174174  {
     
    182182    i++;
    183183  }
    184  
     184
    185185  done:
    186186  *p = pr;
     
    196196  int  lr = 0;
    197197  int i = 0;
    198  
     198
    199199  while (bucket->buckets[i].p == NULL)
    200200  {
     
    208208  bucket->buckets[i].length = 0;
    209209  i++;
    210  
     210
    211211  while (i <= bucket->max_bucket)
    212212  {
    213213    if (bucket->buckets[i].p != NULL)
    214214    {
    215       pr = p_Add_q(pr, bucket->buckets[i].p, lr, bucket->buckets[i].length, 
     215      pr = p_Add_q(pr, bucket->buckets[i].p, lr, bucket->buckets[i].length,
    216216                   bucket->bucket_ring);
    217217      bucket->buckets[i].p = NULL;
     
    220220    i++;
    221221  }
    222  
     222
    223223  done:
    224224  *p = pr;
     
    236236  int l_in = pLength(p);
    237237#endif
    238  
     238
    239239  if (p == NULL || pNext(p) == NULL) return p;
    240  
     240
    241241  sBucket_pt bucket = sBucketCreate(r);
    242242  poly pn = pNext(p);
    243  
     243
    244244  do
    245245  {
     
    251251  }
    252252  while (1);
    253  
     253
    254254  int l_dummy;
    255255  sBucketClearMerge(bucket, &pn, &l_dummy);
     
    273273  int l_in = pLength(p);
    274274#endif
    275  
     275
    276276  if (p == NULL || pNext(p) == NULL) return p;
    277  
     277
    278278  sBucket_pt bucket = sBucketCreate(r);
    279279  poly pn = pNext(p);
    280  
     280
    281281  do
    282282  {
     
    288288  }
    289289  while (1);
    290  
     290
    291291  int l_dummy;
    292292  sBucketClearAdd(bucket, &pn, &l_dummy);
     
    300300  return pn;
    301301}
    302 
    303 
    304 
    305  
    306  
    307 
  • Singular/sbuckets.h

    re58c4a ra3bc95e  
    44/***************************************************************
    55 *  File:    sbuckets.h
    6  *  Purpose: declaration of routines for sorting and adding up polys using 
     6 *  Purpose: declaration of routines for sorting and adding up polys using
    77 *           a bucket sort
    88 *  Note:    If you need to extract the leading momonial of a bucket,
     
    1010 *  Author:  obachman (Olaf Bachmann)
    1111 *  Created: 9/00
    12  *  Version: $Id: sbuckets.h,v 1.1 2000-12-31 15:17:47 obachman Exp $
     12 *  Version: $Id: sbuckets.h,v 1.2 2001-10-09 16:36:21 Singular Exp $
    1313 *******************************************************************/
    1414#ifndef S_BUCKETS_H
  • Singular/scanner.l

    re58c4a ra3bc95e  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: scanner.l,v 1.29 2000-09-18 09:19:32 obachman Exp $ */
     5/* $Id: scanner.l,v 1.30 2001-10-09 16:36:21 Singular Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    4747#undef malloc
    4848#define malloc my_malloc
    49 #undef realloc 
     49#undef realloc
    5050#define realloc my_realloc
    5151#undef free
  • Singular/silink.cc

    re58c4a ra3bc95e  
    22*  Computer Algebra System SINGULAR     *
    33***************************