Changeset 512a2b in git


Ignore:
Timestamp:
Sep 18, 2000, 11:19:39 AM (23 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
d1655e92ca71fb37d1b57af88efdff5b65b8988b
Parents:
f3398d316400fe1ee1677fc397cacb80566ac664
Message:
p_polys.h


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

Legend:

Unmodified
Added
Removed
  • Singular/Makefile.in

    rf3398d r512a2b  
    122122        longalg.h mpsr_Tok.h structs.h intvec.h longrat.h \
    123123        numbers.h stype.h clapconv.h ipconv.h maps.h page.h \
    124         subexpr.h clapsing.h ipid.h matpol.h polys.h syz.h \
     124        subexpr.h clapsing.h ipid.h matpol.h polys.h p_polys.h syz.h \
    125125        cntrlc.h ipprint.h ring.h timer.h sdb.h dError.h \
    126126        febase.h ipshell.h shortfl.h tok.h mpr_complex.h mpr_global.h \
  • Singular/algmap.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: algmap.cc,v 1.17 2000-09-12 16:00:48 obachman Exp $ */
     4/* $Id: algmap.cc,v 1.18 2000-09-18 09:18:52 obachman Exp $ */
    55/*
    66* ABSTRACT - the mapping of polynomials from rings with
     
    99
    1010#include "mod2.h"
    11 #include <omalloc.h>
     11#include "omalloc.h"
    1212#include "tok.h"
    1313#include "polys.h"
  • Singular/attrib.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: attrib.cc,v 1.18 2000-08-14 12:55:53 obachman Exp $ */
     4/* $Id: attrib.cc,v 1.19 2000-09-18 09:18:52 obachman Exp $ */
    55
    66/*
     
    1515
    1616#include "mod2.h"
    17 #include <omalloc.h>
     17#include "omalloc.h"
    1818#include "tok.h"
    1919#include "ipid.h"
  • Singular/clapconv.cc

    rf3398d r512a2b  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 // $Id: clapconv.cc,v 1.26 2000-08-14 12:55:55 obachman Exp $
     5// $Id: clapconv.cc,v 1.27 2000-09-18 09:18:53 obachman Exp $
    66/*
    77* ABSTRACT: convert data between Singular and factory
     
    1111#include "mod2.h"
    1212#ifdef HAVE_FACTORY
    13 #include <omalloc.h>
     13#include "omalloc.h"
    1414#include "tok.h"
    1515#define SI_DONT_HAVE_GLOBAL_VARS
  • Singular/clapsing.cc

    rf3398d r512a2b  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 // $Id: clapsing.cc,v 1.70 2000-09-12 16:00:49 obachman Exp $
     5// $Id: clapsing.cc,v 1.71 2000-09-18 09:18:53 obachman Exp $
    66/*
    77* ABSTRACT: interface between Singular and factory
     
    99
    1010#include "mod2.h"
    11 #include <omalloc.h>
     11#include "omalloc.h"
    1212#ifdef HAVE_FACTORY
    1313#define SI_DONT_HAVE_GLOBAL_VARS
  • Singular/cntrlc.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: cntrlc.cc,v 1.33 2000-09-15 16:43:52 Singular Exp $ */
     4/* $Id: cntrlc.cc,v 1.34 2000-09-18 09:18:53 obachman Exp $ */
    55/*
    66* ABSTRACT - interupt handling
     
    1313#include <signal.h>
    1414#include "mod2.h"
    15 #include <omalloc.h>
     15#include "omalloc.h"
    1616#include "tok.h"
    1717#include "ipshell.h"
  • Singular/extra.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: extra.cc,v 1.144 2000-09-14 13:04:34 obachman Exp $ */
     4/* $Id: extra.cc,v 1.145 2000-09-18 09:18:54 obachman Exp $ */
    55/*
    66* ABSTRACT: general interface to internals of Singular ("system" command)
     
    666666      om_Opts.MarkAsStatic = 1;
    667667      FILE *fd = NULL;
     668      int max = 5;
     669      while (h != NULL)
     670      {
     671        omMarkAsStaticAddr(h);
     672        if (fd == NULL && h->Typ()==STRING_CMD)
     673        {
     674          fd = fopen((char*) h->Data(), "w");
     675          if (fd == NULL)
     676            Warn("Can not open %s for writing og mtrack. Using stdout");
     677        }
     678        if (h->Typ() == INT_CMD)
     679        {
     680          max = (int) h->Data();
     681        }
     682        h = h->Next();
     683      }
     684      omPrintUsedTrackAddrs((fd == NULL ? stdout : fd), max);
     685      if (fd != NULL) fclose(fd);
     686      om_Opts.MarkAsStatic = 0;
     687      return FALSE;
     688#else
     689     WerrorS("mtrack not supported without OM_TRACK");
     690     return TRUE;
     691#endif
     692    }
     693/*==================== mtrack_all ==================================*/
     694    if(strcmp(sys_cmd,"mtrack_all")==0)
     695    {
     696#ifdef OM_TRACK
     697      om_Opts.MarkAsStatic = 1;
     698      FILE *fd = NULL;
    668699      if ((h!=NULL) &&(h->Typ()==STRING_CMD))
    669700      {
     
    673704        omMarkAsStaticAddr(h);
    674705      }
    675       omPrintUsedTrackAddrs((fd == NULL ? stdout : fd));
    676       if (fd != NULL) fclose(fd);
    677       om_Opts.MarkAsStatic = 0;
    678       return FALSE;
    679 #else
    680      WerrorS("mtrack not supported without OM_TRACK");
    681      return TRUE;
    682 #endif
    683     }
    684 /*==================== mtrack_all ==================================*/
    685     if(strcmp(sys_cmd,"mtrack_all")==0)
    686     {
    687 #ifdef OM_TRACK
    688       om_Opts.MarkAsStatic = 1;
    689       FILE *fd = NULL;
    690       if ((h!=NULL) &&(h->Typ()==STRING_CMD))
    691       {
    692         fd = fopen((char*) h->Data(), "w");
    693         if (fd == NULL)
    694           Warn("Can not open %s for writing og mtrack. Using stdout");
    695         omMarkAsStaticAddr(h);
    696       }
    697706      // OB: TBC print to fd
    698       omPrintUsedAddrs((fd == NULL ? stdout : fd));
     707      omPrintUsedAddrs((fd == NULL ? stdout : fd), 5);
    699708      if (fd != NULL) fclose(fd);
    700709      om_Opts.MarkAsStatic = 0;
  • Singular/feOpt.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: feOpt.cc,v 1.13 2000-08-14 12:56:05 obachman Exp $ */
     4/* $Id: feOpt.cc,v 1.14 2000-09-18 09:18:54 obachman Exp $ */
    55/*
    66* ABSTRACT: Implementation of option buisness
     
    270270//         "error-string" on error
    271271#if !defined(ESINGULAR) && !defined(TSINGULAR)
    272 #include <omalloc.h>
     272#include "omalloc.h"
    273273#include "febase.h"
    274274#include "ipshell.h"
  • Singular/feResource.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: feResource.cc,v 1.29 2000-09-14 15:06:33 obachman Exp $ */
     4/* $Id: feResource.cc,v 1.30 2000-09-18 09:18:55 obachman Exp $ */
    55/*
    66* ABSTRACT: management of resources
     
    1414#include "dError.h"
    1515#if !defined(ESINGULAR) && !defined(TSINGULAR)
    16 #include <omalloc.h>
     16#include "omalloc.h"
    1717#include "febase.h"
    1818#else
  • Singular/febase.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: febase.cc,v 1.90 2000-09-04 13:38:56 obachman Exp $ */
     4/* $Id: febase.cc,v 1.91 2000-09-18 09:18:55 obachman Exp $ */
    55/*
    66* ABSTRACT: i/o system
     
    2929#include "tok.h"
    3030#include "febase.h"
    31 #include <omalloc.h>
     31#include "omalloc.h"
    3232#include "subexpr.h"
    3333#include "ipshell.h"
  • Singular/fehelp.cc

    rf3398d r512a2b  
    1616#include "mod2.h"
    1717#include "tok.h"
    18 #include <omalloc.h>
     18#include "omalloc.h"
    1919#include "febase.h"
    2020#include "ipid.h"
  • Singular/feread.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: feread.cc,v 1.37 2000-08-14 12:56:10 obachman Exp $ */
     4/* $Id: feread.cc,v 1.38 2000-09-18 09:18:56 obachman Exp $ */
    55/*
    66* ABSTRACT: input from ttys, simulating fgets
     
    1111#include "tok.h"
    1212#include "febase.h"
    13 #include <omalloc.h>
     13#include "omalloc.h"
    1414
    1515#include "static.h"
  • Singular/fereadl.c

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: fereadl.c,v 1.17 2000-08-14 12:56:11 obachman Exp $ */
     4/* $Id: fereadl.c,v 1.18 2000-09-18 09:18:56 obachman Exp $ */
    55/*
    66* ABSTRACT: input from ttys, simulating fgets
     
    1111#include "tok.h"
    1212#include "febase.h"
    13 #include <omalloc.h>
     13#include "omalloc.h"
    1414#include "structs.h"
    1515#include "febase.h"
  • Singular/ffields.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ffields.cc,v 1.25 2000-08-14 12:56:11 obachman Exp $ */
     4/* $Id: ffields.cc,v 1.26 2000-09-18 09:18:56 obachman Exp $ */
    55/*
    66* ABSTRACT: finite fields with a none-prime number of elements (via tables)
     
    1212#include "tok.h"
    1313#include "febase.h"
    14 #include <omalloc.h>
     14#include "omalloc.h"
    1515#include "numbers.h"
    1616#include "ring.h"
  • Singular/fglm.cc

    rf3398d r512a2b  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglm.cc,v 1.21 2000-08-14 12:56:12 obachman Exp $
     2// $Id: fglm.cc,v 1.22 2000-09-18 09:18:57 obachman Exp $
    33
    44/****************************************
     
    2929#include "febase.h"
    3030#include "maps.h"
    31 #include <omalloc.h>
     31#include "omalloc.h"
    3232#include "kstd1.h"
    3333#include "fglm.h"
  • Singular/fglmcomb.cc

    rf3398d r512a2b  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglmcomb.cc,v 1.18 2000-09-12 16:00:53 obachman Exp $
     2// $Id: fglmcomb.cc,v 1.19 2000-09-18 09:18:57 obachman Exp $
    33
    44/****************************************
     
    2525#include "febase.h"
    2626#include "maps.h"
    27 #include <omalloc.h>
     27#include "omalloc.h"
    2828#include "fglmvec.h"
    2929#include "fglmgauss.h"
     
    7171            v.setelem( point+1, newelem );
    7272            nDelete( & pGetCoeff( todelete ) );
    73             pFree( todelete );
     73            pLmFree( todelete );
    7474            point++;
    7575        }
     
    117117
    118118        p2= pCopy( p2 );
    119         pDelete1(pptr);
    120         pDelete1( & p2 );
     119        pDeleteLm(pptr);
     120        pDeleteLm( & p2 );
    121121        p2= pMult( m, p2 );
    122122
     
    191191//         pSetExpV( m[k], temp->exp );
    192192//         pSetm( m[k] );
    193         m[k]=pInit(temp);
     193        m[k]=pLmInit(temp);
    194194        pSetCoeff( m[k], nInit(1) );
    195195        pIter( temp );
     
    244244            for ( b= 0; (b < basisSize) && (found == FALSE); b++ )
    245245            {
    246                 if ( pEqual( temp, basis[b] ) )
     246                if ( pLmEqual( temp, basis[b] ) )
    247247                {
    248248                    found= TRUE;
     
    260260//                 pSetExpV( basis[basisSize], temp->exp );
    261261//                 pSetm( basis[basisSize] );
    262                 basis[basisSize]=pInit(temp);
     262                basis[basisSize]=pLmInit(temp);
    263263                pSetCoeff( basis[basisSize], nInit(1) );
    264264                basisSize++;
     
    288288            int b= 0;
    289289            while ( found == FALSE ) {
    290                 if ( pEqual( mon, basis[b] ) ) {
     290                if ( pLmEqual( mon, basis[b] ) ) {
    291291                    found= TRUE;
    292292                }
     
    472472            int b;
    473473            for ( b= 0; (b < basisSize) && (found == FALSE); b++ )
    474                 if ( pEqual( sm, basis[b] ) ) found= TRUE;
     474                if ( pLmEqual( sm, basis[b] ) ) found= TRUE;
    475475            if ( found == FALSE ) {
    476476                // Expand the basis
     
    504504            int b= 0;
    505505            while ( found == FALSE ) {
    506                 if ( pEqual( mon, basis[b] ) )
     506                if ( pLmEqual( mon, basis[b] ) )
    507507                    found= TRUE;
    508508                else
  • Singular/fglmgauss.cc

    rf3398d r512a2b  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglmgauss.cc,v 1.12 2000-08-14 12:56:13 obachman Exp $
     2// $Id: fglmgauss.cc,v 1.13 2000-09-18 09:18:58 obachman Exp $
    33
    44/****************************************
     
    1515#include "structs.h"
    1616#include "numbers.h"
    17 #include <omalloc.h>
     17#include "omalloc.h"
    1818
    1919#include "fglmvec.h"
  • Singular/fglmhom.cc

    rf3398d r512a2b  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglmhom.cc,v 1.16 2000-08-14 12:56:15 obachman Exp $
     2// $Id: fglmhom.cc,v 1.17 2000-09-18 09:18:58 obachman Exp $
    33
    44/****************************************
     
    2626#include "febase.h"
    2727#include "maps.h"
    28 #include <omalloc.h>
     28#include "omalloc.h"
    2929#include "fglm.h"
    3030#include "fglmvec.h"
     
    247247                    for ( t= dat.numMonoms - 1; t >= 0; t-- ) {
    248248                        if ( dat.monlist[t].basis > 0 ) {
    249                             if ( pEqual( dat.monlist[t].mon.sm, temp ) ) {
     249                            if ( pLmEqual( dat.monlist[t].mon.sm, temp ) ) {
    250250                                number coeff= nCopy( pGetCoeff( temp ) );
    251251                                v.setelem( dat.monlist[t].basis, coeff );
  • Singular/fglmvec.cc

    rf3398d r512a2b  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglmvec.cc,v 1.13 2000-08-14 12:56:15 obachman Exp $
     2// $Id: fglmvec.cc,v 1.14 2000-09-18 09:18:58 obachman Exp $
    33
    44/****************************************
     
    1616
    1717#ifdef HAVE_FGLM
    18 #include <omalloc.h>
     18#include "omalloc.h"
    1919#include "tok.h"
    2020#include "structs.h"
  • Singular/fglmzero.cc

    rf3398d r512a2b  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglmzero.cc,v 1.29 2000-09-12 16:00:53 obachman Exp $
     2// $Id: fglmzero.cc,v 1.30 2000-09-18 09:18:59 obachman Exp $
    33
    44/****************************************
     
    3030#include "febase.h"
    3131#include "maps.h"
    32 #include <omalloc.h>
     32#include "omalloc.h"
    3333#include "kstd1.h" // for kNF (see fglmquot)
    3434#include "fglm.h"
     
    298298    borderElem() : monom(NULL), nf() {}
    299299    borderElem( poly p, fglmVector n ) : monom( p ), nf( n ) {}
    300     ~borderElem() { pDelete1(&monom); }
     300    ~borderElem() { pDeleteLm(&monom); }
    301301#ifndef HAVE_EXPLICIT_CONSTR
    302302    void insertElem( poly p, fglmVector n )
     
    390390{
    391391    for ( int k = basisSize; k > 0; k-- )
    392         pDelete1( basis + k );  //. rem: basis runs from basis[1]..basis[basisSize]
     392        pDeleteLm( basis + k );  //. rem: basis runs from basis[1]..basis[basisSize]
    393393    omFreeSize( (ADDRESS)basis, basisMax*sizeof( poly ) );
    394394#ifndef HAVE_EXPLICIT_CONSTR
     
    487487        if ( state == 0 ) {
    488488            list.getItem().newDivisor( k );
    489             pDelete1(&newmonom);
     489            pDeleteLm(&newmonom);
    490490        }
    491491        else {
     
    503503
    504504//     if p == pHead( (theIdeal->m)[k] ) return k, 0 otherwise
    505 //     (Assumes that pEqual just checks the leading monomials without
     505//     (Assumes that pLmEqual just checks the leading monomials without
    506506//      coefficients.)
    507507int
     
    509509{
    510510    for ( int k = idelems; k > 0; k-- )
    511         if ( pEqual( m, (theIdeal->m)[k-1] ) )
     511        if ( pLmEqual( m, (theIdeal->m)[k-1] ) )
    512512            return k;
    513513    return 0;
     
    605605                poly nf = data.getSpanPoly( edge );
    606606                pNorm( nf );
    607                 pDelete1(&nf);  //. deletes the leadingmonomial
     607                pDeleteLm(&nf);  //. deletes the leadingmonomial
    608608                nf= pNeg( nf );
    609609                fglmVector nfv = data.getVectorRep( nf );
     
    691691{
    692692    if ( monom != NULL ) {
    693         pDelete1(&monom);
     693        pDeleteLm(&monom);
    694694    }
    695695}
     
    877877        if ( state == 0 ) {
    878878            list.getItem().newDivisor();
    879             pDelete1( & newmonom );
     879            pDeleteLm( & newmonom );
    880880        }
    881881        else {
  • Singular/gnumpc.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: gnumpc.cc,v 1.12 2000-08-14 12:56:17 obachman Exp $ */
     4/* $Id: gnumpc.cc,v 1.13 2000-09-18 09:18:59 obachman Exp $ */
    55/*
    66* ABSTRACT: computations with GMP complex floating-point numbers
     
    1212#include "tok.h"
    1313#include "febase.h"
    14 #include <omalloc.h>
     14#include "omalloc.h"
    1515#include "numbers.h"
    1616#include "modulop.h"
  • Singular/gnumpfl.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: gnumpfl.cc,v 1.15 2000-08-14 12:56:17 obachman Exp $ */
     4/* $Id: gnumpfl.cc,v 1.16 2000-09-18 09:18:59 obachman Exp $ */
    55/*
    66* ABSTRACT: computations with GMP floating-point numbers
     
    1212#include "tok.h"
    1313#include "febase.h"
    14 #include <omalloc.h>
     14#include "omalloc.h"
    1515#include "numbers.h"
    1616#include "modulop.h"
  • Singular/grammar.y

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: grammar.y,v 1.82 2000-08-14 12:56:17 obachman Exp $ */
     4/* $Id: grammar.y,v 1.83 2000-09-18 09:18:59 obachman Exp $ */
    55/*
    66* ABSTRACT: SINGULAR shell grammatik
     
    2727
    2828#include "mod2.h"
    29 #include <omalloc.h>
     29#include "omalloc.h"
    3030#include "tok.h"
    3131#include "stype.h"
  • Singular/hdegree.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: hdegree.cc,v 1.21 2000-09-12 16:00:54 obachman Exp $ */
     4/* $Id: hdegree.cc,v 1.22 2000-09-18 09:19:00 obachman Exp $ */
    55/*
    66*  ABSTRACT -  dimension, multiplicity, HC, kbase
     
    1313#include "lists.h"
    1414#include "febase.h"
    15 #include <omalloc.h>
     15#include "omalloc.h"
    1616#include "ipid.h"
    1717#include "ideals.h"
     
    10721072  hLexS(hexist, hNstc, hvar, hNvar);
    10731073  if (hEdge!=NULL)
    1074     pFree(hEdge);
     1074    pLmFree(hEdge);
    10751075  hEdge = pInit();
    10761076  pWork = pInit();
     
    10821082  omFreeSize((ADDRESS)hpure, (1 + (hNvar * hNvar)) * sizeof(Exponent_t));
    10831083  hDelete(hexist, hNexist);
    1084   pFree(pWork);
     1084  pLmFree(pWork);
    10851085}
    10861086
     
    14121412  omFreeSize((ADDRESS)act, (pVariables + 1) * sizeof(Exponent_t));
    14131413  hKill(stcmem, pVariables - 1);
    1414   pDelete1(&p);
     1414  pDeleteLm(&p);
    14151415  if (p == NULL)
    14161416    return idInit(1,s->rank);
  • Singular/hilb.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: hilb.cc,v 1.14 2000-08-14 12:56:19 obachman Exp $ */
     4/* $Id: hilb.cc,v 1.15 2000-09-18 09:19:00 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Hilbert series
     
    1010#include "tok.h"
    1111#include "febase.h"
    12 #include <omalloc.h>
     12#include "omalloc.h"
    1313#include "polys.h"
    1414#include "intvec.h"
  • Singular/hutil.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: hutil.cc,v 1.15 2000-08-14 12:56:19 obachman Exp $ */
     4/* $Id: hutil.cc,v 1.16 2000-09-18 09:19:01 obachman Exp $ */
    55/*
    66* ABSTRACT: Utilities for staircase operations
     
    1010#include "tok.h"
    1111#include "febase.h"
    12 #include <omalloc.h>
     12#include "omalloc.h"
    1313#include "ipid.h"
    1414#include "ideals.h"
  • Singular/ideals.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.102 2000-09-14 13:04:35 obachman Exp $ */
     4/* $Id: ideals.cc,v 1.103 2000-09-18 09:19:01 obachman Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    1010#include "mod2.h"
    1111#include "tok.h"
    12 #include <omalloc.h>
     12#include "omalloc.h"
    1313#include "febase.h"
    1414#include "numbers.h"
     
    248248    for (j=l-1; j>i; j--)
    249249    {
    250       if (id->m[i] != NULL && id->m[j] != NULL && pEqual(id->m[i], id->m[j]))
     250      if (id->m[i] != NULL && id->m[j] != NULL && pLmEqual(id->m[i], id->m[j]))
    251251      {
    252252        pDelete(&id->m[j]);
     
    913913      {
    914914        pIter(*p);
    915         pDelete1(&qp2);
     915        pDeleteLm(&qp2);
    916916        qp2 = *p;
    917917        qp1 = *p;
     
    920920      {
    921921        qp2->next = qp1->next;
    922         pDelete1(&qp1);
     922        pDeleteLm(&qp1);
    923923        qp1 = qp2->next;
    924924      }
  • Singular/intvec.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: intvec.cc,v 1.17 2000-08-14 12:56:21 obachman Exp $ */
     4/* $Id: intvec.cc,v 1.18 2000-09-18 09:19:02 obachman Exp $ */
    55/*
    66* ABSTRACT: class intvec: lists/vectors of integers
     
    1212#include "febase.h"
    1313#include "intvec.h"
    14 #include <omalloc.h>
     14#include "omalloc.h"
    1515
    1616/*0 implementation*/
  • Singular/intvec.h

    rf3398d r512a2b  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: intvec.h,v 1.13 2000-08-14 12:56:21 obachman Exp $ */
     6/* $Id: intvec.h,v 1.14 2000-09-18 09:19:02 obachman Exp $ */
    77/*
    88* ABSTRACT: class intvec: lists/vectors of integers
    99*/
    1010#include <string.h>
    11 #include <omalloc.h>
     11#include "omalloc.h"
    1212#include "febase.h"
    1313
  • Singular/iparith.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iparith.cc,v 1.224 2000-09-15 16:44:29 Singular Exp $ */
     4/* $Id: iparith.cc,v 1.225 2000-09-18 09:19:02 obachman Exp $ */
    55
    66/*
     
    1616
    1717#include "mod2.h"
     18
    1819#include "tok.h"
    1920#include "ipid.h"
    2021#include "intvec.h"
    21 #include <omalloc.h>
     22#include "omalloc.h"
    2223#include "polys.h"
    2324#include "febase.h"
     
    12891290      if (o!=NULL)
    12901291      {
    1291         pDelete1(&pNext(o));
     1292        pDeleteLm(&pNext(o));
    12921293        p=pNext(o);
    12931294      }
    12941295      else
    1295         pDelete1(&p);
     1296        pDeleteLm(&p);
    12961297    }
    12971298    else
     
    13311332      if (i==iv->length())
    13321333      {
    1333         pDelete1(&p);
     1334        pDeleteLm(&p);
    13341335        if (p==NULL) break;
    13351336      }
    13361337    }
    1337     pDelete1(&r);
     1338    pDeleteLm(&r);
    13381339    res->data=(char *)r;
    13391340  }
     
    29392940  else
    29402941  {
    2941     poly lm = pInit(p);
     2942    poly lm = pLmInit(p);
    29422943    pSetCoeff(lm, nInit(1));
    29432944    res->data = (char*) lm;
  • Singular/ipassign.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipassign.cc,v 1.58 2000-08-14 12:56:23 obachman Exp $ */
     4/* $Id: ipassign.cc,v 1.59 2000-09-18 09:19:04 obachman Exp $ */
    55
    66/*
     
    1717#include "ipid.h"
    1818#include "intvec.h"
    19 #include <omalloc.h>
     19#include "omalloc.h"
    2020#include "febase.h"
    2121#include "polys.h"
  • Singular/ipconv.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipconv.cc,v 1.24 2000-08-14 12:56:23 obachman Exp $ */
     4/* $Id: ipconv.cc,v 1.25 2000-09-18 09:19:04 obachman Exp $ */
    55/*
    66* ABSTRACT: automatic type conversions
     
    1111#include "ipid.h"
    1212#include "intvec.h"
    13 #include <omalloc.h>
     13#include "omalloc.h"
    1414#include "febase.h"
    1515#include "polys.h"
  • Singular/ipid.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipid.cc,v 1.42 2000-08-18 15:42:06 Singular Exp $ */
     4/* $Id: ipid.cc,v 1.43 2000-09-18 09:19:05 obachman Exp $ */
    55
    66/*
     
    1111
    1212#include "mod2.h"
    13 #include <omalloc.h>
     13#include "omalloc.h"
    1414#include "tok.h"
    1515#include "ipshell.h"
  • Singular/iplib.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iplib.cc,v 1.74 2000-09-04 13:38:57 obachman Exp $ */
     4/* $Id: iplib.cc,v 1.75 2000-09-18 09:19:05 obachman Exp $ */
    55/*
    66* ABSTRACT: interpreter: LIB and help
     
    1616#include "tok.h"
    1717#include "ipid.h"
    18 #include <omalloc.h>
     18#include "omalloc.h"
    1919#include "febase.h"
    2020#include "ring.h"
  • Singular/ipprint.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipprint.cc,v 1.18 2000-08-14 12:56:25 obachman Exp $ */
     4/* $Id: ipprint.cc,v 1.19 2000-09-18 09:19:05 obachman Exp $ */
    55/*
    66* ABSTRACT: interpreter: printing
     
    1010#include "tok.h"
    1111#include "ipid.h"
    12 #include <omalloc.h>
     12#include "omalloc.h"
    1313#include "febase.h"
    1414#include "polys.h"
  • Singular/ipshell.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipshell.cc,v 1.55 2000-08-14 12:56:26 obachman Exp $ */
     4/* $Id: ipshell.cc,v 1.56 2000-09-18 09:19:06 obachman Exp $ */
    55/*
    66* ABSTRACT:
     
    1616#include "ipid.h"
    1717#include "intvec.h"
    18 #include <omalloc.h>
     18#include "omalloc.h"
    1919#include "febase.h"
    2020#include "polys.h"
  • Singular/kInline.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: kInline.cc,v 1.1 2000-09-12 16:09:55 obachman Exp $
     9 *  Version: $Id: kInline.cc,v 1.2 2000-09-18 09:19:06 obachman Exp $
    1010 *******************************************************************/
    1111#ifndef KINLINE_CC
     
    4444  }
    4545  p_Setm(np, tailRing);
    46   p_Free(p, lmRing);
     46  p_LmFree(p, lmRing);
    4747  return np;
    4848}
  • Singular/kbuckets.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kbuckets.cc,v 1.16 2000-09-14 13:04:36 obachman Exp $ */
     4/* $Id: kbuckets.cc,v 1.17 2000-09-18 09:19:06 obachman Exp $ */
    55
    66#include "mod2.h"
    77#include "tok.h"
    88#include "structs.h"
    9 #include <omalloc.h>
     9#include "omalloc.h"
    1010#include "polys.h"
    1111#include "febase.h"
    1212#include "kbuckets.h"
    1313#include "numbers.h"
     14#include "p_Procs.h"
    1415
    1516static omBin kBucket_bin = omGetSpecBin(sizeof(kBucket));
     
    213214              nIsZero(pGetCoeff(bucket->buckets[j])))
    214215          {
    215             p_Delete1(&(bucket->buckets[j]), bucket->bucket_ring);
     216            p_DeleteLm(&(bucket->buckets[j]), bucket->bucket_ring);
    216217            (bucket->buckets_length[j])--;
    217218          }
     
    224225                     nAdd(pGetCoeff(bucket->buckets[i]), tn));
    225226          nDelete(&tn);
    226           p_Delete1(&(bucket->buckets[i]), bucket->bucket_ring);
     227          p_DeleteLm(&(bucket->buckets[i]), bucket->bucket_ring);
    227228          (bucket->buckets_length[i])--;
    228229        }
     
    231232    if (j > 0 && nIsZero(pGetCoeff(bucket->buckets[j])))
    232233    {
    233       p_Delete1(&(bucket->buckets[j]), bucket->bucket_ring);
     234      p_DeleteLm(&(bucket->buckets[j]), bucket->bucket_ring);
    234235      (bucket->buckets_length[j])--;
    235236      j = -1;
     
    548549  if(a1==NULL)
    549550  {
    550     p_Delete1(&lm, bucket->bucket_ring);
     551    p_DeleteLm(&lm, bucket->bucket_ring);
    551552    return nInit(1);
    552553  }
     
    578579  kBucket_Minus_m_Mult_p(bucket, lm, a1, &l1, spNoether);
    579580
    580   p_Delete1(&lm, bucket->bucket_ring);
     581  p_DeleteLm(&lm, bucket->bucket_ring);
    581582  if (reset_vec) pSetCompP(a1, 0);
    582583  kbTests(bucket);
     
    630631      while(j <= strat->tl)
    631632      {
    632         if (pDivisibleBy1(strat->T[j].p,lm)) goto Found;
     633        if (pLmDivisibleBy(strat->T[j].p,lm)) goto Found;
    633634        j++;
    634635      }
     
    639640      {
    640641#ifdef KB_HAVE_SHORT_EVECTORS
    641         if ((strat->T[j].sev & ev) || ! pDivisibleBy2(strat->T[j].p,lm))
     642        if ((strat->T[j].sev & ev) || ! pLmDivisibleByNoComp(strat->T[j].p,lm))
    642643          j++;
    643644        else
    644645          goto Found;
    645646#else
    646         if (pDivisibleBy2(strat->T[j].p,lm)) goto Found;
     647        if (pLmDivisibleByNoComp(strat->T[j].p,lm)) goto Found;
    647648        j++;
    648649#endif
     
    685686      if (TEST_OPT_DEBUG) PrintS(" to 0\n");
    686687#endif
    687       if (h->lcm!=NULL) pFree((*h).lcm);
     688      if (h->lcm!=NULL) pLmFree((*h).lcm);
    688689#ifdef KDEBUG
    689690      (*h).lcm=NULL;
     
    745746      while(j <= strat->tl)
    746747      {
    747         if (pDivisibleBy1(strat->T[j].p,lm)) goto Found;
     748        if (pLmDivisibleBy(strat->T[j].p,lm)) goto Found;
    748749        j++;
    749750      }
     
    754755      {
    755756#ifdef KB_HAVE_SHORT_EVECTORS
    756         if ((strat->T[j].sev & ev) || ! pDivisibleBy2(strat->T[j].p,lm))
     757        if ((strat->T[j].sev & ev) || ! pLmDivisibleByNoComp(strat->T[j].p,lm))
    757758          j++;
    758759        else
    759760          goto Found;
    760761#else
    761         if (pDivisibleBy2(strat->T[j].p,lm)) goto Found;
     762        if (pLmDivisibleByNoComp(strat->T[j].p,lm)) goto Found;
    762763        j++;
    763764#endif
     
    801802        if ((!TEST_OPT_REDBEST) && (ei <= (*h).ecart))
    802803          break;
    803         if ((strat->T[i].ecart < ei) && pDivisibleBy1(strat->T[i].p,lm))
     804        if ((strat->T[i].ecart < ei) && pLmDivisibleBy(strat->T[i].p,lm))
    804805        {
    805806#ifdef KDEBUG
     
    874875    if (lm == NULL)
    875876    {
    876       if (h->lcm!=NULL) pFree((*h).lcm);
     877      if (h->lcm!=NULL) pLmFree((*h).lcm);
    877878#ifdef KDEBUG
    878879      (*h).lcm=NULL;
     
    913914            return;
    914915          }
    915         } while (!pDivisibleBy1(strat->S[i], h->p));
     916        } while (!pLmDivisibleBy(strat->S[i], h->p));
    916917
    917918        // enter in Lazyset and return
  • Singular/kspoly.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kspoly.cc,v 1.7 2000-09-12 16:00:58 obachman Exp $ */
     4/* $Id: kspoly.cc,v 1.8 2000-09-18 09:19:07 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Routines for Spoly creation and reductions
     
    1010#include "polys.h"
    1111#include "numbers.h"
     12#include "p_Procs.h"
    1213
    1314// Define to enable tests in this file
     
    4748  if (a2==NULL)
    4849  {
    49     pDelete1(&lm);
     50    pDeleteLm(&lm);
    5051    PR->p = p1;
    5152    if (coef != NULL) *coef = nInit(1);
     
    7475  int dummy;
    7576  PR->p = currRing->p_Procs->p_Minus_mm_Mult_qq(p1, lm, a2,
    76                                                  dummy, spNoether, currRing);
    77 
    78   pDelete1(&lm);
     77                                                dummy, spNoether, currRing);
     78
     79  pDeleteLm(&lm);
    7980}
    8081
     
    148149 
    149150  // Clean-up time
    150   pDelete1(&m1);
    151   pDelete1(&m2);
     151  pDeleteLm(&m1);
     152  pDeleteLm(&m2);
    152153 
    153154  if (co != 0)
     
    373374      if(cm==1)
    374375      {
    375         pFree(m2);
     376        pLmFree(m2);
    376377        nNew(&(pGetCoeff(m1)));
    377378        return m1;
     
    379380      else
    380381      {
    381         pFree(m1);
     382        pLmFree(m1);
    382383        nNew(&(pGetCoeff(m2)));
    383384        return m2;
     
    391392    if (!equal)
    392393    {
    393       pFree(m2);
     394      pLmFree(m2);
    394395      nNew(&(pGetCoeff(m1)));
    395396      return m1;
     
    399400    if (a2==NULL)
    400401    {
    401       pFree(m2);
     402      pLmFree(m2);
    402403      if (a1==NULL)
    403404      {
    404         pFree(m1);
     405        pLmFree(m1);
    405406        return NULL;
    406407      }
     
    409410    if (a1==NULL)
    410411    {
    411       pFree(m1);
     412      pLmFree(m1);
    412413      goto x2;
    413414    }
  • Singular/kstd1.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd1.cc,v 1.53 2000-09-14 14:07:22 obachman Exp $ */
     4/* $Id: kstd1.cc,v 1.54 2000-09-18 09:19:07 obachman Exp $ */
    55/*
    66* ABSTRACT:
     
    99#include "mod2.h"
    1010#include "tok.h"
    11 #include <omalloc.h>
     11#include "omalloc.h"
    1212#include "polys.h"
    1313#include "febase.h"
     
    162162      return 1;
    163163    }
    164     if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev))
     164    if (pLmShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev))
    165165    {
    166166      //if (strat->interpt) test_int_std(strat->kIdeal);
     
    199199      if ((*h).p == NULL)
    200200      {
    201         if (h->lcm!=NULL) pFree((*h).lcm);
     201        if (h->lcm!=NULL) pLmFree((*h).lcm);
    202202        return 0;
    203203      }
     
    243243            i--;
    244244            if (i<0) return 1;
    245           } while (!pShortDivisibleBy(strat->S[i], strat->sevS[i],
     245          } while (!pLmShortDivisibleBy(strat->S[i], strat->sevS[i],
    246246                                      (*h).p, not_sev));
    247247          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
     
    288288      return 1;
    289289    }
    290     if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev))
     290    if (pLmShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev))
    291291    {
    292292      //if (strat->interpt) test_int_std(strat->kIdeal);
     
    309309          || (((strat->T[i]).ecart == ei)
    310310          && ((strat->T[i]).length < li)))
    311           && pShortDivisibleBy(strat->T[i].p, strat->T[i].sev,
     311          && pLmShortDivisibleBy(strat->T[i].p, strat->T[i].sev,
    312312                               (*h).p, not_sev))
    313313        {
     
    356356      if ((*h).p == NULL)
    357357      {
    358         if (h->lcm!=NULL) pFree((*h).lcm);
     358        if (h->lcm!=NULL) pLmFree((*h).lcm);
    359359        return 0;
    360360      }
     
    402402            i--;
    403403            if (i<0) return 1;
    404           } while (!pShortDivisibleBy(strat->S[i], strat->sevS[i],
     404          } while (!pLmShortDivisibleBy(strat->S[i], strat->sevS[i],
    405405                                      (*h).p, not_sev));
    406406          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
     
    448448      return 1;
    449449    }
    450     if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev))
     450    if (pLmShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev))
    451451    {
    452452      //if (strat->interpt) test_int_std(strat->kIdeal);
     
    473473      if ((*h).p == NULL)
    474474      {
    475         if (h->lcm!=NULL) pFree((*h).lcm);
     475        if (h->lcm!=NULL) pLmFree((*h).lcm);
    476476        h->sev = 0;
    477477        return 0;
     
    510510            i--;
    511511            if (i<0) return 1;
    512           } while (!pShortDivisibleBy(strat->S[i],strat->sevS[i],
     512          } while (!pLmShortDivisibleBy(strat->S[i],strat->sevS[i],
    513513                                      (*h).p, not_sev));
    514514          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
     
    556556      return 1;
    557557    }
    558     if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev))
     558    if (pLmShortDivisibleBy(strat->T[j].p, strat->T[j].sev, (*h).p, not_sev))
    559559    {
    560560      //if (strat->interpt) test_int_std(strat->kIdeal);
     
    576576          || ((strat->T[i].ecart == ei)
    577577        && (strat->T[i].length < li)))
    578             && pShortDivisibleBy(strat->T[i].p, strat->T[i].sev,
     578            && pLmShortDivisibleBy(strat->T[i].p, strat->T[i].sev,
    579579                                 (*h).p, not_sev))
    580580        {
     
    623623      if ((*h).p == NULL)
    624624      {
    625         if (h->lcm!=NULL) pFree((*h).lcm);
     625        if (h->lcm!=NULL) pLmFree((*h).lcm);
    626626        return 0;
    627627      }
     
    667667            i--;
    668668            if (i<0) return 1;
    669           } while (!pShortDivisibleBy(strat->S[i],strat->sevS[i],
     669          } while (!pLmShortDivisibleBy(strat->S[i],strat->sevS[i],
    670670                                      (*h).p, not_sev));
    671671          enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
     
    713713    if (TEST_V_DEG_STOP)
    714714    {
    715       if (kModDeg(H.p)>Kstd1_deg) pDelete1(&H.p);
     715      if (kModDeg(H.p)>Kstd1_deg) pDeleteLm(&H.p);
    716716      if (H.p==NULL) return NULL;
    717717    }
    718     if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev, H.p, not_sev))
     718    if (pLmShortDivisibleBy(strat->T[j].p, strat->T[j].sev, H.p, not_sev))
    719719    {
    720720      //if (strat->interpt) test_int_std(strat->kIdeal);
     
    737737          || ((strat->T[j].ecart == ei)
    738738        && (strat->T[j].length < li)))
    739         && pShortDivisibleBy(strat->T[j].p,strat->T[j].sev, H.p, not_sev))
     739        && pLmShortDivisibleBy(strat->T[j].p,strat->T[j].sev, H.p, not_sev))
    740740        {
    741741          /*
     
    961961      if (pNext(strat->L[j].p) == strat->tail)
    962962      {
    963         pFree(strat->L[j].p);    /*deletes the short spoly and computes*/
     963        pLmFree(strat->L[j].p);    /*deletes the short spoly and computes*/
    964964        strat->L[j].p=ksOldCreateSpoly(strat->L[j].p1,
    965965                                    strat->L[j].p2,
     
    996996      if (pLmCmp(strat->L[i].p,strat->kNoether) == -1)
    997997      {
    998         pFree(strat->L[i].p);
     998        pLmFree(strat->L[i].p);
    999999        strat->L[i].p = NULL;
    10001000      }
    10011001      else
    10021002      {
    1003         pFree(strat->L[i].p);
     1003        pLmFree(strat->L[i].p);
    10041004        strat->L[i].p = ksOldCreateSpoly(strat->L[i].p1,
    10051005                                         strat->L[i].p2,
     
    13461346    if (pNext(strat->P.p) == strat->tail)
    13471347    {
    1348       pFree(strat->P.p);/*- deletes the short spoly and computes -*/
     1348      pLmFree(strat->P.p);/*- deletes the short spoly and computes -*/
    13491349      strat->P.p = ksOldCreateSpoly(strat->P.p1,
    13501350                                    strat->P.p2,
     
    13961396            if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
    13971397          }
    1398           if (strat->P.lcm!=NULL) pFree(strat->P.lcm);
     1398          if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm);
    13991399          strat->P.lcm=NULL;
    14001400#ifdef KDEBUG
  • Singular/kstd2.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.46 2000-09-14 14:07:22 obachman Exp $ */
     4/* $Id: kstd2.cc,v 1.47 2000-09-18 09:19:08 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    99#include "mod2.h"
    1010#include "tok.h"
    11 #include <omalloc.h>
     11#include "omalloc.h"
    1212#include "polys.h"
    1313#include "ideals.h"
     
    6666    {
    6767      if (j > strat->tl) return 1;
    68       if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev,
     68      if (pLmShortDivisibleBy(strat->T[j].p, strat->T[j].sev,
    6969                            h->p, not_sev)) break;
    7070      j++;
     
    8383    if (h->p == NULL)
    8484    {
    85       if (h->lcm!=NULL) pFree((*h).lcm);
     85      if (h->lcm!=NULL) pLmFree((*h).lcm);
    8686#ifdef KDEBUG
    8787      (*h).lcm=NULL;
     
    113113    while (j <= strat->tl)
    114114    {
    115       if (pShortDivisibleBy(strat->T[j].p,strat->T[j].sev,
     115      if (pLmShortDivisibleBy(strat->T[j].p,strat->T[j].sev,
    116116                            h->p, not_sev))
    117117          break;
     
    140140    if ((*h).p == NULL)
    141141    {
    142       if (h->lcm!=NULL) pFree((*h).lcm);
     142      if (h->lcm!=NULL) pLmFree((*h).lcm);
    143143#ifdef KDEBUG
    144144      (*h).lcm=NULL;
     
    162162          if (i<0) return 1;
    163163        }
    164         while (!pShortDivisibleBy(strat->S[i], strat->sevS[i],
     164        while (!pLmShortDivisibleBy(strat->S[i], strat->sevS[i],
    165165                                  h->p, not_sev));
    166166        if (TEST_OPT_DEBUG) Print(" ->L[%d]\n",at);
     
    200200    while (j<= strat->tl)
    201201    {
    202       if (pShortDivisibleBy(strat->T[j].p, strat->T[j].sev,
     202      if (pLmShortDivisibleBy(strat->T[j].p, strat->T[j].sev,
    203203                            h->p, not_sev)) break;
    204204      j++;
     
    228228        break;
    229229      if ((strat->T[i].ecart < ei) &&
    230           pShortDivisibleBy(strat->T[i].p, strat->T[i].sev,
     230          pLmShortDivisibleBy(strat->T[i].p, strat->T[i].sev,
    231231                            h->p, not_sev))
    232232      {
     
    291291    if ((*h).p == NULL)
    292292    {
    293       if (h->lcm!=NULL) pFree((*h).lcm);
     293      if (h->lcm!=NULL) pLmFree((*h).lcm);
    294294#ifdef KDEBUG
    295295      (*h).lcm=NULL;
     
    323323          i--;
    324324          if (i<0) return 1;
    325         } while (!pShortDivisibleBy(strat->S[i], strat->sevS[i],
     325        } while (!pLmShortDivisibleBy(strat->S[i], strat->sevS[i],
    326326                                    h->p, not_sev));
    327327        enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at);
     
    380380              if (ph==NULL)
    381381              {
    382                 pFree(p);
     382                pLmFree(p);
    383383                pDelete(&((*h).p));
    384                 if (h->lcm!=NULL) pFree((*h).lcm);
     384                if (h->lcm!=NULL) pLmFree((*h).lcm);
    385385#ifdef KDEBUG
    386386                (*h).lcm=NULL;
     
    390390              else if (pLmCmp(ph,p) == -1)
    391391              {
    392                 pFree(p);
     392                pLmFree(p);
    393393                p = ph;
    394394                jbest = j;
     
    396396              else
    397397              {
    398                 pFree(ph);
     398                pLmFree(ph);
    399399              }
    400400            }
    401401          }
    402402        }
    403         pFree(p);
     403        pLmFree(p);
    404404        (*h).p = ksOldSpolyRed(strat->T[jbest].p,(*h).p,strat->kNoether);
    405405      }
    406406      else
    407407      {
    408         if (h->lcm!=NULL) pFree((*h).lcm);
     408        if (h->lcm!=NULL) pLmFree((*h).lcm);
    409409#ifdef KDEBUG
    410410        (*h).lcm=NULL;
     
    465465  loop
    466466  {
    467     if (pShortDivisibleBy(strat->S[j], strat->sevS[j], h, not_sev))
     467    if (pLmShortDivisibleBy(strat->S[j], strat->sevS[j], h, not_sev))
    468468    {
    469469      //if (strat->interpt) test_int_std(strat->kIdeal);
     
    606606    {
    607607      /* deletes the short spoly and computes */
    608       pFree(strat->P.p);
     608      pLmFree(strat->P.p);
    609609      /* the real one */
    610610      ksCreateSpoly(&(strat->P),
     
    669669        if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
    670670      }
    671       if (strat->P.lcm!=NULL) pFree(strat->P.lcm);
     671      if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm);
    672672      if (strat->sl>srmax) srmax = strat->sl;
    673673    }
  • Singular/kstdfac.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstdfac.cc,v 1.39 2000-09-14 14:07:23 obachman Exp $ */
     4/* $Id: kstdfac.cc,v 1.40 2000-09-18 09:19:09 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: factorizing alg. of Buchberger
     
    99#include "mod2.h"
    1010#include "tok.h"
    11 #include <omalloc.h>
     11#include "omalloc.h"
    1212#include "polys.h"
    1313#include "ideals.h"
     
    8585    // copy .lcm ----------------------------------------------
    8686    if (o->L[j].lcm!=NULL)
    87       l[j].lcm=pInit(o->L[j].lcm);
     87      l[j].lcm=pLmInit(o->L[j].lcm);
    8888    else
    8989      l[j].lcm=NULL;
     
    483483    {
    484484      /* deletes the short spoly and computes */
    485       pFree(strat->P.p);
     485      pLmFree(strat->P.p);
    486486      /* the real one */
    487487      strat->P.p = ksOldCreateSpoly(strat->P.p1,
     
    563563        }
    564564      }
    565       if (strat->P.lcm!=NULL) pFree(strat->P.lcm);
     565      if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm);
    566566      int i;
    567567
  • Singular/kutil.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.60 2000-09-14 14:07:23 obachman Exp $ */
     4/* $Id: kutil.cc,v 1.61 2000-09-18 09:19:09 obachman Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for kStd
     
    1515#include "tok.h"
    1616#include "febase.h"
    17 #include <omalloc.h>
     17#include "omalloc.h"
    1818#include "numbers.h"
    1919#include "polys.h"
     
    2727#include "kutil.h"
    2828
     29/* Hmm ... this should be inlined or made more efficient:
     30   see Long/mregular.tst */
     31/*2
     32*should return 1 if p divides q and p<q,
     33*             -1 if q divides p and q<p
     34*              0 otherwise
     35*/
     36static inline int     pDivComp(poly p, poly q)
     37{
     38  if (pGetComp(p) == pGetComp(q))
     39  {
     40    int i=pVariables;
     41    long d;
     42    BOOLEAN a=FALSE, b=FALSE;
     43    for (; i>0; i--)
     44    {
     45      d = pGetExpDiff(p, q, i);
     46      if (d)
     47      {
     48        if (d < 0)
     49        {
     50          if (b) return 0;
     51          a =TRUE;
     52        }
     53        else
     54        {
     55          if (a) return 0;
     56          b = TRUE;
     57        }
     58      }
     59    }
     60    if (a) return 1;
     61    else if (b)  return -1;
     62  }
     63  return 0;
     64}
     65
    2966static poly redMora (poly h,int maxIndex,kStrategy strat);
    3067static poly redBba (poly h,int maxIndex,kStrategy strat);
     
    462499
    463500  if (set[j].lcm!=NULL)
    464     pFree(set[j].lcm);
     501    pLmFree(set[j].lcm);
    465502  if (set[j].p!=NULL)
    466503  {
    467504    if (pNext(set[j].p) == strat->tail)
    468505    {
    469       pFree(set[j].p);
     506      pLmFree(set[j].p);
    470507      /*- tail belongs to several int spolys -*/
    471508    }
     
    525562{
    526563  assume(p_sev == pGetShortExpVector(p));
    527   if (!pShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at])) return;
     564  if (!pLmShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at])) return;
    528565  deleteInS((*at),strat);
    529566  (*at)--;
     
    627664    */
    628665      strat->cp++;
    629       pFree(Lp.lcm);
     666      pLmFree(Lp.lcm);
    630667      Lp.lcm=NULL;
    631668      return;
     
    635672    if (strat->fromT && (strat->ecartS[i]>ecart))
    636673    {
    637       pFree(Lp.lcm);
     674      pLmFree(Lp.lcm);
    638675      Lp.lcm=NULL;
    639676      return;
     
    658695          if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
    659696          {
    660             pFree(Lp.lcm);
     697            pLmFree(Lp.lcm);
    661698            return;
    662699          }
     
    692729    */
    693730      strat->cp++;
    694       pFree(Lp.lcm);
     731      pLmFree(Lp.lcm);
    695732      Lp.lcm=NULL;
    696733      return;
     
    698735    if (strat->fromT && (strat->ecartS[i]>ecart))
    699736    {
    700       pFree(Lp.lcm);
     737      pLmFree(Lp.lcm);
    701738      Lp.lcm=NULL;
    702739      return;
     
    717754        if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0))
    718755        {
    719           pFree(Lp.lcm);
     756          pLmFree(Lp.lcm);
    720757          return;
    721758        }
     
    760797    *the first case is handeled in chainCrit
    761798    */
    762     if (Lp.lcm!=NULL) pFree(Lp.lcm);
     799    if (Lp.lcm!=NULL) pLmFree(Lp.lcm);
    763800  }
    764801  else
     
    793830  {
    794831    strat->cp++;
    795     pFree(Lp.lcm);
     832    pLmFree(Lp.lcm);
    796833    Lp.lcm=NULL;
    797834    return;
     
    800837  {
    801838    compare=pDivComp(strat->L[j].lcm,Lp.lcm);
    802     if ((compare==1) || (pEqual(strat->L[j].lcm,Lp.lcm)))
     839    if ((compare==1) || (pLmEqual(strat->L[j].lcm,Lp.lcm)))
    803840    {
    804841      strat->c3++;
    805       pFree(Lp.lcm);
     842      pLmFree(Lp.lcm);
    806843      return;
    807844    }
     
    817854  if (Lp.p == NULL)
    818855  {
    819      pFree(Lp.lcm);
     856     pLmFree(Lp.lcm);
    820857  }
    821858  else
     
    905942        {
    906943          if (i <  0) break;
    907           if (pEqual(strat->B[j].lcm,strat->B[i].lcm))
     944          if (pLmEqual(strat->B[j].lcm,strat->B[i].lcm))
    908945          {
    909946            strat->c3++;
     
    953990        for(i=j-1; i>=0; i--)
    954991        {
    955           if (pEqual(strat->B[j].lcm,strat->B[i].lcm))
     992          if (pLmEqual(strat->B[j].lcm,strat->B[i].lcm))
    956993          {
    957994            strat->c3++;
     
    10251062        {
    10261063          if (i < 0)  break;
    1027           if ((strat->L[i].p2 == p) && pEqual(strat->L[j].lcm,strat->L[i].lcm))
     1064          if ((strat->L[i].p2 == p) && pLmEqual(strat->L[j].lcm,strat->L[i].lcm))
    10281065          {
    10291066            /*L[i] could be canceled but we search for a better one to cancel*/
     
    10311068            if (isInPairsetL(i-1,strat->L[j].p1,strat->L[i].p1,&l,strat)
    10321069            && (pNext(strat->L[l].p) == strat->tail)
    1033             && (!pEqual(strat->L[i].p,strat->L[l].p))
     1070            && (!pLmEqual(strat->L[i].p,strat->L[l].p))
    10341071            && pDivisibleBy(p,strat->L[l].lcm))
    10351072            {
     
    12111248        j++;
    12121249        if (j > strat->sl) break;
    1213         if (pShortDivisibleBy(strat->S[i], strat->sevS[i],
     1250        if (pLmShortDivisibleBy(strat->S[i], strat->sevS[i],
    12141251                              strat->S[j], ~ strat->sevS[j]))
    12151252        {
     
    22562293      while (j <= pos)
    22572294      {
    2258         if (pShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev)
     2295        if (pLmShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev)
    22592296        && ((e >= strat->ecartS[j])
    22602297          || strat->kHEdgeFound)
     
    23112348    while (j <= pos)
    23122349    {
    2313       if (pShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev))
     2350      if (pLmShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev))
    23142351      {
    23152352        strat->redTailChange=TRUE;
     
    23572394    while (j <= pos)
    23582395    {
    2359       if (pShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev)
    2360           && (!pEqual(strat->S[j],h)))
     2396      if (pLmShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev)
     2397          && (!pLmEqual(strat->S[j],h)))
    23612398      {
    23622399        ksOldSpolyTail(strat->S[j], p, h, strat->kNoether);
     
    28222859  while (j <= maxIndex)
    28232860  {
    2824     if (pShortDivisibleBy(strat->S[j],strat->sevS[j],h, not_sev))
     2861    if (pLmShortDivisibleBy(strat->S[j],strat->sevS[j],h, not_sev))
    28252862       return ksOldSpolyRedNew(strat->S[j],h,strat->kNoether);
    28262863    else j++;
     
    28942931  while (j<=strat->sl)
    28952932  {
    2896     if (pShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev))
     2933    if (pLmShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev))
    28972934    {
    28982935      h = ksOldSpolyRed(strat->S[j],h,strat->kNoether);
     
    29172954  while (j <= maxIndex)
    29182955  {
    2919     if (pShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev))
     2956    if (pLmShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev))
    29202957    {
    29212958      h = ksOldSpolyRed(strat->S[j],h,strat->kNoether);
     
    29452982    do
    29462983    {
    2947       if (pShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev)
     2984      if (pLmShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev)
    29482985      && ((e >= strat->ecartS[j]) || strat->kHEdgeFound))
    29492986      {
     
    31443181    }
    31453182  }
    3146   if (redSi!=NULL) pDelete1(&redSi);
     3183  if (redSi!=NULL) pDeleteLm(&redSi);
    31473184#ifdef KDEBUG
    31483185  kTest(strat);
     
    34493486  /*- set B: should be empty -*/
    34503487  omFreeSize((ADDRESS)strat->B,(strat->Bmax)*sizeof(LObject));
    3451   pDelete1(&strat->tail);
     3488  pDeleteLm(&strat->tail);
    34523489  strat->syzComp=0;
    34533490  if (strat->kIdeal!=NULL)
     
    34893526        {
    34903527          if ((Q->m[q]!=NULL)
    3491           &&(pEqual(r->m[l],Q->m[q])))
     3528          &&(pLmEqual(r->m[l],Q->m[q])))
    34923529          {
    34933530            if (TEST_OPT_REDSB)
     
    35703607  scComputeHC(strat->Shdl,ak,strat->kHEdge);
    35713608  /* compare old and new noether*/
    3572   newNoether = pInit(strat->kHEdge);
     3609  newNoether = pLmInit(strat->kHEdge);
    35733610  j = pFDeg(newNoether);
    35743611  for (i=1; i<=pVariables; i++)
     
    35983635    return TRUE;
    35993636  }
    3600   pFree(newNoether);
     3637  pLmFree(newNoether);
    36013638  return FALSE;
    36023639}
  • Singular/kutil.h

    rf3398d r512a2b  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: kutil.h,v 1.29 2000-09-14 14:07:24 obachman Exp $ */
     6/* $Id: kutil.h,v 1.30 2000-09-18 09:19:10 obachman Exp $ */
    77/*
    88* ABSTRACT: kernel: utils for kStd
     
    1010#include <string.h>
    1111#include "structs.h"
    12 #include <omalloc.h>
     12#include "omalloc.h"
    1313#include "ring.h"
    1414
  • Singular/libparse.l

    rf3398d r512a2b  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: libparse.l,v 1.41 2000-09-04 13:39:00 obachman Exp $ */
     5/* $Id: libparse.l,v 1.42 2000-09-18 09:19:11 obachman Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    2020  #include "tok.h"
    2121  #include "febase.h"
    22   #include <omalloc.h>
     22  #include "omalloc.h"
    2323#endif
    2424#include "libparse.h"
  • Singular/lists.h

    rf3398d r512a2b  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: lists.h,v 1.13 2000-08-14 12:56:35 obachman Exp $ */
     6/* $Id: lists.h,v 1.14 2000-09-18 09:19:12 obachman Exp $ */
    77/*
    88* ABSTRACT: handling of the list type
    99*/
    1010#include "structs.h"
    11 #include <omalloc.h>
     11#include "omalloc.h"
    1212#include "subexpr.h"
    1313#include "tok.h"
  • Singular/longalg.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: longalg.cc,v 1.42 2000-09-12 16:01:01 obachman Exp $ */
     4/* $Id: longalg.cc,v 1.43 2000-09-18 09:19:12 obachman Exp $ */
    55/*
    66* ABSTRACT:   algebraic numbers
     
    1212#include "structs.h"
    1313#include "tok.h"
    14 #include <omalloc.h>
     14#include "omalloc.h"
    1515#include "febase.h"
    1616#include "longrat.h"
  • Singular/longrat.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: longrat.cc,v 1.30 2000-08-14 12:56:36 obachman Exp $ */
     4/* $Id: longrat.cc,v 1.31 2000-09-18 09:19:13 obachman Exp $ */
    55/*
    66* ABSTRACT: computation with long rational numbers (Hubert Grassmann)
     
    1111#include "mod2.h"
    1212#include "tok.h"
    13 #include <omalloc.h>
     13#include "omalloc.h"
    1414#include "febase.h"
    1515#include "numbers.h"
  • Singular/longrat0.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: longrat0.cc,v 1.11 2000-08-14 12:56:37 obachman Exp $ */
     4/* $Id: longrat0.cc,v 1.12 2000-09-18 09:19:14 obachman Exp $ */
    55/*
    66* ABSTRACT -
     
    1212#include "mod2.h"
    1313#include "tok.h"
    14 #include <omalloc.h>
     14#include "omalloc.h"
    1515#include "febase.h"
    1616#include "longrat.h"
  • Singular/maps.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: maps.cc,v 1.27 2000-09-12 16:01:02 obachman Exp $ */
     4/* $Id: maps.cc,v 1.28 2000-09-18 09:19:15 obachman Exp $ */
    55/*
    66* ABSTRACT - the mapping of polynomials to other rings
     
    1515#include "ideals.h"
    1616#include "matpol.h"
    17 #include <omalloc.h>
     17#include "omalloc.h"
    1818#include "kstd1.h"
    1919#include "lists.h"
     
    653653    if (product == NULL)
    654654    {
    655       pDelete1(&p);
     655      pDeleteLm(&p);
    656656    }
    657657    else
  • Singular/matpol.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: matpol.cc,v 1.34 2000-09-12 16:01:02 obachman Exp $ */
     4/* $Id: matpol.cc,v 1.35 2000-09-18 09:19:15 obachman Exp $ */
    55
    66/*
     
    1919#include "kstd1.h"
    2020#include "polys.h"
    21 #include <omalloc.h>
     21#include "omalloc.h"
    2222#include "febase.h"
    2323#include "numbers.h"
     
    15961596    else
    15971597    {
    1598       pDelete1(&a2);
     1598      pDeleteLm(&a2);
    15991599      a = pNext(a) = a1;
    16001600      pIter(a1);
     
    16111611    }
    16121612  }
    1613   pDelete1(&p);
     1613  pDeleteLm(&p);
    16141614  return p;
    16151615}
  • Singular/misc.cc

    rf3398d r512a2b  
    1515
    1616#include "mod2.h"
    17 #include <omalloc.h>
     17#include "omalloc.h"
    1818#include "structs.h"
    1919#include "tok.h"
  • Singular/mminit.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mminit.cc,v 1.20 2000-08-14 12:56:39 obachman Exp $ */
     4/* $Id: mminit.cc,v 1.21 2000-09-18 09:19:17 obachman Exp $ */
    55/*
    66* ABSTRACT: init of memory management
     
    1212#include "mod2.h"
    1313#include "mmalloc.h"
     14#include "structs.h"
    1415// this prevents the definition of malloc/free ad macros
    1516// by omalloc
    1617#define OMALLOC_C
    17 #include <omalloc.h>
     18#include "omalloc.h"
    1819
    1920extern "C"
     
    4243    mp_set_memory_functions(malloc,reallocSize,freeSize);
    4344    om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc;
     45#ifndef OM_NDEBUG
     46    om_Opts.ErrorHook = dErrorBreak;
     47#endif   
    4448    omInitInfo();
    4549#ifdef OM_SING_KEEP
  • Singular/mod2.h.in

    rf3398d r512a2b  
    66 *          DO NOT EDIT!
    77 *
    8  *  Version: $Id: mod2.h.in,v 1.89 2000-09-14 14:07:24 obachman Exp $
     8 *  Version: $Id: mod2.h.in,v 1.90 2000-09-18 09:19:17 obachman Exp $
    99 *******************************************************************/
    1010#ifndef MOD2_H
     
    339339 define PDEBUG to
    340340  0 for enabling pTest
    341   1 plus tests in Level 1 poly routines
    342   2 plus tests in Level 2 poly routines
     341  1 plus tests in Level 1 poly routines (operations on monomials)
     342  2 plus tests in Level 2 poly routines (operations on single exponents)
    343343 -- see also polys.h for more info
    344344
    345345 NOTE: you can set the value of PDEBUG on a per-file basis, before
    346        including mod2.h, provided ! PDEBUG is defined in mod2.h E.g:
     346       including mod2.h, provided ! PDEBUG is defined in mod2.h E.g.:
    347347
    348348       #define PDEBUG 2
     
    352352       makes sure that all poly operations in your file are done with
    353353       PDEBUG == 2
     354 To break after an error occured, set a debugger breakpoint on
     355 dErrorBreak.
    354356*/
    355357#ifndef PDEBUG
    356 // do this to disable poly debugging
    357 // #undef PDEBUG
    358358#define PDEBUG 0
    359 #endif
    360 
    361 /* PDEBUG requires MDEBUG -- obachman: really?? if yes, why???*/
    362 #ifdef PDEBUG
    363 #ifndef MDEBUG
    364 #define MDEBUG 0
    365 #endif
    366359#endif
    367360
     
    373366   then omDebug routines are used for memory allocation/free:
    374367
    375    The omDebug routines are controlled by the values of OM_TRACK and om_CHECK.
    376    There meaning is roughly as follows:
     368   The omDebug routines are controlled by the values of OM_TRACK, OM_CHECK
     369   and OM_KEEP.  There meaning is roughly as follows:
    377370   OM_TRACK: strored with address                              : extra space
    378371     0     : no additional info is stored                      : 0
     
    390383     4     : and so on
    391384     ==> for OM_CHECK >= 3 it gets rather slow
    392 
    393    OM_CHECK and OM_TRACK can be set on a per-file basis (as can OM_NDEBUG),
    394    e.g.:
     385   OM_KEEP:  determines whether addresses are really freed  (
     386     0     : addresses are really freed
     387     1     : addresses are only marked as free and not really freed.
     388
     389   OM_CHECK, OM_TRACK, and OM_KEEP can be set on a per-file basis
     390   (as can OM_NDEBUG),  e.g.:
    395391     #define OM_CHECK 3
    396392     #define OM_TRACK 5
    397      #include <omalloc.h>
     393     #define OM_KEEP  1
     394     #include "mod2.h"
     395     #include "omalloc.h"
    398396   ensures that all memory allocs/free in this file are done with
    399    OM_CHECK==3 and OM_TRACK==5.
     397   OM_CHECK==3 and OM_TRACK==5, and that all addresses allocated/freed
     398   in this file are only marked as free and never really freed.
    400399 
    401    To set OM_CHECK and OM_TRACK under dynamic scope, set
    402    om_Opts.MinCheck and om_Opts.MinTrack to the respectiv values. e.g.:
    403      om_Opts.MinCheck = 3; omOpts.MinTrack = 5;
     400   To set OM_CHECK, OM_TRACK and OM_KEEP under dynamic scope, set
     401   om_Opts.MinCheck, om_Opts.MinTrack to the respectiv values and
     402   om_Opts.Keep to the number of addresses which are kept before they are
     403   actually freed. E.g.:
     404     int check=om_Opts.MinCheck, track=om_Opts.MinTrack, keep= m_OPts.Keep;
     405     om_Opts.MinCheck = 3; om_Opts.MinTrack = 5; omOpts.Keep = LONG_MAX;
    404406     ExternalRoutine();
    405      om_Opts.MinCheck = 0; omOpts.MinTrack = 0;
     407     om_Opts.MinCheck = check; omOpts.MinTrack = track; omOpts.Keep = keep;
    406408   ensures that all calls omDebug routines  occuring during the computation of
    407    ExternalRoutine() are done with OM_CHECK==3 and OM_TRACK==5.
     409   ExternalRoutine() are done with OM_CHECK==3 and OM_TRACK==5, and
     410   calls to omFree only mark addresses as free and not really free them.
    408411
    409412   Furthermore, the value of OM_SING_KEEP (resp. om_Opts.Keep) specifies
    410    how many addresses are kept before they are actually freed.
    411 
    412    Some tips on possible values of OM_TRACK, OM_CHECK:
    413    + To find out about an address that has been freed twice, set OM_TRACK
    414      to 4 or 5 and OM_SING_KEEP (resp. om_Opts.Keep) to a high values
    415      (say, LONG_MAX).
     413   how many addresses are kept before they are actually freed, independently
     414   of the value of OM_KEEP.
     415
     416   Some tips on possible values of OM_TRACK, OM_CHECK, OM_KEEP:
     417   + To find out about an address that has been freed twice, first locate the
     418     file(s) where the error occured, and then at the beginning of these files:
     419       #define OM_CHECK 3
     420       #define OM_TRACK 5
     421       #define OM_KEEP  1
     422       #include "mod2.h"
     423       #include "omalloc.h"
     424     Under dynamic scope, do (e.g., from within the debugger):
     425       om_Opts.MinCheck = 3; om_Opts.MinTrack = 5; omOpts.Keep = LONG_MAX;
    416426   + to find out where "memory corruption" occured, increase value of
    417427     OM_CHECK - the higher this value is, the more consistency checks are
     
    430440     However, keep in mind that the efficiency decreases from
    431441     Bin over Size to General routines (i.e., omFreeBin is more efficient than
    432      omFreeSize which is more efficient than omFree, likewise wqith the alloc
     442     omFreeSize which is more efficient than omFree, likewise with the alloc
    433443     routines).
    434    + if OM_CHECK is undefed or 0, then all omCheck routines are undefined
    435    + if OM_CHECK and OM_TRACK are both undefined, or if OM_NDEBUG is defined,
    436      then the "real" alloc/realloc/free macros are used, and all omTest,
    437      omDebug and omCheck routines are undefined
    438    + to break at the time an omError occurs within a debugger,
    439      set a breakpoint on omReportError
    440    + to do checks from within the debugger, or to do checks with exlicit
     444   + if OM_CHECK is undefined or 0, then all omCheck routines do nothing
     445   + if OM_CHECK and OM_TRACK are both undefined (or 0), or if OM_NDEBUG is
     446     defined, then the "real" alloc/realloc/free macros are used, and all
     447     omTest, omDebug and omCheck routines are undefined
     448   + to break after an omError occured within a debugger,
     449     set a breakpoint on dErrorBreak
     450   + to do checks from within the debugger, or to do checks with explicit
    441451     check level, use omTest routines.
    442452*/
    443453
    444 #define OM_TRACK 3
     454/* by default, store alloc info and file/line where addr was freed */
     455#ifndef OM_TRACK
     456#define OM_TRACK 4
     457#endif
     458/* only do constant-time memory checks */
     459#ifndef OM_CHECK
    445460#define OM_CHECK 1
     461#endif
     462/* Do actually free memory:
     463   (be careful: if this is set, memory is never really freed,
     464    but only marked as free) */
     465#ifndef OM_KEEP
     466#define OM_KEEP 0
     467#endif
     468/* but only after you have freed 1000 more addresses
     469   (this is actually independent of the value of OM_KEEP and used
     470   to initialize om_Opts.Keep) */
     471#ifndef OM_SING_KEEP
    446472#define OM_SING_KEEP 1000
     473#endif
     474
    447475#endif /* MDEBUG */
    448476
     
    539567 ******************************************************************/
    540568
    541 #ifndef HAVE_ASSUME
    542 #define assume(x) ((void) 0)
    543 #define r_assume(x) ((void) 0)
    544 #else /* ! HAVE_ASSUME */
    545 
    546 #define assume_violation(s,f,l) \
    547   dReportError("assume violation at %s:%d condition: %s", f,l,s)
    548 
    549569#ifdef __cplusplus
    550570extern "C" {
     
    558578}
    559579#endif
     580
     581#ifndef HAVE_ASSUME
     582#define assume(x) ((void) 0)
     583#define r_assume(x) ((void) 0)
     584#else /* ! HAVE_ASSUME */
     585
     586#define assume_violation(s,f,l) \
     587  dReportError("assume violation at %s:%d condition: %s", f,l,s)
    560588
    561589#define assume(x)   _assume(x, __FILE__, __LINE__)
  • Singular/modulop.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: modulop.cc,v 1.16 2000-08-14 12:56:39 obachman Exp $ */
     4/* $Id: modulop.cc,v 1.17 2000-09-18 09:19:18 obachman Exp $ */
    55/*
    66* ABSTRACT: numbers modulo p (<=32003)
     
    1212#include "tok.h"
    1313#include "febase.h"
    14 #include <omalloc.h>
     14#include "omalloc.h"
    1515#include "numbers.h"
    1616#include "longrat.h"
  • Singular/mpr_base.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpr_base.cc,v 1.22 2000-09-12 16:01:03 obachman Exp $ */
     4/* $Id: mpr_base.cc,v 1.23 2000-09-18 09:19:18 obachman Exp $ */
    55
    66/*
     
    1414#include "mod2.h"
    1515
    16 #include <omalloc.h>
     16#include "omalloc.h"
    1717
    1818//-> includes
     
    22522252    divCount= 0;
    22532253    for ( k= 0; k < IDELEMS(pDegDiv); k++ )
    2254       if ( pDivisibleBy2( (pDegDiv->m)[k], resVectorList[j].mon ) )
     2254      if ( pLmDivisibleByNoComp( (pDegDiv->m)[k], resVectorList[j].mon ) )
    22552255        divCount++;
    22562256    resVectorList[j].isReduced= (divCount == 1);
     
    22712271      {
    22722272        //mprPROTnl("\tfree");
    2273         if ( pDivisibleBy2( (pDegDiv->m)[ (*iVO)[k] ], resVectorList[j].mon ) )
     2273        if ( pLmDivisibleByNoComp( (pDegDiv->m)[ (*iVO)[k] ], resVectorList[j].mon ) )
    22742274        {
    22752275          //mprPROTPnl("\tdivisible by ",(pDegDiv->m)[ (*iVO)[k] ]);
     
    22782278          {
    22792279            //mprPROTPnl("\tchecking db ",(pDegDiv->m)[ (*iVO)[i] ]);
    2280             if ( pDivisibleBy2( (pDegDiv->m)[ (*iVO)[i] ], resVectorList[j].mon ) )
     2280            if ( pLmDivisibleByNoComp( (pDegDiv->m)[ (*iVO)[i] ], resVectorList[j].mon ) )
    22812281            {
    22822282              //mprPROTPnl("\t and divisible by",(pDegDiv->m)[ (*iVO)[i] ]);
     
    23922392      {
    23932393        matEntry= nCopy(pGetCoeff(pi));
    2394         pmatchPos= pInit( pi );
     2394        pmatchPos= pLmInit( pi );
    23952395        pSetCoeff0( pmatchPos, nInit(1) );
    23962396
    23972397        for ( i= 0; i < numVectors; i++)
    2398           if ( pEqual( pmatchPos, resVectorList[i].mon ) )
     2398          if ( pLmEqual( pmatchPos, resVectorList[i].mon ) )
    23992399            break;
    24002400
     
    24272427
    24282428        for ( i= 0; i < numVectors; i++)
    2429           if ( pEqual( pmp, resVectorList[i].mon ) )
     2429          if ( pLmEqual( pmp, resVectorList[i].mon ) )
    24302430            break;
    24312431
  • Singular/mpr_complex.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpr_complex.cc,v 1.26 2000-08-14 12:56:40 obachman Exp $ */
     4/* $Id: mpr_complex.cc,v 1.27 2000-09-18 09:19:19 obachman Exp $ */
    55
    66/*
     
    1717#include "structs.h"
    1818#include "febase.h"
    19 #include <omalloc.h>
     19#include "omalloc.h"
    2020#include "numbers.h"
    2121#include "longrat.h"
  • Singular/mpr_inout.cc

    rf3398d r512a2b  
    33****************************************/
    44
    5 /* $Id: mpr_inout.cc,v 1.9 2000-08-14 12:56:40 obachman Exp $ */
     5/* $Id: mpr_inout.cc,v 1.10 2000-09-18 09:19:20 obachman Exp $ */
    66
    77/*
     
    2222#include "ipshell.h"
    2323#include "febase.h"
    24 #include <omalloc.h>
     24#include "omalloc.h"
    2525#include "numbers.h"
    2626#include "lists.h"
  • Singular/mpr_numeric.cc

    rf3398d r512a2b  
    33****************************************/
    44
    5 /* $Id: mpr_numeric.cc,v 1.9 2000-08-14 12:56:41 obachman Exp $ */
     5/* $Id: mpr_numeric.cc,v 1.10 2000-09-18 09:19:20 obachman Exp $ */
    66
    77/*
     
    1818#include "structs.h"
    1919#include "febase.h"
    20 #include <omalloc.h>
     20#include "omalloc.h"
    2121#include "numbers.h"
    2222#include "polys.h"
  • Singular/mpsr.h

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr.h,v 1.18 2000-08-14 12:56:41 obachman Exp $ */
     4/* $Id: mpsr.h,v 1.19 2000-09-18 09:19:21 obachman Exp $ */
    55/***************************************************************
    66 *
     
    2626#include"structs.h"
    2727#include"subexpr.h"
    28 #include<omalloc.h>
     28#include"omalloc.h"
    2929#include"polys.h"
    3030#include"numbers.h"
  • Singular/mpsr_GetPoly.cc

    rf3398d r512a2b  
    33****************************************/
    44
    5 /* $Id: mpsr_GetPoly.cc,v 1.28 2000-09-12 16:01:03 obachman Exp $ */
     5/* $Id: mpsr_GetPoly.cc,v 1.29 2000-09-18 09:19:22 obachman Exp $ */
    66
    77/***************************************************************
     
    2121
    2222#include "gmp.h"
    23 #include <omalloc.h>
     23#include "omalloc.h"
    2424#include "tok.h"
    2525#include "ipid.h"
     
    569569      minpoly = maIMap(subring, minpoly);
    570570      r->minpoly = minpoly->coef;
    571       pFree(minpoly);
     571      pLmFree(minpoly);
    572572    }
    573573    rKill(subring);
  • Singular/mpsr_PutPoly.cc

    rf3398d r512a2b  
    33****************************************/
    44
    5 /* $Id: mpsr_PutPoly.cc,v 1.19 2000-08-14 12:56:43 obachman Exp $ */
     5/* $Id: mpsr_PutPoly.cc,v 1.20 2000-09-18 09:19:22 obachman Exp $ */
    66
    77/***************************************************************
     
    2323#include "mpsr_Tok.h"
    2424#include "longalg.h"
    25 #include <omalloc.h>
     25#include "omalloc.h"
    2626#include "ring.h"
    2727#include "polys.h"
  • Singular/numbers.h

    rf3398d r512a2b  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: numbers.h,v 1.14 2000-09-14 13:04:38 obachman Exp $ */
     6/* $Id: numbers.h,v 1.15 2000-09-18 09:19:23 obachman Exp $ */
    77/*
    88* ABSTRACT: interface to coefficient aritmetics
     
    1313/*typedef void (*numberproc)(number a,number b,number * c);*/
    1414/*typedef number (*numberfunc)(number a,number b);*/
    15 
    16 #define p_nCopy(n, r)          nCopy(n)
    17 #define p_nDelete(n, r)        nDelete(n)
    18 #define p_nMult(n1, n2, r)     nMult(n1, n2)
    19 #define p_nAdd(n1, n2, r)      nAdd(n1, n2)
    20 #define p_nIsZero(n, r)        nIsZero(n)
    21 #define p_nEqual(n1, n2, r)    nEqual(n1, n2)
    22 #define p_nNeg(n, r)           nNeg(n)
    23 #define p_nSub(n1, n2, r)      nSub(n1, n2)
    2415
    2516#define n_Copy(n, r)          nCopy(n)
  • Singular/pDebug.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pDebug.cc,v 1.3 2000-09-14 14:20:44 obachman Exp $
     9 *  Version: $Id: pDebug.cc,v 1.4 2000-09-18 09:19:23 obachman Exp $
    1010 *******************************************************************/
    1111
     
    1818#ifdef PDEBUG
    1919
    20 #include "polys.h"
     20#include "p_polys.h"
    2121#include "febase.h"
    2222#include "omalloc.h"
    2323#include "ring.h"
     24#include "numbers.h"
    2425
    2526
     
    6869    if (custom != NULL)
    6970    {
    70       pPolyAssumeReturn(custom == r);
     71      pPolyAssumeReturnMsg(custom == r || rEqual((ring) custom, r, FALSE),
     72                           "monomial not from specified ring");
    7173      return TRUE;
    7274    }
     
    101103static int pDivisibleBy_FALSE = 1;
    102104static int pDivisibleBy_ShortFalse = 1;
    103 BOOLEAN pDebugShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1,
     105BOOLEAN pDebugLmShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1,
    104106                               poly p2, unsigned long not_sev_2, ring r_2)
    105107{
     
    108110
    109111  pDivisibleBy_number++;
    110   BOOLEAN ret = _p_DivisibleBy1(p1, r_1, p2, r_2);
     112  BOOLEAN ret = p_LmDivisibleBy(p1, r_1, p2, r_2);
    111113  if (! ret) pDivisibleBy_FALSE++;
    112114  if (sev_1 & not_sev_2)
     
    205207
    206208    // special check for ringorder_s/S
    207     if (currRing->order[1] == ringorder_S)
     209    if (r->order[1] == ringorder_S)
    208210    {
    209211      long c1, cc1, ccc1, ec1;
    210       sro_ord* o = &(currRing->typ[1]);
    211 
    212       c1 = pGetComp(p);
     212      sro_ord* o = &(r->typ[1]);
     213
     214      c1 = p_GetComp(p, r);
    213215      cc1 = o->data.syzcomp.Components[c1];
    214216      ccc1 = o->data.syzcomp.ShiftedComponents[cc1];
    215217      pPolyAssumeReturnMsg(c1 == 0 || cc1 != 0, "Component <-> TrueComponent zero mismatch");
    216218      pPolyAssumeReturnMsg(c1 == 0 || ccc1 != 0,"Component <-> ShiftedComponent zero mismatch");
    217       ec1 = p->exp[currRing->typ[1].data.syzcomp.place];
     219      ec1 = p->exp[r->typ[1].data.syzcomp.place];
    218220      pPolyAssumeReturnMsg(ec1 == ccc1, "Shifted comp out of sync. should %d, is %d");
    219221    }
     
    224226      poly p_should_equal = p_DebugInit(p, r, r);
    225227      pPolyAssumeReturnMsg(p_ExpVectorEqual(p, p_should_equal, r), "p_Setm field(s) out of sync");
    226       p_Free(p_should_equal, r);
     228      p_LmFree(p_should_equal, r);
    227229    }
    228230   
     
    280282    poly pnext = pNext(lm);
    281283    pNext(lm) = tail;
    282     BOOLEAN cmp = p_LmCmp(lm, tail);
     284    BOOLEAN cmp = p_LmCmp(lm, tail, lmRing);
    283285    if (cmp != 1)
    284286      dPolyReportError(lm, lmRing, "wrong order: lm <= Lm(tail)");
  • Singular/pInline0.h

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pInline0.h,v 1.1 2000-09-12 16:01:04 obachman Exp $
     9 *  Version: $Id: pInline0.h,v 1.2 2000-09-18 09:19:24 obachman Exp $
    1010 *******************************************************************/
    1111#ifndef PINLINE0_H
     
    1919
    2020#include "mod2.h"
    21 #include "polys.h"
     21#include "p_polys.h"
    2222 
    2323PINLINE0 void p_SetCompP(poly p, int i, ring r)
  • Singular/pInline1.h

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pInline1.h,v 1.2 2000-09-14 13:04:38 obachman Exp $
     9 *  Version: $Id: pInline1.h,v 1.3 2000-09-18 09:19:24 obachman Exp $
    1010 *******************************************************************/
    1111#ifndef PINLINE1_H
     
    1313
    1414#ifndef PDIV_DEBUG
    15 // define to enable debugging/statistics of pShortDivisibleBy
     15// define to enable debugging/statistics of pLmShortDivisibleBy
    1616#undef PDIV_DEBUG
    1717#endif
     
    4343
    4444#ifdef PDIV_DEBUG
    45 BOOLEAN pDebugShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1,
     45BOOLEAN pDebugLmShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1,
    4646                               poly p2, unsigned long not_sev_2, ring r_2);
    4747#endif
     
    5151#include "omalloc.h"
    5252#include "numbers.h"
    53 #include "polys.h"
     53#include "p_polys.h"
    5454#include "p_MemAdd.h"
    5555#include "p_MemCopy.h"
     
    6868  return p;
    6969}
    70 PINLINE1 poly p_Init(poly p, ring r)
     70PINLINE1 poly p_LmInit(poly p, ring r)
    7171{
    7272  p_CheckPolyRing1(p, r);
    7373  poly np;
    7474  omTypeAllocBin(poly, np, r->PolyBin);
     75  p_SetRingOfPoly(np, r);
    7576  p_ExpVectorCopy(np, p, r);
    7677  _pNext(np) = NULL;
     
    7879  return np;
    7980}
    80 PINLINE1 poly pInit()
    81 {
    82   return p_Init(currRing);
    83 }
    84 PINLINE1 poly pInit(poly p)
    85 {
    86   return p_Init(p, currRing);
    87 }
    8881PINLINE1 poly p_Head(poly p, ring r)
    8982{
     
    9285  poly np;
    9386  omTypeAllocBin(poly, np, r->PolyBin);
     87  p_SetRingOfPoly(np, r);
    9488  p_ExpVectorCopy(np, p, r);
    9589  _pNext(np) = NULL;
    96   _pSetCoeff0(np, p_nCopy(_pGetCoeff(p), r));
     90  _pSetCoeff0(np, n_Copy(_pGetCoeff(p), r));
    9791  return np;
    9892}
     
    231225}
    232226
    233 PINLINE1 BOOLEAN p_LmEqual(poly p, poly q, ring r)
    234 {
    235   p_CheckPolyRing1(p, r);
    236   p_CheckPolyRing1(q, r);
    237   int i = r->ExpLSize;
    238   unsigned long *ep = p->exp;
    239   unsigned long *eq = q->exp;
    240 
    241   do
    242   {
    243     i--;
    244     if (ep[i] != eq[i]) return FALSE;
    245   }
    246   while (i);
    247   return p_nEqual(pGetCoeff(p), pGetCoeff(q), r);
    248 }
    249227
    250228/***************************************************************
     
    253231 *
    254232 ***************************************************************/
    255 static inline BOOLEAN _p_DivisibleBy2(poly a, poly b, ring r)
     233static inline BOOLEAN _p_LmDivisibleByNoComp(poly a, poly b, ring r)
    256234{
    257235  int i=r->N;
     
    266244  return TRUE;
    267245}
    268 static inline BOOLEAN _p_DivisibleBy2(poly a, ring r_a, poly b, ring r_b)
     246static inline BOOLEAN _p_LmDivisibleByNoComp(poly a, ring r_a, poly b, ring r_b)
    269247{
    270248  int i=r_a->N;
     
    280258  return TRUE;
    281259}
    282 static inline BOOLEAN _p_DivisibleBy1(poly a, poly b, ring r)
     260static inline BOOLEAN _p_LmDivisibleBy(poly a, poly b, ring r)
    283261{
    284262  if (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r))
    285     return _p_DivisibleBy2(a, b, r);
     263    return _p_LmDivisibleByNoComp(a, b, r);
    286264  return FALSE;
    287265}
    288 static inline BOOLEAN _p_DivisibleBy1(poly a, ring r_a, poly b, ring r_b)
     266static inline BOOLEAN _p_LmDivisibleBy(poly a, ring r_a, poly b, ring r_b)
    289267{
    290268  if (p_GetComp(a, r_a) == 0 || p_GetComp(a,r_a) == p_GetComp(b,r_b))
    291     return _p_DivisibleBy2(a, r_a, b, r_b);
     269    return _p_LmDivisibleByNoComp(a, r_a, b, r_b);
    292270  return FALSE;
    293271}
    294 
    295 PINLINE1 BOOLEAN p_DivisibleBy2(poly a, poly b, ring r)
     272PINLINE1 BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, ring r)
    296273{
    297274  p_CheckPolyRing1(a, r);
    298275  p_CheckPolyRing1(b, r);
    299   return _p_DivisibleBy2(a, b, r);
    300 }
    301 PINLINE1 BOOLEAN p_DivisibleBy1(poly a, poly b, ring r)
     276  return _p_LmDivisibleByNoComp(a, b, r);
     277}
     278PINLINE1 BOOLEAN p_LmDivisibleBy(poly a, poly b, ring r)
    302279{
    303280  p_CheckPolyRing1(b, r);
    304281  pIfThen1(a != NULL, p_CheckPolyRing1(b, r));
    305282  if (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r))
    306     return _p_DivisibleBy2(a, b, r);
     283    return _p_LmDivisibleByNoComp(a, b, r);
    307284  return FALSE;
    308285}
    309286PINLINE1 BOOLEAN p_DivisibleBy(poly a, poly b, ring r)
    310287{
    311   p_CheckPolyRing1(b, r);
     288  pIfThen1(b!=NULL, p_CheckPolyRing1(b, r));
    312289  pIfThen1(a!=NULL, p_CheckPolyRing1(a, r));
    313290 
    314291  if (a != NULL && (p_GetComp(a, r) == 0 || p_GetComp(a,r) == p_GetComp(b,r)))
    315     return _p_DivisibleBy2(a,b,r);
     292    return _p_LmDivisibleByNoComp(a,b,r);
    316293  return FALSE;
    317294}
    318 
    319 PINLINE1 BOOLEAN p_ShortDivisibleBy(poly a, unsigned long sev_a,
     295PINLINE1 BOOLEAN p_LmDivisibleBy(poly a, ring r_a, poly b, ring r_b)
     296{
     297  p_CheckPolyRing(a, r_a);
     298  p_CheckPolyRing(b, r_b);
     299  return _p_LmDivisibleBy(a, r_a, b, r_b);
     300}
     301PINLINE1 BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a,
    320302                                    poly b, unsigned long not_sev_b, ring r)
    321303{
     
    328310  if (sev_a & not_sev_b)
    329311  {
    330     pAssume1(p_DivisibleBy2(a, b, r) == FALSE);
     312    pAssume1(p_LmDivisibleByNoComp(a, b, r) == FALSE);
    331313    return FALSE;
    332314  }
    333   return p_DivisibleBy1(a, b, r);
     315  return p_LmDivisibleBy(a, b, r);
    334316#else
    335   return pDebugShortDivisibleBy(a, sev_a, r, b, not_sev_b, r);
    336 #endif
    337 }
    338 
    339 PINLINE1 BOOLEAN p_ShortDivisibleBy(poly a, unsigned long sev_a, ring r_a,
     317  return pDebugLmShortDivisibleBy(a, sev_a, r, b, not_sev_b, r);
     318#endif
     319}
     320
     321PINLINE1 BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, ring r_a,
    340322                                    poly b, unsigned long not_sev_b, ring r_b)
    341323{
     
    348330  if (sev_a & not_sev_b)
    349331  {
    350     pAssume1(_p_DivisibleBy2(a, r_a, b, r_b) == FALSE);
     332    pAssume1(_p_LmDivisibleByNoComp(a, r_a, b, r_b) == FALSE);
    351333    return FALSE;
    352334  }
    353   return _p_DivisibleBy1(a, r_a, b, r_b);
     335  return _p_LmDivisibleBy(a, r_a, b, r_b);
    354336#else
    355   return pDebugShortDivisibleBy(a, sev_a, r_a, b, not_sev_b, r_b);
     337  return pDebugLmShortDivisibleBy(a, sev_a, r_a, b, not_sev_b, r_b);
    356338#endif
    357339}
  • Singular/pInline2.h

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pInline2.h,v 1.3 2000-09-14 13:04:39 obachman Exp $
     9 *  Version: $Id: pInline2.h,v 1.4 2000-09-18 09:19:24 obachman Exp $
    1010 *******************************************************************/
    1111#ifndef PINLINE2_H
     
    2222#include "omalloc.h"
    2323#include "structs.h"
    24 #include "polys.h"
     24#include "p_polys.h"
    2525#include "numbers.h"
    2626#include "p_Procs.h"
     
    3030{
    3131  p_CheckPolyRing2(p, r);
    32   p_nDelete(&(p->coef), r);
     32  n_Delete(&(p->coef), r);
    3333  (p)->coef=n;
    3434  return n;
     
    178178}
    179179
    180 PINLINE2 void p_Delete1(poly *p, ring r)
     180PINLINE2 void p_DeleteLm(poly *p, ring r)
    181181{
    182182  pIfThen2(*p != NULL, p_CheckPolyRing2(*p, r));
     
    184184  if (h != NULL)
    185185  {
    186     p_nDelete(&_pGetCoeff(h), r);
     186    n_Delete(&_pGetCoeff(h), r);
    187187    *p = _pNext(h);
    188188    omFreeBinAddr(h);
    189189  }
    190 
    191 }
    192 PINLINE2 void p_Free(poly p, ring r)
     190}
     191PINLINE2 void p_DeleteLm(poly p, ring r)
     192{
     193  pIfThen2(p != NULL, p_CheckPolyRing2(p, r));
     194  if (p != NULL)
     195  {
     196    n_Delete(&_pGetCoeff(p), r);
     197    omFreeBinAddr(p);
     198  }
     199}
     200PINLINE2 void p_LmFree(poly p, ring r)
    193201{
    194202  p_CheckPolyRing2(p, r);
    195203  omFreeBinAddr(p);
    196204}
    197 PINLINE2 poly p_FreeAndNext(poly p, ring r)
    198 {
    199   p_CheckPolyRing2(p, r);
    200   poly pnext = _pNext(p);
     205PINLINE2 void p_LmFree(poly *p, ring r)
     206{
     207  p_CheckPolyRing2(*p, r);
     208  poly h = *p;
     209  *p = pNext(h);
     210  omFreeBinAddr(h);
     211}
     212PINLINE2 poly p_LmFreeAndNext(poly p, ring r)
     213{
     214  p_CheckPolyRing2(p, r);
     215  poly pnext = pNext(p);
    201216  omFreeBinAddr(p);
    202217  return pnext;
     
    205220{
    206221  p_CheckPolyRing2(p, r);
    207   p_nDelete(&_pGetCoeff(p), r);
     222  n_Delete(&_pGetCoeff(p), r);
    208223  omFreeBinAddr(p);
    209224}
     225PINLINE2 void p_LmDelete(poly *p, ring r)
     226{
     227  p_CheckPolyRing2(*p, r);
     228  poly h = *p;
     229  *p = pNext(h);
     230  n_Delete(&pGetCoeff(h), r);
     231  omFreeBinAddr(h);
     232}
    210233PINLINE2 poly p_LmDeleteAndNext(poly p, ring r)
    211234{
    212235  p_CheckPolyRing2(p, r);
    213236  poly pnext = _pNext(p);
    214   p_nDelete(&_pGetCoeff(p), r);
     237  n_Delete(&_pGetCoeff(p), r);
    215238  omFreeBinAddr(p);
    216239  return pnext;
     
    369392  int shorter;
    370393  number n_old = pGetCoeff(m);
    371   number n_neg = p_nCopy(n_old, r);
    372   n_neg = p_nNeg(n_neg, r);
     394  number n_neg = n_Copy(n_old, r);
     395  n_neg = n_Neg(n_neg, r);
    373396  pSetCoeff0(m, n_neg);
    374397
    375398  res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, NULL, r);
    376399  pSetCoeff0(m, n_old);
    377   p_nDelete(&n_neg, r);
     400  n_Delete(&n_neg, r);
    378401  return res;
    379402}
  • Singular/p_Add_q__Template.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Add_q__Template.cc,v 1.2 2000-09-12 16:01:05 obachman Exp $
     9 *  Version: $Id: p_Add_q__Template.cc,v 1.3 2000-09-18 09:19:25 obachman Exp $
    1010 *******************************************************************/
    1111
     
    1919poly p_Add_q(poly p, poly q, int &Shorter, const ring r)
    2020{
    21   pTest(p);
    22   pTest(q);
    23 #ifdef PDEBUG
     21  p_Test(p, r);
     22  p_Test(q, r);
     23#if PDEBUG > 0
    2424  int l = pLength(p) + pLength(q);
    2525#endif
     
    3838
    3939  Top:     // compare p and q w.r.t. monomial ordering
    40   p_MemCmp(p->exp, q->exp, length, ordsgn, goto Equal, goto Greater , goto Smaller );
     40  p_MemCmp(p->exp, q->exp, length, ordsgn, goto Equal, goto Greater , goto Smaller);
    4141
    4242  Equal:
    4343  n1 = pGetCoeff(p);
    4444  n2 = pGetCoeff(q);
    45   t = p_nAdd(n1,n2, r);
    46   p_nDelete(&n1, r);
    47   p_nDelete(&n2, r);
    48   FreeAndAdvance(q);
     45  t = n_Add(n1,n2, r);
     46  n_Delete(&n1, r);
     47  n_Delete(&n2, r);
     48  q = p_LmFreeAndNext(q, r);
    4949 
    50   if (p_nIsZero(t, r))
     50  if (n_IsZero(t, r))
    5151  {
    5252    shorter += 2;
    53     p_nDelete(&t, r);
    54     FreeAndAdvance(p);
     53    n_Delete(&t, r);
     54    p = p_LmFreeAndNext(p, r);
    5555  }
    5656  else
     
    8181  Shorter = shorter;
    8282
    83   pTest(pNext(&rp));
    84 #ifdef PDEBUG 
    85   assume(l - pLength(pNext(&rp)) == Shorter);
     83  p_Test(pNext(&rp), r);
     84#if PDEBUG > 0
     85  pAssume1(l - pLength(pNext(&rp)) == Shorter);
    8686#endif 
    8787  return pNext(&rp);
  • Singular/p_Copy__Template.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Copy__Template.cc,v 1.2 2000-09-12 16:01:06 obachman Exp $
     9 *  Version: $Id: p_Copy__Template.cc,v 1.3 2000-09-18 09:19:25 obachman Exp $
    1010 *******************************************************************/
    1111
    1212poly p_Copy(poly s_p, const ring r)
    1313{
    14   pTest(s_p);
     14  // let's not do tests here -- but instead allow
     15  // to be sloppy
    1516  spolyrec dp;
    1617  poly d_p = &dp;
     
    2223  while (s_p != NULL)
    2324  {
    24     omTypeAllocBin(poly, pNext(d_p), bin);
     25    p_AllocBin(pNext(d_p), bin, r);
    2526    pIter(d_p);
    26     pSetCoeff0(d_p, p_nCopy(pGetCoeff(s_p), r));
     27    pSetCoeff0(d_p, n_Copy(pGetCoeff(s_p), r));
    2728    // it is better to iter here,
    2829    // for MemCopy advances goes from low to high addresses
     
    3334  pNext(d_p) = NULL;
    3435
    35   pTest(dp.next);
    36 #if PDEBUG
    37   assume(pEqual(s_p, dp.next));
    38 #endif
    3936  return dp.next;
    4037}
  • Singular/p_Delete__Template.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Delete__Template.cc,v 1.1 2000-08-24 14:42:43 obachman Exp $
     9 *  Version: $Id: p_Delete__Template.cc,v 1.2 2000-09-18 09:19:25 obachman Exp $
    1010 *******************************************************************/
    1111
     
    1616  while (p != NULL)
    1717  {
    18     p_nDelete(&(p->coef), r);
    19     FreeAndAdvance(p);
     18    n_Delete(&(p->coef), r);
     19    p = p_LmFreeAndNext(p, r);
    2020  }
    2121  *pp = NULL;
  • Singular/p_Minus_mm_Mult_qq__Template.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Minus_mm_Mult_qq__Template.cc,v 1.2 2000-09-12 16:01:06 obachman Exp $
     9 *  Version: $Id: p_Minus_mm_Mult_qq__Template.cc,v 1.3 2000-09-18 09:19:26 obachman Exp $
    1010 *******************************************************************/
    1111
     
    2020poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, int& Shorter, const poly spNoether, const ring r)
    2121{
    22   pTest(p);
    23   pTest(q);
     22  p_Test(p, r);
     23  p_Test(q, r);
     24  p_LmTest(m, r);
     25
     26#if PDEBUG > 0
     27  int l_debug = pLength(p) + pLength(q);
     28#endif
     29
    2430  Shorter = 0;
    2531  // we are done if q == NULL || m == NULL
     
    2733 
    2834  spolyrec rp;
    29   poly a = &rp,                       // collects the result
     35  poly a = &rp,                    // collects the result
    3036    qm = NULL,                     // stores q*m
    3137    c;                             // used for temporary storage
     
    3339
    3440  number tm   = pGetCoeff(m),           // coefficient of m
    35     tneg = p_nNeg(p_nCopy(tm, r), r),    // - (coefficient of m)
     41    tneg = n_Neg(n_Copy(tm, r), r),    // - (coefficient of m)
    3642    tb,                            // used for tm*coeff(a1)
    3743    tc;                            // used as intermediate number
     
    4753  if (p == NULL) goto Finish;           // return tneg*q if (p == NULL)
    4854 
    49   omTypeAllocBin(poly, qm, bin);
    50   assume(pGetComp(q) == 0 || pGetComp(m) == 0);
     55  pAssume(p_GetComp(q, r) == 0 || p_GetComp(m, r) == 0);
     56
     57  AllocTop:
     58  p_AllocBin(qm, bin, r);
     59  SumTop:
    5160  p_MemSum(qm->exp, q->exp, m_e, length);
    52  
    53   // MAIN LOOP:
    54   Top:     
     61  CmpTop:     
    5562  // compare qm = m*q and p w.r.t. monomial ordering
    5663  p_MemCmp(qm->exp, p->exp, length, ordsgn, goto Equal, goto Greater, goto Smaller );
    5764 
    5865  Equal:   // qm equals p
    59   tb = p_nMult(pGetCoeff(q), tm, r);
     66  tb = n_Mult(pGetCoeff(q), tm, r);
    6067  tc = pGetCoeff(p);
    61   if (!p_nEqual(tc, tb, r))
     68  if (!n_Equal(tc, tb, r))
    6269  {
    6370    shorter++;
    64     tc = p_nSub(tc, tb, r);
    65     p_nDelete(&(pGetCoeff(p)), r);
     71    tc = n_Sub(tc, tb, r);
     72    n_Delete(&(pGetCoeff(p)), r);
    6673    pSetCoeff0(p,tc); // adjust coeff of p
    6774    a = pNext(a) = p; // append p to result and advance p
     
    7178  { // coeffs are equal, so their difference is 0:
    7279    shorter += 2;
    73     p_nDelete(&tc, r);
    74     FreeAndAdvance(p);
     80    n_Delete(&tc, r);
     81    p = p_LmFreeAndNext(p, r);
    7582  }
    76   p_nDelete(&tb, r);
     83  n_Delete(&tb, r);
    7784  pIter(q);
    7885  if (q == NULL || p == NULL) goto Finish; // are we done ?
    7986  // no, so update qm
    80   p_MemSum(qm->exp, q->exp, m_e, length);
    81   goto Top;
    82 
     87  goto SumTop;
     88 
    8389
    8490  Greater:
    85   pSetCoeff0(qm, p_nMult(pGetCoeff(q), tneg, r));
     91  pSetCoeff0(qm, n_Mult(pGetCoeff(q), tneg, r));
    8692  a = pNext(a) = qm;       // append qm to result and advance q
    8793  pIter(q);
     
    9298  }
    9399  // construct new qm
    94   omTypeAllocBin(poly, qm, bin);
    95   p_MemSum(qm->exp, q->exp, m_e, length);
    96   goto Top;
     100  goto AllocTop;
    97101   
    98102  Smaller:     
     
    100104  pIter(p);
    101105  if (p == NULL) goto Finish;;
    102   goto Top;
     106  goto CmpTop;
    103107 
    104108
    105109  Finish: // q or p is NULL: Clean-up time
    106 
    107110  if (q == NULL) // append rest of p to result
    108111    pNext(a) = p;
     
    114117  }
    115118   
    116   p_nDelete(&tneg, r);
    117   if (qm != NULL) omFreeBinAddr(qm);
     119  n_Delete(&tneg, r);
     120  if (qm != NULL) p_FreeBinAddr(qm, r);
    118121  Shorter = shorter;
    119   pTest(pNext(&rp));
     122  p_Test(pNext(&rp), r);
    120123  return pNext(&rp);
    121124}
  • Singular/p_Mult_mm__Template.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Mult_mm__Template.cc,v 1.3 2000-09-12 16:01:07 obachman Exp $
     9 *  Version: $Id: p_Mult_mm__Template.cc,v 1.4 2000-09-18 09:19:26 obachman Exp $
    1010 *******************************************************************/
    1111
     
    1919poly p_Mult_mm(poly p, const poly m, const ring ri)
    2020{
    21   pTest(p);
     21  p_Test(p, ri);
     22  p_LmTest(m, ri);
    2223  if (p == NULL) return NULL;
     24  pAssume(m != NULL);
    2325  poly q = p;
    2426  number ln = pGetCoeff(m);
    2527  DECLARE_LENGTH(const unsigned long length = ri->ExpLSize);
    2628  const unsigned long* m_e = m->exp;
    27   assume(!p_nIsZero(ln,r));
     29  pAssume(!n_IsZero(ln,ri));
    2830
    2931  while (p != NULL)
    3032  {
    31     pSetCoeff0(p, p_nMult(ln, pGetCoeff(p), ri));
     33    pSetCoeff0(p, n_Mult(ln, pGetCoeff(p), ri));
    3234    p_MemAdd(p->exp, m_e, length);
    3335    p = pNext(p);
    3436  }
    35   pTest(q);
     37  p_Test(q, ri);
    3638  return q;
    3739}
  • Singular/p_Mult_nn__Template.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Mult_nn__Template.cc,v 1.1 2000-08-29 14:10:27 obachman Exp $
     9 *  Version: $Id: p_Mult_nn__Template.cc,v 1.2 2000-09-18 09:19:26 obachman Exp $
    1010 *******************************************************************/
    1111
     
    1919poly p_Mult_nn(poly p, const number n, const ring r)
    2020{
    21   assume(!p_nIsZero(n,r));
    22   pTest(p);
     21  pAssume(!n_IsZero(n,r));
     22  p_Test(p, r);
    2323 
    2424  poly q = p;
     
    2626  {
    2727    number nc = pGetCoeff(p);
    28     pSetCoeff0(p, p_nMult(n, nc, r));
    29     p_nDelete(&nc, r);
     28    pSetCoeff0(p, n_Mult(n, nc, r));
     29    n_Delete(&nc, r);
    3030    pIter(p);
    3131  }
    32   pTest(q);
     32  p_Test(q, r);
    3333  return q;
    3434}
  • Singular/p_Mult_q.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Mult_q.cc,v 1.4 2000-09-14 13:04:39 obachman Exp $
     9 *  Version: $Id: p_Mult_q.cc,v 1.5 2000-09-18 09:19:26 obachman Exp $
    1010 *******************************************************************/
    1111#include "mod2.h"
     
    1717 * Assumes: pLength(p) >= 2 pLength(q) >=2
    1818 ***************************************************************/
    19 #include "polys.h"
     19#include "p_polys.h"
    2020#include "p_Procs.h"
    2121#include "p_Numbers.h"
     
    2525{
    2626  assume(p != NULL && pNext(p) != NULL && q != NULL && pNext(q) != NULL);
    27   pAssume(! pHaveCommonMonoms(p, q));
    28   pTest(p);
    29   pTest(q);
     27  pAssume1(! pHaveCommonMonoms(p, q));
     28  p_Test(p, r);
     29  p_Test(q, r);
    3030
    3131  poly res = pp_Mult_mm(p,q,r);     // holds initially q1*p
     
    6868  Equal:
    6969  n1 = pGetCoeff(rn);
    70   n = p_nAdd(n1, pGetCoeff(qn), r);
    71   p_nDelete(&n1, r);
    72   if (p_nIsZero(n, r))
     70  n = n_Add(n1, pGetCoeff(qn), r);
     71  n_Delete(&n1, r);
     72  if (n_IsZero(n, r))
    7373  {
    74     p_nDelete(&n, r);
    75     rn = pFreeAndNext(rn);
     74    n_Delete(&n, r);
     75    rn = p_LmFreeAndNext(rn, r);
    7676  }
    7777  else
     
    8181    pIter(rn);
    8282  }
    83   p_nDelete(&pGetCoeff(qn),r);
    84   qn = pFreeAndNext(qn);
     83  n_Delete(&pGetCoeff(qn),r);
     84  qn = p_LmFreeAndNext(qn, r);
    8585  goto Work;
    8686 
     
    9191    p_Delete(&q, r);
    9292  }
    93   pTest(res);
     93  p_Test(res, r);
    9494  return res;
    9595}
  • Singular/p_Neg__Template.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Neg__Template.cc,v 1.1 2000-08-29 14:10:27 obachman Exp $
     9 *  Version: $Id: p_Neg__Template.cc,v 1.2 2000-09-18 09:19:27 obachman Exp $
    1010 *******************************************************************/
    1111
     
    2121  while (p != NULL)
    2222  {
    23     pSetCoeff0(p, p_nNeg(pGetCoeff(p), r));
     23    pSetCoeff0(p, n_Neg(pGetCoeff(p), r));
    2424    pIter(p);
    2525  }
  • Singular/p_Numbers.h

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Numbers.h,v 1.2 2000-09-12 16:01:07 obachman Exp $
     9 *  Version: $Id: p_Numbers.h,v 1.3 2000-09-18 09:19:27 obachman Exp $
    1010 *******************************************************************/
    1111#ifndef P_NUMBERS_H
     
    1313
    1414#include "numbers.h"
    15 #define p_nCopy_FieldGeneral(n, r)          nCopy(n)
    16 #define p_nDelete_FieldGeneral(n, r)        nDelete(n)
    17 #define p_nMult_FieldGeneral(n1, n2, r)     nMult(n1, n2)
    18 #define p_nAdd_FieldGeneral(n1, n2, r)      nAdd(n1, n2)
    19 #define p_nIsZero_FieldGeneral(n, r)        nIsZero(n)
    20 #define p_nEqual_FieldGeneral(n1, n2, r)    nEqual(n1, n2)
    21 #define p_nNeg_FieldGeneral(n, r)               nNeg(n)
    22 #define p_nSub_FieldGeneral(n1, n2, r)      nSub(n1, n2)
     15#define n_Copy_FieldGeneral(n, r)           nCopy(n)
     16#define n_Delete_FieldGeneral(n, r)         nDelete(n)
     17#define n_Mult_FieldGeneral(n1, n2, r)      nMult(n1, n2)
     18#define n_Add_FieldGeneral(n1, n2, r)       nAdd(n1, n2)
     19#define n_IsZero_FieldGeneral(n, r)             nIsZero(n)
     20#define n_Equal_FieldGeneral(n1, n2, r)     nEqual(n1, n2)
     21#define n_Neg_FieldGeneral(n, r)                nNeg(n)
     22#define n_Sub_FieldGeneral(n1, n2, r)       nSub(n1, n2)
    2323
    2424#include "modulop.h"
    25 #define p_nCopy_FieldZp(n, r)       n
    26 #define p_nDelete_FieldZp(n, r)     ((void)0)
    27 #define p_nMult_FieldZp(n1, n2, r)  npMultM(n1,n2)
    28 #define p_nAdd_FieldZp(n1, n2, r)   npAddM(n1, n2)
    29 #define p_nIsZero_FieldZp(n, r)     npIsZeroM(n)
    30 #define p_nEqual_FieldZp(n1, n2, r) npEqualM(n1, n2)
    31 #define p_nNeg_FieldZp(n, r)        npNegM(n)
    32 #define p_nSub_FieldZp(n1, n2, r)   npSubM(n1, n2)
     25#define n_Copy_FieldZp(n, r)        n
     26#define n_Delete_FieldZp(n, r)      ((void)0)
     27#define n_Mult_FieldZp(n1, n2, r)   npMultM(n1,n2)
     28#define n_Add_FieldZp(n1, n2, r)    npAddM(n1, n2)
     29#define n_IsZero_FieldZp(n, r)      npIsZeroM(n)
     30#define n_Equal_FieldZp(n1, n2, r) npEqualM(n1, n2)
     31#define n_Neg_FieldZp(n, r)             npNegM(n)
     32#define n_Sub_FieldZp(n1, n2, r)    npSubM(n1, n2)
    3333
    3434#endif
  • Singular/p_Procs.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Procs.cc,v 1.7 2000-09-14 15:06:33 obachman Exp $
     9 *  Version: $Id: p_Procs.cc,v 1.8 2000-09-18 09:19:27 obachman Exp $
    1010 *******************************************************************/
    1111#include <string.h>
     
    499499 ***************************************************************/
    500500#include "structs.h"
     501#include "p_polys.h"
    501502#include "ring.h"
    502 #include "polys.h"
    503 #include "polys-impl.h"
    504503#include "p_Procs.h"
    505504#include "p_Numbers.h"
     
    507506#include "p_MemAdd.h"
    508507#include "p_MemCopy.h"
    509 #ifndef TEST_P_PROCS
    510 #undef pTest
    511 #define pTest(p) ((void)0)
    512 #endif
    513 
    514 #define FreeAndAdvance(p)                       \
    515 do                                              \
    516 {                                               \
    517   poly _pn = pNext(p);                          \
    518   omFreeBinAddr(p);                             \
    519   p = _pn;                                      \
    520 }                                               \
    521 while (0)
    522508
    523509#include "p_Procs.inc"
     
    698684}
    699685
    700 const char* macros_field[] = {"p_nCopy","p_nDelete", "p_nMult", "p_nAdd", "p_nSub", "p_nIsZero", "p_nEqual" , "p_nNeg", NULL};
     686const char* macros_field[] = {"n_Copy","n_Delete", "n_Mult", "n_Add", "n_Sub", "n_IsZero", "n_Equal" , "n_Neg", NULL};
    701687
    702688const char* macros_length[] =
  • Singular/p_Procs.h

    rf3398d r512a2b  
    88 *  Author:  obachman (Olaf Bachmann)
    99 *  Created: 8/00
    10  *  Version: $Id: p_Procs.h,v 1.4 2000-09-12 16:01:07 obachman Exp $
     10 *  Version: $Id: p_Procs.h,v 1.5 2000-09-18 09:19:27 obachman Exp $
    1111 *******************************************************************/
    1212#ifndef P_PROCS_H
    1313#define P_PROCS_H
    1414#include "structs.h"
    15 
    16 // define/undef P_INLINE to inline some procedures
    17 #undef NO_P_INLINE
    18 #if defined(NDEBUG) && !defined(NO_INLINE)
    19 #define P_INLINE inline
    20 #else
    21 #define NO_P_INLINE 1
    22 #define P_INLINE
    23 #endif
    24 
    25 
    26 // NOTE: the actual procedures below are not inlined,
    27 // only the dispatching function call
    28 
    29 /*------------- Allocation/Deletion ----------------------*/
    30 
    31 /*------------- comparisons ----------------------*/
    32 // returns 1 if Lm(p) > Lm(q)
    33 //         0 if Lm(p) = Lm(q)
    34 //        -1 if Lm(p) < Lm(q)
    35 // assumes p != NULL && q != NULL
    36 P_INLINE int p_LmCmp(const poly p, const poly q, const ring r = currRing);
    37 
    38 /*------------- Arithmetic operations ----------------------*/
    3915
    4016/*------------- p_Proc stuff ----------------------*/
     
    7551#endif
    7652
    77 #include "p_Inline.cc"
    78 
    7953#endif /* ! P_PROCS_H */
  • Singular/p_ShallowCopyDelete__Template.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_ShallowCopyDelete__Template.cc,v 1.2 2000-09-12 16:01:08 obachman Exp $
     9 *  Version: $Id: p_ShallowCopyDelete__Template.cc,v 1.3 2000-09-18 09:19:28 obachman Exp $
    1010 *******************************************************************/
    1111
     
    2727  while (s_p != NULL)
    2828  {
    29     omTypeAllocBin(poly, d_p->next, d_bin);
     29    p_AllocBin( d_p->next, d_bin, r);
    3030    pIter(d_p);
    3131    pSetCoeff0(d_p, pGetCoeff(s_p));
     
    3333    s_p =  pNext(s_p);
    3434    p_MemCopy(d_p->exp, h->exp, length);
    35     omFreeBinAddr(h);
     35    p_FreeBinAddr(h, r);
    3636  }
    3737  pNext(d_p) = NULL;
  • Singular/pcv.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: pcv.cc,v 1.30 2000-09-12 16:01:08 obachman Exp $ */
     4/* $Id: pcv.cc,v 1.31 2000-09-18 09:19:28 obachman Exp $ */
    55/*
    66* ABSTRACT: conversion between polys and coef vectors
     
    244244  else
    245245  {
    246     pDelete1(&m);
     246    pDeleteLm(&m);
    247247    return NULL;
    248248  }
     
    439439  for(int d=d0,i=0;d<d1;d++)
    440440    i=pcvBasis(b,i,m,d,1);
    441   pDelete1(&m);
     441  pDeleteLm(&m);
    442442  return b;
    443443}
  • Singular/polys-impl.h

    rf3398d r512a2b  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys-impl.h,v 1.55 2000-09-14 15:06:34 obachman Exp $ */
     6/* $Id: polys-impl.h,v 1.56 2000-09-18 09:19:29 obachman Exp $ */
    77
    88/***************************************************************
     
    183183#define pPolyAssumeReturn1   pPolyAssumeReturn
    184184#define _pPolyAssumeReturn1  _pPolyAssumeReturn
    185 #define p_SetRingOfPoly1    p_SetRingOfPoly
    186185#define p_CheckPolyRing1    p_CheckPolyRing
    187186#define p_CheckRing1        p_CheckRing
     
    194193#define pPolyAssumeReturn1(cond)     ((void)0)
    195194#define _pPolyAssumeReturn1(cond,p,r)((void)0)
    196 #define p_SetRingOfPoly1(p,r)       ((void)0)
    197195#define p_CheckPolyRing1(p,r)       ((void)0)
    198196#define p_CheckRing1(r)             ((void)0)
     
    207205#define pPolyAssumeReturn2   pPolyAssumeReturn
    208206#define _pPolyAssumeReturn2  _pPolyAssumeReturn
    209 #define p_SetRingOfPoly2    p_SetRingOfPoly
    210207#define p_CheckPolyRing2    p_CheckPolyRing
    211208#define p_CheckRing2        p_CheckRing
     
    218215#define pPolyAssumeReturn2(cond)     ((void)0)
    219216#define _pPolyAssumeReturn2(cond,p,r)((void)0)
    220 #define p_SetRingOfPoly2(p,r)       ((void)0)
    221217#define p_CheckPolyRing2(p,r)       ((void)0)
    222218#define p_CheckRing2(r)             ((void)0)
     
    238234#define _p_GetComp(p, r)    ((long) (r->pCompIndex >= 0 ? __p_GetComp(p, r) : 0))
    239235
    240 
    241 
    242 
     236/***************************************************************
     237 *
     238 * Macros for low-level allocation
     239 *
     240 ***************************************************************/
     241#ifdef PDEBUG
     242#define p_AllocBin(p, bin, r)                   \
     243do                                              \
     244{                                               \
     245  omTypeAllocBin(poly, p, bin);                 \
     246  p_SetRingOfPoly(p, r);                        \
     247}                                               \
     248while (0)
     249#define p_FreeBinAddr(p, r) p_LmFree(p, r)
     250#else
     251#define p_AllocBin(p, bin, r)   omTypeAllocBin(poly, p, bin)
     252#define p_FreeBinAddr(p, r)     omFreeBinAddr(p)
     253#endif
    243254
    244255/***************************************************************
  • Singular/polys.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys.cc,v 1.61 2000-09-13 13:16:40 Singular Exp $ */
     4/* $Id: polys.cc,v 1.62 2000-09-18 09:19:29 obachman Exp $ */
    55
    66/*
     
    1414#include "mod2.h"
    1515#include "tok.h"
    16 #include <omalloc.h>
     16#include "omalloc.h"
    1717#include "febase.h"
    1818#include "numbers.h"
     
    827827      if (prev==NULL)
    828828      {
    829         pDelete1(&result);
     829        pDeleteLm(&result);
    830830        a=result;
    831831      }
    832832      else
    833833      {
    834         pDelete1(&pNext(prev));
     834        pDeleteLm(&pNext(prev));
    835835        a=pNext(prev);
    836836      }
     
    902902done:
    903903  ok=!errorreported;
    904   if (nIsZero(pGetCoeff(rc))) pDelete1(&rc);
     904  if (nIsZero(pGetCoeff(rc))) pDeleteLm(&rc);
    905905  else
    906906  {
     
    12861286  poly q;
    12871287
    1288   while ((*p!=NULL) && (pGetComp(*p)==k)) pDelete1(p);
     1288  while ((*p!=NULL) && (pGetComp(*p)==k)) pDeleteLm(p);
    12891289  if (*p==NULL) return;
    12901290  q = *p;
     
    12971297  {
    12981298    if (pGetComp(pNext(q))==k)
    1299       pDelete1(&(pNext(q)));
     1299      pDeleteLm(&(pNext(q)));
    13001300    else
    13011301    {
     
    13291329
    13301330
    1331 /* Hmm ... this should be inlined or made more efficient:
    1332    see Long/mregular.tst */
    1333 /*2
    1334 *should return 1 if p divides q and p<q,
    1335 *             -1 if q divides p and q<p
    1336 *              0 otherwise
    1337 */
    1338 int     pDivComp(poly p, poly q)
    1339 {
    1340   if (pGetComp(p) == pGetComp(q))
    1341   {
    1342     int i=pVariables;
    1343     long d;
    1344     BOOLEAN a=FALSE, b=FALSE;
    1345     for (; i>0; i--)
    1346     {
    1347       d = pGetExpDiff(p, q, i);
    1348       if (d)
    1349       {
    1350         if (d < 0)
    1351         {
    1352           if (b) return 0;
    1353           a =TRUE;
    1354         }
    1355         else
    1356         {
    1357           if (a) return 0;
    1358           b = TRUE;
    1359         }
    1360       }
    1361     }
    1362     if (a) return 1;
    1363     else if (b)  return -1;
    1364   }
    1365   return 0;
    1366 }
    13671331/*2
    13681332*divides p1 by its leading monomial
     
    15251489    if (pGetExp(pNext(h),n)!=0)
    15261490    {
    1527       pDelete1(&pNext(h));
     1491      pDeleteLm(&pNext(h));
    15281492    }
    15291493    else
     
    15801544      res=pAdd(res,m);
    15811545    }
    1582     pDelete1(&h);
     1546    pDeleteLm(&h);
    15831547  }
    15841548  omFreeSize((ADDRESS)me,(pVariables+1)*sizeof(Exponent_t));
  • Singular/polys.h

    rf3398d r512a2b  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys.h,v 1.37 2000-09-14 13:04:40 obachman Exp $ */
     6/* $Id: polys.h,v 1.38 2000-09-18 09:19:30 obachman Exp $ */
    77/*
    8 * ABSTRACT - all basic methods to manipulate polynomials
     8* ABSTRACT - all basic methods to manipulate polynomials of the
     9             currRing
    910*/
    1011
    11 #include "structs.h"
    12 #include "polys-impl.h"
    13 /***************************************************************
     12#include "p_polys.h"
     13/*
    1414 Some general remarks:
    1515 We divide poly operations into roughly 4 categories:
     
    3737          - debugging if PDEBUG >= 0
    3838
    39  You can set PDEBUG on a per-file basis, before including "mod2.h"
     39 You can set PDEBUG on a per-file basis, before including "mod2.h" like
     40   #define PDEBUG 2
     41   #include "mod2.h"
    4042 However, PDEBUG will only be in effect, if !NDEBUG.
    4143
     
    4446 just macros to the respective p_*(..,currRing).
    4547
    46  ***************************************************************/
     48*/
    4749
    4850/***************************************************************
     
    5254 *
    5355 ***************************************************************/
    54 // next
    55 #define pNext(p)            _pNext(p)
    56 #define pIter(p)            _pIter(p)
    57 
    58 // coeff
    59 #define pGetCoeff(p)        _pGetCoeff(p)
    6056// deletes old coeff before setting the new one
    6157#define pSetCoeff(p,n)      p_SetCoeff(p,n,currRing)
    62 #define pSetCoeff0(p,n)     _pSetCoeff0(p,n)
    63 #define p_GetCoeff(p,r)     _pGetCoeff(p)
    64 #define p_SetCoeff0(p,n,r)  _pSetCoeff0(p,n)
    65 PINLINE2 number p_SetCoeff(poly p, number n, ring r);
    6658
    6759// Order
    6860#define pGetOrder(p)        p_GetOrder(p, currRing)
    69 PINLINE2 Order_t p_GetOrder(poly p, ring r);
    7061// don't use this
    7162#define pSetOrder(p, o)     p_SetOrder(p, o, currRing)
    72 PINLINE2 Order_t p_SetOrder(poly p, long order, ring r);
    7363
    7464// Component
     
    7969#define pAddComp(p,v)       p_AddComp(p,v,currRing)
    8070#define pSubComp(p,v)       p_SubComp(p,v,currRing)
    81 #define p_GetComp(p, r)     _p_GetComp(p, r)
    82 PINLINE2 unsigned long p_SetComp(poly p, unsigned long c, ring r);
    83 PINLINE2 unsigned long p_IncrComp(poly p, ring r);
    84 PINLINE2 unsigned long p_DecrComp(poly p, ring r);
    85 PINLINE2 unsigned long p_AddComp(poly p, unsigned long v, ring r);
    86 PINLINE2 unsigned long p_SubComp(poly p, unsigned long v, ring r);
    8771
    8872// Exponent
     
    9478#define pSubExp(p,i,v)      p_SubExp(p,i,v, currRing)
    9579#define pMultExp(p,i,v)     p_MultExp(p,i,v, currRing)
    96 PINLINE2 Exponent_t p_GetExp(poly p, int v, ring r);
    97 PINLINE2 Exponent_t p_SetExp(poly p, int v, int e, ring r);
    98 PINLINE2 Exponent_t p_IncrExp(poly p, int v, ring r);
    99 PINLINE2 Exponent_t p_DecrExp(poly p, int v, ring r);
    100 PINLINE2 Exponent_t p_AddExp(poly p, int v, Exponent_t ee, ring r);
    101 PINLINE2 Exponent_t p_SubExp(poly p, int v, Exponent_t ee, ring r);
    102 PINLINE2 Exponent_t p_MultExp(poly p, int v, Exponent_t ee, ring r);
    103 
    104 // Gets Difference and sum of ith Exponent of m1, m2
    105 #define pGetExpSum(m1, m2, i)  p_GetExpSum(p1, p2, i, currRing)
    106 #define pGetExpDiff(p1, p2, i) p_GetExpDiff(p1, p2, i, currRing)
     80#define pGetExpSum(p1, p2, i)    p_GetExpSum(p1, p2, i, currRing)
     81#define pGetExpDiff(p1, p2, i)   p_GetExpDiff(p1, p2, i, currRing)
    10782
    10883/***************************************************************
    10984 *
    11085 * Allocation/Initalization/Deletion
    111  * except for pDelete1 and pHead, all polys must be != NULL
     86 * except for pDeleteLm and pHead, all polys must be != NULL
     87 *
    11288 ***************************************************************/
    11389// allocates the space for a new monomial -- no initialization !!!
    11490#define pNew()          p_New(currRing)
    11591// allocates a new monomial and initializes everything to 0
    116 PINLINE1 poly pInit();
    117 // like pInit, except that expvector is initialized to that of p, p must be != NULL
    118 PINLINE1 poly pInit(poly p);
    119 // returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
     92#define pInit()         p_Init(currRing)
     93// like pInit, except that expvector is initialized to that of p,
     94// p must be != NULL
     95#define pLmInit(p)  p_LmInit(p, currRing)
     96// returns newly allocated copy of Lm(p), coef is copied, next=NULL,
     97// p might be NULL
    12098#define pHead(p)        p_Head(p, currRing)
    121 // if *p_ptr != NULL, delete *p_ptr->coef, *p_ptr, and set *p_ptr to pNext(*p_ptr)
    122 #define pDelete1(p_ptr) p_Delete1(p_ptr, currRing)
     99// if *p_ptr != NULL, delete p_ptr->coef, *p_ptr, and set *p_ptr to
     100// pNext(*p_ptr)
     101static inline void pDeleteLm(poly *p) {p_DeleteLm(p, currRing);}
     102// if (p!=NULL) delete p-coef and p
     103static inline void pDeleteLm(poly p)  {p_DeleteLm(p, currRing);}
    123104// frees the space of the monomial m, assumes m != NULL
    124105// coef is not freed, m is not advanced
    125 #define pFree(m)        p_Free(m, currRing)
     106static inline void pLmFree(poly p)    {p_LmFree(p, currRing);}
     107// like pLmFree, but advances p
     108static inline void pLmFree(poly *p)   {p_LmFree(p, currRing);}
    126109// assumes p != NULL, deletes p, returns pNext(p)
    127 #define pFreeAndNext(p) p_FreeAndNext(p, currRing)
     110#define pLmFreeAndNext(p) p_LmFreeAndNext(p, currRing)
    128111// assume p != NULL, deletes Lm(p)->coef and Lm(p)
    129112#define pLmDelete(p)    p_LmDelete(p, currRing)
    130113// like pLmDelete, returns pNext(p)
    131114#define pLmDeleteAndNext(p) p_LmDeleteAndNext(p, currRing)
    132 
    133 PINLINE2 poly p_New(ring r);
    134 PINLINE1 poly p_Init(ring r);
    135 PINLINE1 poly p_Init(poly p, ring r);
    136 PINLINE1 poly p_Head(poly p, ring r);
    137 PINLINE2 void p_Delete1(poly *p, ring r);
    138 PINLINE2 void p_Free(poly p, ring r);
    139 PINLINE2 poly p_LmFreeAndNext(poly p, ring r);
    140 PINLINE2 void p_LmDelete(poly p, ring r);
    141 PINLINE2 poly p_LmDeleteAndNext(poly p, ring r);
    142115// used by iparith.cc
    143116extern poly pHeadProc(poly p);
     
    148121 *
    149122 ***************************************************************/
    150 // ExpVextor(d_p) = ExpVector(s_p)
    151 PINLINE1 void p_ExpVectorCopy(poly d_p, poly s_p, ring r);
    152 // ExpVector(p1) += ExpVector(p2)
    153 PINLINE1 void p_ExpVectorAdd(poly p1, poly p2, ring r);
    154 // ExpVector(p1) -= ExpVector(p2)
    155 PINLINE1 void p_ExpVectorSub(poly p1, poly p2, ring r);
    156 // ExpVector(pr) = ExpVector(p1) + ExpVector(p2)
    157 PINLINE1 void p_ExpVectorSum(poly pr, poly p1, poly p2, ring r);
    158 // ExpVector(pr) = ExpVector(p1) + ExpVector(p2)
    159 PINLINE1 void p_ExpVectorDiff(poly pr, poly p1, poly p2, ring r);
    160 // returns TRUE if ExpVector(p1) == ExpVector(p2), FALSE, otherwise
    161 PINLINE1 BOOLEAN p_ExpVectorEqual(poly p1, poly p2, ring r);
    162 // returns sum of all exponents
    163 PINLINE1 unsigned long p_ExpVectorQuerSum(poly p, ring r);
    164123
    165124#define pExpVectorCopy(d_p, s_p)    p_ExpVectorCopy(d_p, s_p, currRing)
     
    170129#define pExpVectorEqual(p1, p2)     p_ExpVectorEqual(p1, p2, currRing)
    171130#define pExpVectorQuerSum(p)        p_ExpVectorQuerSum(p, currRing)
    172 #define pEqual(p1, p2)              pExpVectorEqual(p1, p2)
    173 
    174 // Gets a copy of (resp. sets) the exponent vector, where e is assumed
    175 // to point to (pVariables+1)*sizeof(Exponent_t) memory. Exponents are
     131
     132// Gets a copy of (resp. set) the exponent vector, where e is assumed
     133// to point to (r->N +1)*sizeof(Exponent_t) memory. Exponents are
    176134// filled in as follows: comp, e_1, .., e_n
    177135#define pGetExpV(p, e)      p_GetExpV(p, e, currRing)
    178136#define pSetExpV(p, e)      p_SetExpV(p, e, currRing)
    179 PINLINE1 void p_GetExpV(poly p, Exponent_t *ev, ring r);
    180 PINLINE1 void p_SetExpV(poly p, Exponent_t *ev, ring r);
    181 
    182 
    183 
    184 /***************************************************************
    185  *
    186  * Operations on Lm: assumes polys != NULL
     137
     138/***************************************************************
     139 *
     140 * Comparisons: they are all done without regarding coeffs
    187141 *
    188142 ***************************************************************/
     
    193147#define pLmCmpAction(p,q, actionE, actionG, actionS)  \
    194148  _p_LmCmpAction(p,q,currRing, actionE, actionG,actionS)
    195 PINLINE1 int p_LmCmp(poly p, poly q, ring r);
    196 #define p_LmCmpAction(p, q, r, actionE, actionG, actionS) \
    197   _p_LmCmpAction(p, q, r, actionE, actionG, actionS)
    198 
    199 // returns 1 if Lm(p)=Lm(q) -- including comparison of coeff
    200 PINLINE1 BOOLEAN p_LmEqual(poly p, poly q, ring r);
    201 #define pLmEqual(p,q)       p_LmEqual(p,q,currRing)
     149
     150#define pLmEqual(p1, p2)     pExpVectorEqual(p1, p2)
    202151
    203152// pCmp: args may be NULL
    204153// returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2)))
    205154#define pCmp(p1, p2)    p_Cmp(p1, p2, currRing)
    206 PINLINE2 int p_Cmp(poly p1, poly p2, ring r);
    207155
    208156 
     
    214162 ***************************************************************/
    215163// returns TRUE, if leading monom of a divides leading monom of b
    216 // i.e., if there exists a expvector c > 0, s.t. b = a + c; assumes b != NULL
     164// i.e., if there exists a expvector c > 0, s.t. b = a + c;
    217165#define pDivisibleBy(a, b)  p_DivisibleBy(a,b,currRing)
    218 // like pDivisibleBy, except that it is assumed that a!=NULL
    219 #define pDivisibleBy1(a,b)  p_DivisibleBy1(a,b,currRing)
    220 // like pDivisibleBy1, does not check components
    221 #define pDivisibleBy2(a, b) p_DivisibleBy2(a,b,currRing)
     166// like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
     167#define pLmDivisibleBy(a,b)  p_LmDivisibleBy(a,b,currRing)
     168// like pLmDivisibleBy, does not check components
     169#define pLmDivisibleByNoComp(a, b) p_LmDivisibleByNoComp(a,b,currRing)
    222170// Divisibility tests based on Short Exponent vectors
    223171// sev_a     == pGetShortExpVector(a)
    224172// not_sev_b == ~ pGetShortExpVector(b)
    225 PINLINE1 BOOLEAN p_DivisibleBy(poly a, poly b, ring r);
    226 PINLINE1 BOOLEAN p_DivisibleBy1(poly a, poly b, ring r);
    227 PINLINE1 BOOLEAN p_DivisibleBy2(poly a, poly b, ring r);
     173#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b) \
     174  p_LmShortDivisibleBy(a, sev_a, b, not_sev_b, currRing)
    228175// returns the "Short Exponent Vector" -- used to speed up divisibility
    229176// tests (see polys-impl.cc )
    230177#define pGetShortExpVector(a)   p_GetShortExpVector(a, currRing)
    231 #define pShortDivisibleBy(a, sev_a, b, not_sev_b) \
    232   p_ShortDivisibleBy(a, sev_a, b, not_sev_b, currRing)
    233 unsigned long p_GetShortExpVector(poly a, ring r);
    234 PINLINE1 BOOLEAN p_ShortDivisibleBy(poly a, unsigned long sev_a,
    235                                     poly b, unsigned long not_sev_b, ring r);
    236178
    237179/***************************************************************
     
    242184// return a copy of the poly
    243185#define pCopy(p) p_Copy(p, currRing)
    244 // returns a copy of p
    245 PINLINE2 poly p_Copy(poly p, const ring r);
    246 // returns a copy of p with Lm(p) from lmRing and Tail(p) from tailRing
    247 PINLINE2 poly p_Copy(poly p, const ring lmRing, const ring tailRing);
    248 // deletes *p, and sets *p to NULL
    249 PINLINE2 void p_Delete(poly *p, const ring r);
    250186#define pDelete(p_ptr)  p_Delete(p_ptr, currRing)
    251 
    252187
    253188/***************************************************************
     
    261196 *
    262197 ***************************************************************/
    263 // returns -p, p is destroyed
    264 PINLINE2 poly p_Neg(poly p, const ring r);
    265 
    266 // returns p*n, p is const (i.e. copied)
    267 PINLINE2 poly pp_Mult_nn(poly p, number n, const ring r);
    268 // returns p*n, destroys p
    269 PINLINE2 poly p_Mult_nn(poly p, number n, const ring r);
    270 
    271 // returns p*m, does neither destroy p nor m
    272 PINLINE2 poly pp_Mult_mm(poly p, poly m, const ring r);
    273 // returns p*m, destroys p, const: m
    274 PINLINE2 poly p_Mult_mm(poly p, poly m, const ring r);
    275 
    276 // returns p+q, destroys p and q
    277 PINLINE2 poly p_Add_q(poly p, poly q, const ring r);
    278 // like p_Add_q, except that if lp == pLength(lp) lq == pLength(lq)
    279 // then lp == pLength(p+q)
    280 PINLINE2 poly p_Add_q(poly p, poly q, int &lp, int lq, const ring r);
    281 
    282 // return p - m*q, destroys p; const: q,m
    283 PINLINE2 poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, const ring r);
    284 // like p_Minus_mm_Mult_qq, except that if lp == pLength(lp) lq == pLength(lq)
    285 // then lp == pLength(p -m*q)
    286 PINLINE2 poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq,
    287                                  poly spNoether, const ring r);
    288 // returns p + m*q destroys p, const: q, m
    289 PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, const ring r);
    290 
    291 // returns p*q, destroys p and q
    292 PINLINE2 poly p_Mult_q(poly p, poly q, const ring r);
    293 // returns p*q, does neither destroy p nor q
    294 PINLINE2 poly pp_Mult_qq(poly p, poly q, const ring r);
    295 
    296198#define pNeg(p)                     p_Neg(p, currRing)
    297199#define ppMult_nn(p, n)             pp_Mult_nn(p, n, currRing)
     
    342244/*-----------the ordering of monomials:-------------*/
    343245#define pSetm(p)    p_Setm(p, currRing)
    344 extern void p_Setm(poly p, ring r);
    345246// TODO:
    346247#define pSetmComp   pSetm
    347 #define p_SetmComp  p_Setm
    348248
    349249extern pLDegProc pLDeg;
     
    379279poly      pDiffOp(poly a, poly b,BOOLEAN multiply);
    380280
    381 int       pLength(poly a);
    382281int       pMaxComp(poly p);
    383282int       pMinComp(poly p, ring r=currRing);
     
    385284int       pWeight(int c);
    386285#define   pSetCompP(a,i)    p_SetCompP(a, i, currRing)
    387 PINLINE0   void p_SetCompP(poly a, int i, ring r);
    388 PINLINE0   void p_SetCompP(poly a, int i, ring lmRing, ring tailRing);
    389286
    390287
     
    463360
    464361/*-----------specials for spoly-computations--------------*/
    465 int     pDivComp(poly p, poly q);
    466362BOOLEAN pCompareChain (poly p,poly p1,poly p2,poly lcm);
    467363BOOLEAN pEqualPolys(poly p1,poly p2);
    468364BOOLEAN pComparePolys(poly p1,poly p2);
    469365
    470 /*-----------Misc stuff-----------------------------------*/
    471 // reverses the monomials of p
    472 PINLINE0 poly pReverse(poly p);
    473366
    474367
     
    479372 ***************************************************************/
    480373#ifdef PDEBUG
    481 // Returns TRUE if m is monom of p, FALSE otherwise
    482 BOOLEAN pIsMonomOf(poly p, poly m);
    483 // Returns TRUE if p and q have common monoms
    484 BOOLEAN pHaveCommonMonoms(poly p, poly q);
    485 
    486 // p_Check* routines return TRUE if everything is ok,
    487 // else, they report error message and return false
    488 
    489 // check if poly p is from ring r
    490 BOOLEAN p_CheckIsFromRing(poly p, ring r);
    491 // check if p != NULL, r != NULL and initialized && p is from r
    492 BOOLEAN p_CheckPolyRing(poly p, ring r);
    493 // check if r != NULL and initialized
    494 BOOLEAN p_CheckRing(ring r);
    495 // only do check if cond
    496 #define pIfThen(cond, check) do {if (cond) {check;}} while (0)
    497 
    498 BOOLEAN _p_Test(poly p, ring r, int level);
    499 BOOLEAN _p_LmTest(poly p, ring r, int level);
    500 BOOLEAN _pp_Test(poly p, ring lmRing, ring tailRing, int level);
    501 
    502374#define pTest(p)        _p_Test(p, currRing, PDEBUG)
    503 #define p_Test(p,r)     _p_Test(p, r, PDEBUG)
    504375#define pLmTest(p)      _p_LmTest(p, currRing, PDEBUG)
    505 #define p_LmTest(p,r)   _p_LmTest(p, r, PDEBUG)
    506 #define pp_Test(p, lmRing, tailRing)    _pp_Test(p, lmRing, tailRing, PDEBUG)
    507376
    508377#else // ! PDEBUG
    509378
    510 
    511 #define pIsMonomOf(p, q)        (TRUE)
    512 #define pHaveCommonMonoms(p, q) (TRUE)
    513 #define p_CheckIsFromRing(p,r)  ((void)0)
    514 #define p_CheckPolyRing(p,r)    ((void)0)
    515 #define p_CheckRing(r)          ((void)0)
    516 #define P_CheckIf(cond, check)  ((void)0)
    517 
    518379#define pTest(p)        ((void)0)
    519 #define p_Test(p,r)     ((void)0)
    520380#define pLmTest(p)      ((void)0)
    521 #define p_LmTest(p,r)   ((void)0)
    522 #define pp_Test(p, lmRing, tailRing) ((void)0)
    523 
    524381#endif
    525382
    526383#endif // POLYS_H
    527384
    528 #include "pInline2.h"
    529 #include "pInline1.h"
  • Singular/polys1.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys1.cc,v 1.45 2000-09-12 16:01:12 obachman Exp $ */
     4/* $Id: polys1.cc,v 1.46 2000-09-18 09:19:30 obachman Exp $ */
    55
    66/*
     
    1515#include "tok.h"
    1616#include "numbers.h"
    17 #include <omalloc.h>
     17#include "omalloc.h"
    1818#include "febase.h"
    1919#include "weight.h"
     
    302302    pMonMult(b,tail);
    303303  }
    304   pDelete1(&tail);
     304  pDeleteLm(&tail);
    305305  pNext(res) = b;
    306306  pNext(b) = NULL;
     
    313313//   if(nIsZero(pGetCoeff(pNext(tail))))
    314314//   {
    315 //     pDelete1(&pNext(tail));
     315//     pDeleteLm(&pNext(tail));
    316316//   }
    317317//   else
     
    455455    if (pGetExp(a,k)!=0)
    456456    {
    457       f = pInit(a);
     457      f = pLmInit(a);
    458458      t = nInit(pGetExp(a,k));
    459459      pSetCoeff0(f,nMult(t,pGetCoeff(a)));
    460460      nDelete(&t);
    461461      if (nIsZero(pGetCoeff(f)))
    462         pDelete1(&f);
     462        pDeleteLm(&f);
    463463      else
    464464      {
     
    493493    {
    494494      nDelete(&n);
    495       pDelete1(&p);
     495      pDeleteLm(&p);
    496496      return NULL;
    497497    }
     
    653653    pSetCoeff0(rc,nInit(i));
    654654    if (nIsZero(pGetCoeff(rc)))
    655       pDelete1(&rc);
     655      pDeleteLm(&rc);
    656656  }
    657657  return rc;
     
    10161016    if (nIsZero(pGetCoeff(qq)))
    10171017    {
    1018       pDelete1(&qq);
     1018      pDeleteLm(&qq);
    10191019    }
    10201020    else
     
    10421042          {
    10431043            /* this variable maps to 0 !*/
    1044             pDelete1(&qq);
     1044            pDeleteLm(&qq);
    10451045            break;
    10461046          }
     
    13331333  while ((p1 != NULL) && (p2 != NULL))
    13341334  {
    1335     /* p1 and p2 are non-NULL, so we may use pLmCmp instead of pComp */
    13361335    if (! pLmEqual(p1, p2))
    1337        return FALSE;
     1336      return FALSE;
     1337    if (! nEqual(pGetCoeff(p1), pGetCoeff(p2)))
     1338      return FALSE;
    13381339    pIter(p1);
    13391340    pIter(p2);
     
    13501351  number n,nn;
    13511352  int i;
    1352 
    1353   if (!pEqual(p1,p2)) //compare leading mons
     1353  pAssume(p1 != NULL && p2 != NULL);
     1354 
     1355  if (!pLmEqual(p1,p2)) //compare leading mons
    13541356      return FALSE;
    13551357  if ((pNext(p1)==NULL) && (pNext(p2)!=NULL))
     
    13621364  while ((p1 != NULL) /*&& (p2 != NULL)*/)
    13631365  {
    1364     if ( ! pEqual(p1, p2))
     1366    if ( ! pLmEqual(p1, p2))
    13651367    {
    13661368        nDelete(&n);
  • Singular/pp_Mult_mm__Template.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pp_Mult_mm__Template.cc,v 1.2 2000-09-12 16:01:12 obachman Exp $
     9 *  Version: $Id: pp_Mult_mm__Template.cc,v 1.3 2000-09-18 09:19:31 obachman Exp $
    1010 *******************************************************************/
    1111
     
    2020poly pp_Mult_mm(poly p, const poly m, const poly spNoether, const ring ri)
    2121{
     22  p_Test(p, ri);
     23  p_LmTest(p, ri);
    2224  if (p == NULL) return NULL;
    2325  spolyrec rp;
     
    2729  DECLARE_LENGTH(const unsigned long length = ri->ExpLSize);
    2830  const unsigned long* m_e = m->exp;
    29   assume(!p_nIsZero(ln,r));
     31  pAssume(!n_IsZero(ln,r));
    3032
    3133  if (spNoether == NULL)
     
    3335    do
    3436    {
    35       omTypeAllocBin(poly, pNext(q), bin);
     37      p_AllocBin( pNext(q), bin, ri);
    3638      q = pNext(q);
    37       pSetCoeff0(q, p_nMult(ln, pGetCoeff(p), ri));
     39      pSetCoeff0(q, n_Mult(ln, pGetCoeff(p), ri));
    3840      p_MemSum(q->exp, p->exp, m_e, length);
    3941      p = pNext(p);
     
    4648    while (p != NULL)
    4749    {
    48       omTypeAllocBin(poly, r, bin);
     50      p_AllocBin( r, bin, ri);
    4951      p_MemSum(r->exp, p->exp, m_e, length);
    5052
    5153      if (p_LmCmp(r, spNoether, ri) == -1)
    5254      {
    53         omFreeBinAddr(r);
     55        p_FreeBinAddr(r, ri);
    5456        break;
    5557      }
    5658      q = pNext(q) = r;
    57       pSetCoeff0(q, p_nMult(ln, pGetCoeff(p), ri));
     59      pSetCoeff0(q, n_Mult(ln, pGetCoeff(p), ri));
    5860      pIter(p);
    5961    }
    6062  }
    6163  pNext(q) = NULL;
    62 
     64 
     65  p_Test(pNext(&rp), ri);
    6366  return pNext(&rp);
    6467}
  • Singular/pp_Mult_nn__Template.cc

    rf3398d r512a2b  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: pp_Mult_nn__Template.cc,v 1.2 2000-09-12 16:01:13 obachman Exp $
     9 *  Version: $Id: pp_Mult_nn__Template.cc,v 1.3 2000-09-18 09:19:31 obachman Exp $
    1010 *******************************************************************/
    1111
     
    1818poly pp_Mult_nn(poly p, const number n, const ring r)
    1919{
    20   assume(!p_nIsZero(n,r));
    21   pTest(p);
     20  pAssume(!n_IsZero(n,r));
     21  p_Test(p, r);
    2222  if (p == NULL) return NULL;
    2323  spolyrec rp;
     
    2828  do
    2929  {
    30     omTypeAllocBin(poly, pNext(q), bin);
     30    p_AllocBin(pNext(q), bin, r);
    3131    q = pNext(q);
    3232    number nc = pGetCoeff(p);
    33     pSetCoeff0(q, p_nMult(n, nc, r));
     33    pSetCoeff0(q, n_Mult(n, nc, r));
    3434    p_MemCopy(q->exp, p->exp, length);
    3535    pIter(p);
     
    3838  pNext(q) = NULL;
    3939
    40   pTest(rp.next);
     40  p_Test(rp.next, r);
    4141  return rp.next;
    4242}
  • Singular/prCopy.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: prCopy.cc,v 1.6 2000-09-14 13:04:40 obachman Exp $ */
     4/* $Id: prCopy.cc,v 1.7 2000-09-18 09:19:31 obachman Exp $ */
    55/*
    66* ABSTRACT - implementation of functions for Copy/Move/Delete for Polys
     
    88
    99#include "mod2.h"
    10 #include <omalloc.h>
     10#include "omalloc.h"
    1111#include "polys.h"
    1212#include "numbers.h"
  • Singular/ring.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.116 2000-09-13 13:43:44 Singular Exp $ */
     4/* $Id: ring.cc,v 1.117 2000-09-18 09:19:31 obachman Exp $ */
    55
    66/*
     
    1212#include "mod2.h"
    1313#include "structs.h"
    14 #include <omalloc.h>
     14#include "omalloc.h"
    1515#include "tok.h"
    1616#include "ipid.h"
  • Singular/scanner.l

    rf3398d r512a2b  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: scanner.l,v 1.28 2000-09-04 13:39:06 obachman Exp $ */
     5/* $Id: scanner.l,v 1.29 2000-09-18 09:19:32 obachman Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    1010
    1111#include "mod2.h"
    12 #include <omalloc.h>
     12#include "omalloc.h"
    1313#include "tok.h"
    1414#include "stype.h"
     
    310310                           #endif
    311311                           #ifdef OM_TRACK
    312                              omPrintUsedTrackAddrs(stdout);
     312                             omPrintUsedTrackAddrs(stdout, 1);
    313313                           #endif
    314314                           m2_end(0);
  • Singular/sdb.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: sdb.cc,v 1.14 2000-08-14 12:56:49 obachman Exp $ */
     4/* $Id: sdb.cc,v 1.15 2000-09-18 09:19:33 obachman Exp $ */
    55/*
    66* ABSTRACT: Singular debugger
     
    1111#include "mod2.h"
    1212#include "tok.h"
    13 #include <omalloc.h>
     13#include "omalloc.h"
    1414#include "febase.h"
    1515#include "ipshell.h"
  • Singular/silink.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: silink.cc,v 1.35 2000-08-14 12:56:49 obachman Exp $ */
     4/* $Id: silink.cc,v 1.36 2000-09-18 09:19:33 obachman Exp $ */
    55
    66/*
     
    1212#include "mod2.h"
    1313#include "tok.h"
    14 #include <omalloc.h>
     14#include "omalloc.h"
    1515#include "febase.h"
    1616#include "subexpr.h"
  • Singular/sing_dbm.cc

    rf3398d r512a2b  
    55//**************************************************************************/
    66//
    7 // $Id: sing_dbm.cc,v 1.13 2000-08-14 12:56:50 obachman Exp $
     7// $Id: sing_dbm.cc,v 1.14 2000-09-18 09:19:33 obachman Exp $
    88//
    99//**************************************************************************/
     
    2323#  include "tok.h"
    2424#  include "febase.h"
    25 #  include <omalloc.h>
     25#  include "omalloc.h"
    2626#  include "ipid.h"
    2727#  include "silink.h"
  • Singular/sing_mp.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: sing_mp.cc,v 1.32 2000-08-14 12:56:50 obachman Exp $ */
     4/* $Id: sing_mp.cc,v 1.33 2000-09-18 09:19:33 obachman Exp $ */
    55
    66/*
     
    1717#include "mpsr.h"
    1818#include "tok.h"
    19 #include <omalloc.h>
     19#include "omalloc.h"
    2020#include "febase.h"
    2121#include "subexpr.h"
  • Singular/sparsmat.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: sparsmat.cc,v 1.35 2000-09-14 14:20:45 obachman Exp $ */
     4/* $Id: sparsmat.cc,v 1.36 2000-09-18 09:19:34 obachman Exp $ */
    55
    66/*
     
    17661766    a = pNext(a) = pAdd(pNext(a), pNext(dummy));
    17671767  } while (a!=NULL);
    1768   pFree(dummy);
     1768  pLmFree(dummy);
    17691769}
    17701770
     
    18371837    if (b == NULL)
    18381838    {
    1839       pFree(e);
     1839      pLmFree(e);
    18401840      return res;
    18411841    }
     
    18601860    pIter(b);
    18611861  } while (b != NULL);
    1862   pFree(e);
     1862  pLmFree(e);
    18631863  return res;
    18641864}
     
    19041904    a = pNext(a) = pAdd(pNext(a), h);
    19051905  } while (a!=NULL);
    1906   pFree(e);
     1906  pLmFree(e);
    19071907}
    19081908
     
    20922092      {
    20932093        x = nAdd(pGetCoeff(pb), pGetCoeff(r));
    2094         pDelete1(&r);
     2094        pDeleteLm(&r);
    20952095        if (nIsZero(x))
    20962096        {
    2097           pDelete1(&pb);
     2097          pDeleteLm(&pb);
    20982098          pNext(pa) = pAdd(pb,r);
    20992099        }
     
    21402140      {
    21412141        x = nAdd(pGetCoeff(pa), pGetCoeff(r));
    2142         pDelete1(&r);
     2142        pDeleteLm(&r);
    21432143        if (nIsZero(x))
    21442144        {
    2145           pDelete1(&pa);
     2145          pDeleteLm(&pa);
    21462146          if (pp!=NULL)
    21472147            pNext(pp) = pAdd(pa,r);
  • Singular/spectrum.cc

    rf3398d r512a2b  
    116116    if( pLmCmp( f,m )>=0 )
    117117    {
    118       if( pDivisibleBy2( f,m ) )
     118      if( pLmDivisibleByNoComp( f,m ) )
    119119      {
    120120        return  TRUE;
     
    214214    else
    215215    {
    216       pDelete1(ptr);
     216      pDeleteLm(ptr);
    217217    }
    218218  }
  • Singular/splist.cc

    rf3398d r512a2b  
    271271    while( *node!=(spectrumPolyNode*)NULL )
    272272    {
    273         if( pCmp( m,(*node)->mon )>=0 && pDivisibleBy2( m,(*node)->mon ) )
     273        if( pCmp( m,(*node)->mon )>=0 && pLmDivisibleByNoComp( m,(*node)->mon ) )
    274274        {
    275275            delete_node( node );
     
    281281            while( *f!=(poly)NULL )
    282282            {
    283                 if( pCmp( m,*f )>=0 && pDivisibleBy2( m,*f ) )
     283                if( pCmp( m,*f )>=0 && pLmDivisibleByNoComp( m,*f ) )
    284284                {
    285                     pDelete1(f);
     285                    pDeleteLm(f);
    286286                }
    287287                else
  • Singular/subexpr.cc

    rf3398d r512a2b  
    55* ABSTRACT: handling of leftv
    66*/
    7 /* $Id: subexpr.cc,v 1.64 2000-09-15 16:44:31 Singular Exp $ */
     7/* $Id: subexpr.cc,v 1.65 2000-09-18 09:19:35 obachman Exp $ */
    88
    99#include <stdlib.h>
     
    11571157        // string[..].Data() modifies sleftv, so let's do it ourself
    11581158        {
    1159           char *dd=l->m[index-1].data;
     1159          char *dd=(char*)l->m[index-1].data;
    11601160          int j=e->next->start-1;
    11611161          r=(char *)omAllocBin(size_two_bin);
     
    14101410          v->data = pGetCoeff(p);
    14111411          pGetCoeff(p)=NULL;
    1412           pFree(p);
     1412          pLmFree(p);
    14131413          v->rtyp = NUMBER_CMD;
    14141414          v->name = id;
     
    14431443          v->data = pGetCoeff(p);
    14441444          pGetCoeff(p)=NULL;
    1445           pFree(p);
     1445          pLmFree(p);
    14461446          v->rtyp = NUMBER_CMD;
    14471447          v->name = id;
  • Singular/syz.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: syz.cc,v 1.37 2000-08-14 12:56:53 obachman Exp $ */
     4/* $Id: syz.cc,v 1.38 2000-09-18 09:19:35 obachman Exp $ */
    55
    66/*
     
    1111#include "mod2.h"
    1212#include "tok.h"
    13 #include <omalloc.h>
     13#include "omalloc.h"
    1414#include "polys.h"
    1515#include "febase.h"
  • Singular/syz0.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: syz0.cc,v 1.31 2000-09-12 16:01:20 obachman Exp $ */
     4/* $Id: syz0.cc,v 1.32 2000-09-18 09:19:36 obachman Exp $ */
    55/*
    66* ABSTRACT: resolutions
     
    1010#include "mod2.h"
    1111#include "tok.h"
    12 #include <omalloc.h>
     12#include "omalloc.h"
    1313#include "polys.h"
    1414#include "febase.h"
     
    144144    while (j < nxt)
    145145    {
    146       if (pDivisibleBy2(redWith[j], hn))
     146      if (pLmDivisibleByNoComp(redWith[j], hn))
    147147      {
    148148        //if (TEST_OPT_PROT) Print("r");
  • Singular/syz1.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: syz1.cc,v 1.62 2000-09-12 16:01:21 obachman Exp $ */
     4/* $Id: syz1.cc,v 1.63 2000-09-18 09:19:36 obachman Exp $ */
    55/*
    66* ABSTRACT: resolutions
     
    1111#include "tok.h"
    1212#include "attrib.h"
    13 #include <omalloc.h>
     13#include "omalloc.h"
    1414#include "polys.h"
    1515#include "febase.h"
     
    337337      while (j < pos)
    338338      {
    339         if (pDivisibleBy2(redWith->m[j], hn))
     339        if (pLmDivisibleByNoComp(redWith->m[j], hn))
    340340        {
    341341          //hn = sySPolyRed(hn,redWith->m[j]);
     
    725725          {
    726726            isDivisible = isDivisible ||
    727               pDivisibleBy2(o_r->m[l],tso.lcm);
     727              pLmDivisibleByNoComp(o_r->m[l],tso.lcm);
    728728          }
    729729          l++;
     
    777777          {
    778778            isDivisible = isDivisible ||
    779               pDivisibleBy2(o_r->m[l],tso.lcm);
     779              pLmDivisibleByNoComp(o_r->m[l],tso.lcm);
    780780          }
    781781          l++;
     
    922922        {
    923923          if (j<0) break;
    924           if (pDivisibleBy2(redset[j],q))
     924          if (pLmDivisibleByNoComp(redset[j],q))
    925925          {
    926926            pNext(p) = pHead(q);
     
    10341034             ((sPairs)[i].syz!=NULL))
    10351035      {
    1036         if (pDivisibleBy1(res->m[j],(sPairs)[i].syz))
     1036        if (pLmDivisibleBy(res->m[j],(sPairs)[i].syz))
    10371037        {
    10381038          (sPairs)[i].syz =
     
    12091209        if (nPm[j1]!=NULL)
    12101210        {
    1211           if (pDivisibleBy2(nPm[j1],p))
     1211          if (pLmDivisibleByNoComp(nPm[j1],p))
    12121212          {
    12131213            pDelete(&p);
    12141214            break;
    12151215          }
    1216           else if (pDivisibleBy2(p,nPm[j1]))
     1216          else if (pLmDivisibleByNoComp(p,nPm[j1]))
    12171217          {
    12181218            pDelete(&(nPm[j1]));
     
    22772277
    22782278  while ((pp!=NULL) && ((*toStrip)[pGetComp(pp)]!=0))
    2279     pDelete1(&pp);
     2279    pDeleteLm(&pp);
    22802280  p = pp;
    22812281  if (pp!=NULL)
     
    22842284    {
    22852285      if ((*toStrip)[pGetComp(pNext(pp))]!=0)
    2286         pDelete1(&pNext(pp));
     2286        pDeleteLm(&pNext(pp));
    22872287      else
    22882288        pIter(pp);
     
    27592759  if (origR != syzstr->syRing)
    27602760    rChangeCurrRing(origR,TRUE);
    2761   pDelete1(&redpol);
     2761  pDeleteLm(&redpol);
    27622762  if (TEST_OPT_PROT) PrintLn();
    27632763  return syzstr;
  • Singular/syz2.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: syz2.cc,v 1.17 2000-09-12 16:01:22 obachman Exp $ */
     4/* $Id: syz2.cc,v 1.18 2000-09-18 09:19:37 obachman Exp $ */
    55/*
    66* ABSTRACT: resolutions
     
    1010#include "mod2.h"
    1111#include "tok.h"
    12 #include <omalloc.h>
     12#include "omalloc.h"
    1313#include "syz.h"
    1414#include "polys.h"
     
    132132              if (nP->m[j]!=NULL)
    133133              {
    134                 if (pDivisibleBy2(nP->m[j],p))
     134                if (pLmDivisibleByNoComp(nP->m[j],p))
    135135                {
    136136                  pDelete(&p);
     
    138138                  break;
    139139                }
    140                 else if (pDivisibleBy2(p,nP->m[j]))
     140                else if (pLmDivisibleByNoComp(p,nP->m[j]))
    141141                {
    142142                  pDelete(&(nP->m[j]));
     
    360360      {
    361361        isDivisible = isDivisible ||
    362           pDivisibleBy1(o_r->m[l],tso.lcm);
     362          pLmDivisibleBy(o_r->m[l],tso.lcm);
    363363      }
    364364      l++;
     
    423423    loop
    424424    {
    425       if (pDivisibleBy1(redWith->m[i],q))
     425      if (pLmDivisibleBy(redWith->m[i],q))
    426426      {
    427427        number up = kBucketPolyRed(syzstr->bucket,redWith->m[i],
     
    615615        while (j<kres)
    616616        {
    617           if ((redset[j].p!=NULL) && (pDivisibleBy1(redset[j].p,q))
     617          if ((redset[j].p!=NULL) && (pLmDivisibleBy(redset[j].p,q))
    618618              && ((redset[j].ind1!=tso.ind1) || (redset[j].ind2!=tso.ind2)))
    619619          {
  • Singular/syz3.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: syz3.cc,v 1.4 2000-09-12 16:01:23 obachman Exp $ */
     4/* $Id: syz3.cc,v 1.5 2000-09-18 09:19:37 obachman Exp $ */
    55/*
    66* ABSTRACT: resolutions
     
    1111#include "tok.h"
    1212#include "attrib.h"
    13 #include <omalloc.h>
     13#include "omalloc.h"
    1414#include "polys.h"
    1515#include "febase.h"
     
    379379          if (prs[j1]!=NULL)
    380380          {
    381             if (pDivisibleBy2(prs[j1],p))
     381            if (pLmDivisibleByNoComp(prs[j1],p))
    382382            {
    383383              pDelete(&p);
    384384              break;
    385385            }
    386             else if (pDivisibleBy2(p,prs[j1]))
     386            else if (pLmDivisibleByNoComp(p,prs[j1]))
    387387            {
    388388              pDelete(&(prs[j1]));
     
    701701      pp = pMult_mm(pCopy(old_repr->m[tso.ind2]),p);
    702702      kBucketInit(syzstr->syz_bucket,pp,-1);
    703       pDelete1(&p);
     703      pDeleteLm(&p);
    704704      p = pNeg(p);
    705705      pp = pCopy(old_repr->m[tso.ind2]);
     
    708708      {
    709709        kBucket_Minus_m_Mult_p(syzstr->syz_bucket,p,pp,&il,NULL);
    710         pDelete1(&p);
     710        pDeleteLm(&p);
    711711      }
    712712      pDelete(&pp);
     
    718718      {
    719719        kBucket_Minus_m_Mult_p(syzstr->syz_bucket,p,pp,&il,NULL);
    720         pDelete1(&p);
     720        pDeleteLm(&p);
    721721      }
    722722      pDelete(&pp);
     
    10791079          if (prs[j1]!=NULL)
    10801080          {
    1081             if (pDivisibleBy2(prs[j1],p))
     1081            if (pLmDivisibleByNoComp(prs[j1],p))
    10821082            {
    10831083              pDelete(&p);
    10841084              break;
    10851085            }
    1086             else if (pDivisibleBy2(p,prs[j1]))
     1086            else if (pLmDivisibleByNoComp(p,prs[j1]))
    10871087            {
    10881088              pDelete(&(prs[j1]));
     
    19861986          while ((j<IDELEMS(syzstr->fullres[index])) &&
    19871987            ((syzstr->fullres[index]->m[j]==NULL) ||
    1988             (!pEqual(syzstr->fullres[index]->m[j],totake[index]->m[i])))) j++;
     1988            (!pLmEqual(syzstr->fullres[index]->m[j],totake[index]->m[i])))) j++;
    19891989          if (j<IDELEMS(syzstr->fullres[index]))
    19901990          {
  • Singular/tesths.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: tesths.cc,v 1.81 2000-08-14 12:56:56 obachman Exp $ */
     4/* $Id: tesths.cc,v 1.82 2000-09-18 09:19:38 obachman Exp $ */
    55
    66/*
     
    2121#include "febase.h"
    2222#include "cntrlc.h"
    23 #include <omalloc.h>
     23#include "omalloc.h"
    2424#include "silink.h"
    2525#include "ipid.h"
  • Singular/weight.cc

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: weight.cc,v 1.13 2000-08-14 12:56:57 obachman Exp $ */
     4/* $Id: weight.cc,v 1.14 2000-09-18 09:19:38 obachman Exp $ */
    55
    66/*
     
    1111#include "mod2.h"
    1212#include "tok.h"
    13 #include <omalloc.h>
     13#include "omalloc.h"
    1414#include "polys.h"
    1515#include "intvec.h"
  • Singular/weight0.c

    rf3398d r512a2b  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: weight0.c,v 1.6 2000-08-14 12:56:57 obachman Exp $ */
     4/* $Id: weight0.c,v 1.7 2000-09-18 09:19:39 obachman Exp $ */
    55
    66/*
     
    1111#include <string.h>
    1212#include "mod2.h"
    13 #include <omalloc.h>
     13#include "omalloc.h"
    1414#include "tok.h"
    1515
Note: See TracChangeset for help on using the changeset viewer.