Changeset 512a2b in git
- Timestamp:
- Sep 18, 2000, 11:19:39 AM (23 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- d1655e92ca71fb37d1b57af88efdff5b65b8988b
- Parents:
- f3398d316400fe1ee1677fc397cacb80566ac664
- Location:
- Singular
- Files:
-
- 2 added
- 1 deleted
- 105 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/Makefile.in
rf3398d r512a2b 122 122 longalg.h mpsr_Tok.h structs.h intvec.h longrat.h \ 123 123 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 \ 125 125 cntrlc.h ipprint.h ring.h timer.h sdb.h dError.h \ 126 126 febase.h ipshell.h shortfl.h tok.h mpr_complex.h mpr_global.h \ -
Singular/algmap.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: algmap.cc,v 1.1 7 2000-09-12 16:00:48obachman Exp $ */4 /* $Id: algmap.cc,v 1.18 2000-09-18 09:18:52 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - the mapping of polynomials from rings with … … 9 9 10 10 #include "mod2.h" 11 #include <omalloc.h>11 #include "omalloc.h" 12 12 #include "tok.h" 13 13 #include "polys.h" -
Singular/attrib.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: attrib.cc,v 1.1 8 2000-08-14 12:55:53obachman Exp $ */4 /* $Id: attrib.cc,v 1.19 2000-09-18 09:18:52 obachman Exp $ */ 5 5 6 6 /* … … 15 15 16 16 #include "mod2.h" 17 #include <omalloc.h>17 #include "omalloc.h" 18 18 #include "tok.h" 19 19 #include "ipid.h" -
Singular/clapconv.cc
rf3398d r512a2b 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 // $Id: clapconv.cc,v 1.2 6 2000-08-14 12:55:55obachman Exp $5 // $Id: clapconv.cc,v 1.27 2000-09-18 09:18:53 obachman Exp $ 6 6 /* 7 7 * ABSTRACT: convert data between Singular and factory … … 11 11 #include "mod2.h" 12 12 #ifdef HAVE_FACTORY 13 #include <omalloc.h>13 #include "omalloc.h" 14 14 #include "tok.h" 15 15 #define SI_DONT_HAVE_GLOBAL_VARS -
Singular/clapsing.cc
rf3398d r512a2b 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 // $Id: clapsing.cc,v 1.7 0 2000-09-12 16:00:49obachman Exp $5 // $Id: clapsing.cc,v 1.71 2000-09-18 09:18:53 obachman Exp $ 6 6 /* 7 7 * ABSTRACT: interface between Singular and factory … … 9 9 10 10 #include "mod2.h" 11 #include <omalloc.h>11 #include "omalloc.h" 12 12 #ifdef HAVE_FACTORY 13 13 #define SI_DONT_HAVE_GLOBAL_VARS -
Singular/cntrlc.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: cntrlc.cc,v 1.3 3 2000-09-15 16:43:52 SingularExp $ */4 /* $Id: cntrlc.cc,v 1.34 2000-09-18 09:18:53 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - interupt handling … … 13 13 #include <signal.h> 14 14 #include "mod2.h" 15 #include <omalloc.h>15 #include "omalloc.h" 16 16 #include "tok.h" 17 17 #include "ipshell.h" -
Singular/extra.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: extra.cc,v 1.14 4 2000-09-14 13:04:34 obachman Exp $ */4 /* $Id: extra.cc,v 1.145 2000-09-18 09:18:54 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: general interface to internals of Singular ("system" command) … … 666 666 om_Opts.MarkAsStatic = 1; 667 667 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; 668 699 if ((h!=NULL) &&(h->Typ()==STRING_CMD)) 669 700 { … … 673 704 omMarkAsStaticAddr(h); 674 705 } 675 omPrintUsedTrackAddrs((fd == NULL ? stdout : fd));676 if (fd != NULL) fclose(fd);677 om_Opts.MarkAsStatic = 0;678 return FALSE;679 #else680 WerrorS("mtrack not supported without OM_TRACK");681 return TRUE;682 #endif683 }684 /*==================== mtrack_all ==================================*/685 if(strcmp(sys_cmd,"mtrack_all")==0)686 {687 #ifdef OM_TRACK688 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 }697 706 // OB: TBC print to fd 698 omPrintUsedAddrs((fd == NULL ? stdout : fd) );707 omPrintUsedAddrs((fd == NULL ? stdout : fd), 5); 699 708 if (fd != NULL) fclose(fd); 700 709 om_Opts.MarkAsStatic = 0; -
Singular/feOpt.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: feOpt.cc,v 1.1 3 2000-08-14 12:56:05obachman Exp $ */4 /* $Id: feOpt.cc,v 1.14 2000-09-18 09:18:54 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: Implementation of option buisness … … 270 270 // "error-string" on error 271 271 #if !defined(ESINGULAR) && !defined(TSINGULAR) 272 #include <omalloc.h>272 #include "omalloc.h" 273 273 #include "febase.h" 274 274 #include "ipshell.h" -
Singular/feResource.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: feResource.cc,v 1. 29 2000-09-14 15:06:33obachman Exp $ */4 /* $Id: feResource.cc,v 1.30 2000-09-18 09:18:55 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: management of resources … … 14 14 #include "dError.h" 15 15 #if !defined(ESINGULAR) && !defined(TSINGULAR) 16 #include <omalloc.h>16 #include "omalloc.h" 17 17 #include "febase.h" 18 18 #else -
Singular/febase.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: febase.cc,v 1.9 0 2000-09-04 13:38:56obachman Exp $ */4 /* $Id: febase.cc,v 1.91 2000-09-18 09:18:55 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: i/o system … … 29 29 #include "tok.h" 30 30 #include "febase.h" 31 #include <omalloc.h>31 #include "omalloc.h" 32 32 #include "subexpr.h" 33 33 #include "ipshell.h" -
Singular/fehelp.cc
rf3398d r512a2b 16 16 #include "mod2.h" 17 17 #include "tok.h" 18 #include <omalloc.h>18 #include "omalloc.h" 19 19 #include "febase.h" 20 20 #include "ipid.h" -
Singular/feread.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: feread.cc,v 1.3 7 2000-08-14 12:56:10obachman Exp $ */4 /* $Id: feread.cc,v 1.38 2000-09-18 09:18:56 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: input from ttys, simulating fgets … … 11 11 #include "tok.h" 12 12 #include "febase.h" 13 #include <omalloc.h>13 #include "omalloc.h" 14 14 15 15 #include "static.h" -
Singular/fereadl.c
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: fereadl.c,v 1.1 7 2000-08-14 12:56:11obachman Exp $ */4 /* $Id: fereadl.c,v 1.18 2000-09-18 09:18:56 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: input from ttys, simulating fgets … … 11 11 #include "tok.h" 12 12 #include "febase.h" 13 #include <omalloc.h>13 #include "omalloc.h" 14 14 #include "structs.h" 15 15 #include "febase.h" -
Singular/ffields.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ffields.cc,v 1.2 5 2000-08-14 12:56:11obachman Exp $ */4 /* $Id: ffields.cc,v 1.26 2000-09-18 09:18:56 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: finite fields with a none-prime number of elements (via tables) … … 12 12 #include "tok.h" 13 13 #include "febase.h" 14 #include <omalloc.h>14 #include "omalloc.h" 15 15 #include "numbers.h" 16 16 #include "ring.h" -
Singular/fglm.cc
rf3398d r512a2b 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglm.cc,v 1.2 1 2000-08-14 12:56:12obachman Exp $2 // $Id: fglm.cc,v 1.22 2000-09-18 09:18:57 obachman Exp $ 3 3 4 4 /**************************************** … … 29 29 #include "febase.h" 30 30 #include "maps.h" 31 #include <omalloc.h>31 #include "omalloc.h" 32 32 #include "kstd1.h" 33 33 #include "fglm.h" -
Singular/fglmcomb.cc
rf3398d r512a2b 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglmcomb.cc,v 1.1 8 2000-09-12 16:00:53obachman Exp $2 // $Id: fglmcomb.cc,v 1.19 2000-09-18 09:18:57 obachman Exp $ 3 3 4 4 /**************************************** … … 25 25 #include "febase.h" 26 26 #include "maps.h" 27 #include <omalloc.h>27 #include "omalloc.h" 28 28 #include "fglmvec.h" 29 29 #include "fglmgauss.h" … … 71 71 v.setelem( point+1, newelem ); 72 72 nDelete( & pGetCoeff( todelete ) ); 73 p Free( todelete );73 pLmFree( todelete ); 74 74 point++; 75 75 } … … 117 117 118 118 p2= pCopy( p2 ); 119 pDelete 1(pptr);120 pDelete 1( & p2 );119 pDeleteLm(pptr); 120 pDeleteLm( & p2 ); 121 121 p2= pMult( m, p2 ); 122 122 … … 191 191 // pSetExpV( m[k], temp->exp ); 192 192 // pSetm( m[k] ); 193 m[k]=p Init(temp);193 m[k]=pLmInit(temp); 194 194 pSetCoeff( m[k], nInit(1) ); 195 195 pIter( temp ); … … 244 244 for ( b= 0; (b < basisSize) && (found == FALSE); b++ ) 245 245 { 246 if ( p Equal( temp, basis[b] ) )246 if ( pLmEqual( temp, basis[b] ) ) 247 247 { 248 248 found= TRUE; … … 260 260 // pSetExpV( basis[basisSize], temp->exp ); 261 261 // pSetm( basis[basisSize] ); 262 basis[basisSize]=p Init(temp);262 basis[basisSize]=pLmInit(temp); 263 263 pSetCoeff( basis[basisSize], nInit(1) ); 264 264 basisSize++; … … 288 288 int b= 0; 289 289 while ( found == FALSE ) { 290 if ( p Equal( mon, basis[b] ) ) {290 if ( pLmEqual( mon, basis[b] ) ) { 291 291 found= TRUE; 292 292 } … … 472 472 int b; 473 473 for ( b= 0; (b < basisSize) && (found == FALSE); b++ ) 474 if ( p Equal( sm, basis[b] ) ) found= TRUE;474 if ( pLmEqual( sm, basis[b] ) ) found= TRUE; 475 475 if ( found == FALSE ) { 476 476 // Expand the basis … … 504 504 int b= 0; 505 505 while ( found == FALSE ) { 506 if ( p Equal( mon, basis[b] ) )506 if ( pLmEqual( mon, basis[b] ) ) 507 507 found= TRUE; 508 508 else -
Singular/fglmgauss.cc
rf3398d r512a2b 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglmgauss.cc,v 1.1 2 2000-08-14 12:56:13obachman Exp $2 // $Id: fglmgauss.cc,v 1.13 2000-09-18 09:18:58 obachman Exp $ 3 3 4 4 /**************************************** … … 15 15 #include "structs.h" 16 16 #include "numbers.h" 17 #include <omalloc.h>17 #include "omalloc.h" 18 18 19 19 #include "fglmvec.h" -
Singular/fglmhom.cc
rf3398d r512a2b 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglmhom.cc,v 1.1 6 2000-08-14 12:56:15obachman Exp $2 // $Id: fglmhom.cc,v 1.17 2000-09-18 09:18:58 obachman Exp $ 3 3 4 4 /**************************************** … … 26 26 #include "febase.h" 27 27 #include "maps.h" 28 #include <omalloc.h>28 #include "omalloc.h" 29 29 #include "fglm.h" 30 30 #include "fglmvec.h" … … 247 247 for ( t= dat.numMonoms - 1; t >= 0; t-- ) { 248 248 if ( dat.monlist[t].basis > 0 ) { 249 if ( p Equal( dat.monlist[t].mon.sm, temp ) ) {249 if ( pLmEqual( dat.monlist[t].mon.sm, temp ) ) { 250 250 number coeff= nCopy( pGetCoeff( temp ) ); 251 251 v.setelem( dat.monlist[t].basis, coeff ); -
Singular/fglmvec.cc
rf3398d r512a2b 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglmvec.cc,v 1.1 3 2000-08-14 12:56:15obachman Exp $2 // $Id: fglmvec.cc,v 1.14 2000-09-18 09:18:58 obachman Exp $ 3 3 4 4 /**************************************** … … 16 16 17 17 #ifdef HAVE_FGLM 18 #include <omalloc.h>18 #include "omalloc.h" 19 19 #include "tok.h" 20 20 #include "structs.h" -
Singular/fglmzero.cc
rf3398d r512a2b 1 1 // emacs edit mode for this file is -*- C++ -*- 2 // $Id: fglmzero.cc,v 1. 29 2000-09-12 16:00:53obachman Exp $2 // $Id: fglmzero.cc,v 1.30 2000-09-18 09:18:59 obachman Exp $ 3 3 4 4 /**************************************** … … 30 30 #include "febase.h" 31 31 #include "maps.h" 32 #include <omalloc.h>32 #include "omalloc.h" 33 33 #include "kstd1.h" // for kNF (see fglmquot) 34 34 #include "fglm.h" … … 298 298 borderElem() : monom(NULL), nf() {} 299 299 borderElem( poly p, fglmVector n ) : monom( p ), nf( n ) {} 300 ~borderElem() { pDelete 1(&monom); }300 ~borderElem() { pDeleteLm(&monom); } 301 301 #ifndef HAVE_EXPLICIT_CONSTR 302 302 void insertElem( poly p, fglmVector n ) … … 390 390 { 391 391 for ( int k = basisSize; k > 0; k-- ) 392 pDelete 1( basis + k ); //. rem: basis runs from basis[1]..basis[basisSize]392 pDeleteLm( basis + k ); //. rem: basis runs from basis[1]..basis[basisSize] 393 393 omFreeSize( (ADDRESS)basis, basisMax*sizeof( poly ) ); 394 394 #ifndef HAVE_EXPLICIT_CONSTR … … 487 487 if ( state == 0 ) { 488 488 list.getItem().newDivisor( k ); 489 pDelete 1(&newmonom);489 pDeleteLm(&newmonom); 490 490 } 491 491 else { … … 503 503 504 504 // if p == pHead( (theIdeal->m)[k] ) return k, 0 otherwise 505 // (Assumes that p Equal just checks the leading monomials without505 // (Assumes that pLmEqual just checks the leading monomials without 506 506 // coefficients.) 507 507 int … … 509 509 { 510 510 for ( int k = idelems; k > 0; k-- ) 511 if ( p Equal( m, (theIdeal->m)[k-1] ) )511 if ( pLmEqual( m, (theIdeal->m)[k-1] ) ) 512 512 return k; 513 513 return 0; … … 605 605 poly nf = data.getSpanPoly( edge ); 606 606 pNorm( nf ); 607 pDelete 1(&nf); //. deletes the leadingmonomial607 pDeleteLm(&nf); //. deletes the leadingmonomial 608 608 nf= pNeg( nf ); 609 609 fglmVector nfv = data.getVectorRep( nf ); … … 691 691 { 692 692 if ( monom != NULL ) { 693 pDelete 1(&monom);693 pDeleteLm(&monom); 694 694 } 695 695 } … … 877 877 if ( state == 0 ) { 878 878 list.getItem().newDivisor(); 879 pDelete 1( & newmonom );879 pDeleteLm( & newmonom ); 880 880 } 881 881 else { -
Singular/gnumpc.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: gnumpc.cc,v 1.1 2 2000-08-14 12:56:17obachman Exp $ */4 /* $Id: gnumpc.cc,v 1.13 2000-09-18 09:18:59 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: computations with GMP complex floating-point numbers … … 12 12 #include "tok.h" 13 13 #include "febase.h" 14 #include <omalloc.h>14 #include "omalloc.h" 15 15 #include "numbers.h" 16 16 #include "modulop.h" -
Singular/gnumpfl.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: gnumpfl.cc,v 1.1 5 2000-08-14 12:56:17obachman Exp $ */4 /* $Id: gnumpfl.cc,v 1.16 2000-09-18 09:18:59 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: computations with GMP floating-point numbers … … 12 12 #include "tok.h" 13 13 #include "febase.h" 14 #include <omalloc.h>14 #include "omalloc.h" 15 15 #include "numbers.h" 16 16 #include "modulop.h" -
Singular/grammar.y
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: grammar.y,v 1.8 2 2000-08-14 12:56:17obachman Exp $ */4 /* $Id: grammar.y,v 1.83 2000-09-18 09:18:59 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: SINGULAR shell grammatik … … 27 27 28 28 #include "mod2.h" 29 #include <omalloc.h>29 #include "omalloc.h" 30 30 #include "tok.h" 31 31 #include "stype.h" -
Singular/hdegree.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: hdegree.cc,v 1.2 1 2000-09-12 16:00:54obachman Exp $ */4 /* $Id: hdegree.cc,v 1.22 2000-09-18 09:19:00 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - dimension, multiplicity, HC, kbase … … 13 13 #include "lists.h" 14 14 #include "febase.h" 15 #include <omalloc.h>15 #include "omalloc.h" 16 16 #include "ipid.h" 17 17 #include "ideals.h" … … 1072 1072 hLexS(hexist, hNstc, hvar, hNvar); 1073 1073 if (hEdge!=NULL) 1074 p Free(hEdge);1074 pLmFree(hEdge); 1075 1075 hEdge = pInit(); 1076 1076 pWork = pInit(); … … 1082 1082 omFreeSize((ADDRESS)hpure, (1 + (hNvar * hNvar)) * sizeof(Exponent_t)); 1083 1083 hDelete(hexist, hNexist); 1084 p Free(pWork);1084 pLmFree(pWork); 1085 1085 } 1086 1086 … … 1412 1412 omFreeSize((ADDRESS)act, (pVariables + 1) * sizeof(Exponent_t)); 1413 1413 hKill(stcmem, pVariables - 1); 1414 pDelete 1(&p);1414 pDeleteLm(&p); 1415 1415 if (p == NULL) 1416 1416 return idInit(1,s->rank); -
Singular/hilb.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: hilb.cc,v 1.1 4 2000-08-14 12:56:19obachman Exp $ */4 /* $Id: hilb.cc,v 1.15 2000-09-18 09:19:00 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Hilbert series … … 10 10 #include "tok.h" 11 11 #include "febase.h" 12 #include <omalloc.h>12 #include "omalloc.h" 13 13 #include "polys.h" 14 14 #include "intvec.h" -
Singular/hutil.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: hutil.cc,v 1.1 5 2000-08-14 12:56:19obachman Exp $ */4 /* $Id: hutil.cc,v 1.16 2000-09-18 09:19:01 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: Utilities for staircase operations … … 10 10 #include "tok.h" 11 11 #include "febase.h" 12 #include <omalloc.h>12 #include "omalloc.h" 13 13 #include "ipid.h" 14 14 #include "ideals.h" -
Singular/ideals.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.10 2 2000-09-14 13:04:35obachman Exp $ */4 /* $Id: ideals.cc,v 1.103 2000-09-18 09:19:01 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 10 10 #include "mod2.h" 11 11 #include "tok.h" 12 #include <omalloc.h>12 #include "omalloc.h" 13 13 #include "febase.h" 14 14 #include "numbers.h" … … 248 248 for (j=l-1; j>i; j--) 249 249 { 250 if (id->m[i] != NULL && id->m[j] != NULL && p Equal(id->m[i], id->m[j]))250 if (id->m[i] != NULL && id->m[j] != NULL && pLmEqual(id->m[i], id->m[j])) 251 251 { 252 252 pDelete(&id->m[j]); … … 913 913 { 914 914 pIter(*p); 915 pDelete 1(&qp2);915 pDeleteLm(&qp2); 916 916 qp2 = *p; 917 917 qp1 = *p; … … 920 920 { 921 921 qp2->next = qp1->next; 922 pDelete 1(&qp1);922 pDeleteLm(&qp1); 923 923 qp1 = qp2->next; 924 924 } -
Singular/intvec.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: intvec.cc,v 1.1 7 2000-08-14 12:56:21obachman Exp $ */4 /* $Id: intvec.cc,v 1.18 2000-09-18 09:19:02 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: class intvec: lists/vectors of integers … … 12 12 #include "febase.h" 13 13 #include "intvec.h" 14 #include <omalloc.h>14 #include "omalloc.h" 15 15 16 16 /*0 implementation*/ -
Singular/intvec.h
rf3398d r512a2b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: intvec.h,v 1.1 3 2000-08-14 12:56:21obachman Exp $ */6 /* $Id: intvec.h,v 1.14 2000-09-18 09:19:02 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT: class intvec: lists/vectors of integers 9 9 */ 10 10 #include <string.h> 11 #include <omalloc.h>11 #include "omalloc.h" 12 12 #include "febase.h" 13 13 -
Singular/iparith.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iparith.cc,v 1.22 4 2000-09-15 16:44:29 SingularExp $ */4 /* $Id: iparith.cc,v 1.225 2000-09-18 09:19:02 obachman Exp $ */ 5 5 6 6 /* … … 16 16 17 17 #include "mod2.h" 18 18 19 #include "tok.h" 19 20 #include "ipid.h" 20 21 #include "intvec.h" 21 #include <omalloc.h>22 #include "omalloc.h" 22 23 #include "polys.h" 23 24 #include "febase.h" … … 1289 1290 if (o!=NULL) 1290 1291 { 1291 pDelete 1(&pNext(o));1292 pDeleteLm(&pNext(o)); 1292 1293 p=pNext(o); 1293 1294 } 1294 1295 else 1295 pDelete 1(&p);1296 pDeleteLm(&p); 1296 1297 } 1297 1298 else … … 1331 1332 if (i==iv->length()) 1332 1333 { 1333 pDelete 1(&p);1334 pDeleteLm(&p); 1334 1335 if (p==NULL) break; 1335 1336 } 1336 1337 } 1337 pDelete 1(&r);1338 pDeleteLm(&r); 1338 1339 res->data=(char *)r; 1339 1340 } … … 2939 2940 else 2940 2941 { 2941 poly lm = p Init(p);2942 poly lm = pLmInit(p); 2942 2943 pSetCoeff(lm, nInit(1)); 2943 2944 res->data = (char*) lm; -
Singular/ipassign.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipassign.cc,v 1.5 8 2000-08-14 12:56:23obachman Exp $ */4 /* $Id: ipassign.cc,v 1.59 2000-09-18 09:19:04 obachman Exp $ */ 5 5 6 6 /* … … 17 17 #include "ipid.h" 18 18 #include "intvec.h" 19 #include <omalloc.h>19 #include "omalloc.h" 20 20 #include "febase.h" 21 21 #include "polys.h" -
Singular/ipconv.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipconv.cc,v 1.2 4 2000-08-14 12:56:23obachman Exp $ */4 /* $Id: ipconv.cc,v 1.25 2000-09-18 09:19:04 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: automatic type conversions … … 11 11 #include "ipid.h" 12 12 #include "intvec.h" 13 #include <omalloc.h>13 #include "omalloc.h" 14 14 #include "febase.h" 15 15 #include "polys.h" -
Singular/ipid.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipid.cc,v 1.4 2 2000-08-18 15:42:06 SingularExp $ */4 /* $Id: ipid.cc,v 1.43 2000-09-18 09:19:05 obachman Exp $ */ 5 5 6 6 /* … … 11 11 12 12 #include "mod2.h" 13 #include <omalloc.h>13 #include "omalloc.h" 14 14 #include "tok.h" 15 15 #include "ipshell.h" -
Singular/iplib.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iplib.cc,v 1.7 4 2000-09-04 13:38:57obachman Exp $ */4 /* $Id: iplib.cc,v 1.75 2000-09-18 09:19:05 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: interpreter: LIB and help … … 16 16 #include "tok.h" 17 17 #include "ipid.h" 18 #include <omalloc.h>18 #include "omalloc.h" 19 19 #include "febase.h" 20 20 #include "ring.h" -
Singular/ipprint.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipprint.cc,v 1.1 8 2000-08-14 12:56:25 obachman Exp $ */4 /* $Id: ipprint.cc,v 1.19 2000-09-18 09:19:05 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: interpreter: printing … … 10 10 #include "tok.h" 11 11 #include "ipid.h" 12 #include <omalloc.h>12 #include "omalloc.h" 13 13 #include "febase.h" 14 14 #include "polys.h" -
Singular/ipshell.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipshell.cc,v 1.5 5 2000-08-14 12:56:26 obachman Exp $ */4 /* $Id: ipshell.cc,v 1.56 2000-09-18 09:19:06 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 16 16 #include "ipid.h" 17 17 #include "intvec.h" 18 #include <omalloc.h>18 #include "omalloc.h" 19 19 #include "febase.h" 20 20 #include "polys.h" -
Singular/kInline.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: kInline.cc,v 1. 1 2000-09-12 16:09:55obachman Exp $9 * Version: $Id: kInline.cc,v 1.2 2000-09-18 09:19:06 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef KINLINE_CC … … 44 44 } 45 45 p_Setm(np, tailRing); 46 p_ Free(p, lmRing);46 p_LmFree(p, lmRing); 47 47 return np; 48 48 } -
Singular/kbuckets.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kbuckets.cc,v 1.1 6 2000-09-14 13:04:36 obachman Exp $ */4 /* $Id: kbuckets.cc,v 1.17 2000-09-18 09:19:06 obachman Exp $ */ 5 5 6 6 #include "mod2.h" 7 7 #include "tok.h" 8 8 #include "structs.h" 9 #include <omalloc.h>9 #include "omalloc.h" 10 10 #include "polys.h" 11 11 #include "febase.h" 12 12 #include "kbuckets.h" 13 13 #include "numbers.h" 14 #include "p_Procs.h" 14 15 15 16 static omBin kBucket_bin = omGetSpecBin(sizeof(kBucket)); … … 213 214 nIsZero(pGetCoeff(bucket->buckets[j]))) 214 215 { 215 p_Delete 1(&(bucket->buckets[j]), bucket->bucket_ring);216 p_DeleteLm(&(bucket->buckets[j]), bucket->bucket_ring); 216 217 (bucket->buckets_length[j])--; 217 218 } … … 224 225 nAdd(pGetCoeff(bucket->buckets[i]), tn)); 225 226 nDelete(&tn); 226 p_Delete 1(&(bucket->buckets[i]), bucket->bucket_ring);227 p_DeleteLm(&(bucket->buckets[i]), bucket->bucket_ring); 227 228 (bucket->buckets_length[i])--; 228 229 } … … 231 232 if (j > 0 && nIsZero(pGetCoeff(bucket->buckets[j]))) 232 233 { 233 p_Delete 1(&(bucket->buckets[j]), bucket->bucket_ring);234 p_DeleteLm(&(bucket->buckets[j]), bucket->bucket_ring); 234 235 (bucket->buckets_length[j])--; 235 236 j = -1; … … 548 549 if(a1==NULL) 549 550 { 550 p_Delete 1(&lm, bucket->bucket_ring);551 p_DeleteLm(&lm, bucket->bucket_ring); 551 552 return nInit(1); 552 553 } … … 578 579 kBucket_Minus_m_Mult_p(bucket, lm, a1, &l1, spNoether); 579 580 580 p_Delete 1(&lm, bucket->bucket_ring);581 p_DeleteLm(&lm, bucket->bucket_ring); 581 582 if (reset_vec) pSetCompP(a1, 0); 582 583 kbTests(bucket); … … 630 631 while(j <= strat->tl) 631 632 { 632 if (p DivisibleBy1(strat->T[j].p,lm)) goto Found;633 if (pLmDivisibleBy(strat->T[j].p,lm)) goto Found; 633 634 j++; 634 635 } … … 639 640 { 640 641 #ifdef KB_HAVE_SHORT_EVECTORS 641 if ((strat->T[j].sev & ev) || ! p DivisibleBy2(strat->T[j].p,lm))642 if ((strat->T[j].sev & ev) || ! pLmDivisibleByNoComp(strat->T[j].p,lm)) 642 643 j++; 643 644 else 644 645 goto Found; 645 646 #else 646 if (p DivisibleBy2(strat->T[j].p,lm)) goto Found;647 if (pLmDivisibleByNoComp(strat->T[j].p,lm)) goto Found; 647 648 j++; 648 649 #endif … … 685 686 if (TEST_OPT_DEBUG) PrintS(" to 0\n"); 686 687 #endif 687 if (h->lcm!=NULL) p Free((*h).lcm);688 if (h->lcm!=NULL) pLmFree((*h).lcm); 688 689 #ifdef KDEBUG 689 690 (*h).lcm=NULL; … … 745 746 while(j <= strat->tl) 746 747 { 747 if (p DivisibleBy1(strat->T[j].p,lm)) goto Found;748 if (pLmDivisibleBy(strat->T[j].p,lm)) goto Found; 748 749 j++; 749 750 } … … 754 755 { 755 756 #ifdef KB_HAVE_SHORT_EVECTORS 756 if ((strat->T[j].sev & ev) || ! p DivisibleBy2(strat->T[j].p,lm))757 if ((strat->T[j].sev & ev) || ! pLmDivisibleByNoComp(strat->T[j].p,lm)) 757 758 j++; 758 759 else 759 760 goto Found; 760 761 #else 761 if (p DivisibleBy2(strat->T[j].p,lm)) goto Found;762 if (pLmDivisibleByNoComp(strat->T[j].p,lm)) goto Found; 762 763 j++; 763 764 #endif … … 801 802 if ((!TEST_OPT_REDBEST) && (ei <= (*h).ecart)) 802 803 break; 803 if ((strat->T[i].ecart < ei) && p DivisibleBy1(strat->T[i].p,lm))804 if ((strat->T[i].ecart < ei) && pLmDivisibleBy(strat->T[i].p,lm)) 804 805 { 805 806 #ifdef KDEBUG … … 874 875 if (lm == NULL) 875 876 { 876 if (h->lcm!=NULL) p Free((*h).lcm);877 if (h->lcm!=NULL) pLmFree((*h).lcm); 877 878 #ifdef KDEBUG 878 879 (*h).lcm=NULL; … … 913 914 return; 914 915 } 915 } while (!p DivisibleBy1(strat->S[i], h->p));916 } while (!pLmDivisibleBy(strat->S[i], h->p)); 916 917 917 918 // enter in Lazyset and return -
Singular/kspoly.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kspoly.cc,v 1. 7 2000-09-12 16:00:58obachman Exp $ */4 /* $Id: kspoly.cc,v 1.8 2000-09-18 09:19:07 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Routines for Spoly creation and reductions … … 10 10 #include "polys.h" 11 11 #include "numbers.h" 12 #include "p_Procs.h" 12 13 13 14 // Define to enable tests in this file … … 47 48 if (a2==NULL) 48 49 { 49 pDelete 1(&lm);50 pDeleteLm(&lm); 50 51 PR->p = p1; 51 52 if (coef != NULL) *coef = nInit(1); … … 74 75 int dummy; 75 76 PR->p = currRing->p_Procs->p_Minus_mm_Mult_qq(p1, lm, a2, 76 77 78 pDelete 1(&lm);77 dummy, spNoether, currRing); 78 79 pDeleteLm(&lm); 79 80 } 80 81 … … 148 149 149 150 // Clean-up time 150 pDelete 1(&m1);151 pDelete 1(&m2);151 pDeleteLm(&m1); 152 pDeleteLm(&m2); 152 153 153 154 if (co != 0) … … 373 374 if(cm==1) 374 375 { 375 p Free(m2);376 pLmFree(m2); 376 377 nNew(&(pGetCoeff(m1))); 377 378 return m1; … … 379 380 else 380 381 { 381 p Free(m1);382 pLmFree(m1); 382 383 nNew(&(pGetCoeff(m2))); 383 384 return m2; … … 391 392 if (!equal) 392 393 { 393 p Free(m2);394 pLmFree(m2); 394 395 nNew(&(pGetCoeff(m1))); 395 396 return m1; … … 399 400 if (a2==NULL) 400 401 { 401 p Free(m2);402 pLmFree(m2); 402 403 if (a1==NULL) 403 404 { 404 p Free(m1);405 pLmFree(m1); 405 406 return NULL; 406 407 } … … 409 410 if (a1==NULL) 410 411 { 411 p Free(m1);412 pLmFree(m1); 412 413 goto x2; 413 414 } -
Singular/kstd1.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd1.cc,v 1.5 3 2000-09-14 14:07:22obachman Exp $ */4 /* $Id: kstd1.cc,v 1.54 2000-09-18 09:19:07 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 9 9 #include "mod2.h" 10 10 #include "tok.h" 11 #include <omalloc.h>11 #include "omalloc.h" 12 12 #include "polys.h" 13 13 #include "febase.h" … … 162 162 return 1; 163 163 } 164 if (p ShortDivisibleBy(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)) 165 165 { 166 166 //if (strat->interpt) test_int_std(strat->kIdeal); … … 199 199 if ((*h).p == NULL) 200 200 { 201 if (h->lcm!=NULL) p Free((*h).lcm);201 if (h->lcm!=NULL) pLmFree((*h).lcm); 202 202 return 0; 203 203 } … … 243 243 i--; 244 244 if (i<0) return 1; 245 } while (!p ShortDivisibleBy(strat->S[i], strat->sevS[i],245 } while (!pLmShortDivisibleBy(strat->S[i], strat->sevS[i], 246 246 (*h).p, not_sev)); 247 247 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); … … 288 288 return 1; 289 289 } 290 if (p ShortDivisibleBy(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)) 291 291 { 292 292 //if (strat->interpt) test_int_std(strat->kIdeal); … … 309 309 || (((strat->T[i]).ecart == ei) 310 310 && ((strat->T[i]).length < li))) 311 && p ShortDivisibleBy(strat->T[i].p, strat->T[i].sev,311 && pLmShortDivisibleBy(strat->T[i].p, strat->T[i].sev, 312 312 (*h).p, not_sev)) 313 313 { … … 356 356 if ((*h).p == NULL) 357 357 { 358 if (h->lcm!=NULL) p Free((*h).lcm);358 if (h->lcm!=NULL) pLmFree((*h).lcm); 359 359 return 0; 360 360 } … … 402 402 i--; 403 403 if (i<0) return 1; 404 } while (!p ShortDivisibleBy(strat->S[i], strat->sevS[i],404 } while (!pLmShortDivisibleBy(strat->S[i], strat->sevS[i], 405 405 (*h).p, not_sev)); 406 406 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); … … 448 448 return 1; 449 449 } 450 if (p ShortDivisibleBy(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)) 451 451 { 452 452 //if (strat->interpt) test_int_std(strat->kIdeal); … … 473 473 if ((*h).p == NULL) 474 474 { 475 if (h->lcm!=NULL) p Free((*h).lcm);475 if (h->lcm!=NULL) pLmFree((*h).lcm); 476 476 h->sev = 0; 477 477 return 0; … … 510 510 i--; 511 511 if (i<0) return 1; 512 } while (!p ShortDivisibleBy(strat->S[i],strat->sevS[i],512 } while (!pLmShortDivisibleBy(strat->S[i],strat->sevS[i], 513 513 (*h).p, not_sev)); 514 514 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); … … 556 556 return 1; 557 557 } 558 if (p ShortDivisibleBy(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)) 559 559 { 560 560 //if (strat->interpt) test_int_std(strat->kIdeal); … … 576 576 || ((strat->T[i].ecart == ei) 577 577 && (strat->T[i].length < li))) 578 && p ShortDivisibleBy(strat->T[i].p, strat->T[i].sev,578 && pLmShortDivisibleBy(strat->T[i].p, strat->T[i].sev, 579 579 (*h).p, not_sev)) 580 580 { … … 623 623 if ((*h).p == NULL) 624 624 { 625 if (h->lcm!=NULL) p Free((*h).lcm);625 if (h->lcm!=NULL) pLmFree((*h).lcm); 626 626 return 0; 627 627 } … … 667 667 i--; 668 668 if (i<0) return 1; 669 } while (!p ShortDivisibleBy(strat->S[i],strat->sevS[i],669 } while (!pLmShortDivisibleBy(strat->S[i],strat->sevS[i], 670 670 (*h).p, not_sev)); 671 671 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); … … 713 713 if (TEST_V_DEG_STOP) 714 714 { 715 if (kModDeg(H.p)>Kstd1_deg) pDelete 1(&H.p);715 if (kModDeg(H.p)>Kstd1_deg) pDeleteLm(&H.p); 716 716 if (H.p==NULL) return NULL; 717 717 } 718 if (p ShortDivisibleBy(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)) 719 719 { 720 720 //if (strat->interpt) test_int_std(strat->kIdeal); … … 737 737 || ((strat->T[j].ecart == ei) 738 738 && (strat->T[j].length < li))) 739 && p ShortDivisibleBy(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)) 740 740 { 741 741 /* … … 961 961 if (pNext(strat->L[j].p) == strat->tail) 962 962 { 963 p Free(strat->L[j].p); /*deletes the short spoly and computes*/963 pLmFree(strat->L[j].p); /*deletes the short spoly and computes*/ 964 964 strat->L[j].p=ksOldCreateSpoly(strat->L[j].p1, 965 965 strat->L[j].p2, … … 996 996 if (pLmCmp(strat->L[i].p,strat->kNoether) == -1) 997 997 { 998 p Free(strat->L[i].p);998 pLmFree(strat->L[i].p); 999 999 strat->L[i].p = NULL; 1000 1000 } 1001 1001 else 1002 1002 { 1003 p Free(strat->L[i].p);1003 pLmFree(strat->L[i].p); 1004 1004 strat->L[i].p = ksOldCreateSpoly(strat->L[i].p1, 1005 1005 strat->L[i].p2, … … 1346 1346 if (pNext(strat->P.p) == strat->tail) 1347 1347 { 1348 p Free(strat->P.p);/*- deletes the short spoly and computes -*/1348 pLmFree(strat->P.p);/*- deletes the short spoly and computes -*/ 1349 1349 strat->P.p = ksOldCreateSpoly(strat->P.p1, 1350 1350 strat->P.p2, … … 1396 1396 if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat); 1397 1397 } 1398 if (strat->P.lcm!=NULL) p Free(strat->P.lcm);1398 if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm); 1399 1399 strat->P.lcm=NULL; 1400 1400 #ifdef KDEBUG -
Singular/kstd2.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.4 6 2000-09-14 14:07:22obachman Exp $ */4 /* $Id: kstd2.cc,v 1.47 2000-09-18 09:19:08 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 9 9 #include "mod2.h" 10 10 #include "tok.h" 11 #include <omalloc.h>11 #include "omalloc.h" 12 12 #include "polys.h" 13 13 #include "ideals.h" … … 66 66 { 67 67 if (j > strat->tl) return 1; 68 if (p ShortDivisibleBy(strat->T[j].p, strat->T[j].sev,68 if (pLmShortDivisibleBy(strat->T[j].p, strat->T[j].sev, 69 69 h->p, not_sev)) break; 70 70 j++; … … 83 83 if (h->p == NULL) 84 84 { 85 if (h->lcm!=NULL) p Free((*h).lcm);85 if (h->lcm!=NULL) pLmFree((*h).lcm); 86 86 #ifdef KDEBUG 87 87 (*h).lcm=NULL; … … 113 113 while (j <= strat->tl) 114 114 { 115 if (p ShortDivisibleBy(strat->T[j].p,strat->T[j].sev,115 if (pLmShortDivisibleBy(strat->T[j].p,strat->T[j].sev, 116 116 h->p, not_sev)) 117 117 break; … … 140 140 if ((*h).p == NULL) 141 141 { 142 if (h->lcm!=NULL) p Free((*h).lcm);142 if (h->lcm!=NULL) pLmFree((*h).lcm); 143 143 #ifdef KDEBUG 144 144 (*h).lcm=NULL; … … 162 162 if (i<0) return 1; 163 163 } 164 while (!p ShortDivisibleBy(strat->S[i], strat->sevS[i],164 while (!pLmShortDivisibleBy(strat->S[i], strat->sevS[i], 165 165 h->p, not_sev)); 166 166 if (TEST_OPT_DEBUG) Print(" ->L[%d]\n",at); … … 200 200 while (j<= strat->tl) 201 201 { 202 if (p ShortDivisibleBy(strat->T[j].p, strat->T[j].sev,202 if (pLmShortDivisibleBy(strat->T[j].p, strat->T[j].sev, 203 203 h->p, not_sev)) break; 204 204 j++; … … 228 228 break; 229 229 if ((strat->T[i].ecart < ei) && 230 p ShortDivisibleBy(strat->T[i].p, strat->T[i].sev,230 pLmShortDivisibleBy(strat->T[i].p, strat->T[i].sev, 231 231 h->p, not_sev)) 232 232 { … … 291 291 if ((*h).p == NULL) 292 292 { 293 if (h->lcm!=NULL) p Free((*h).lcm);293 if (h->lcm!=NULL) pLmFree((*h).lcm); 294 294 #ifdef KDEBUG 295 295 (*h).lcm=NULL; … … 323 323 i--; 324 324 if (i<0) return 1; 325 } while (!p ShortDivisibleBy(strat->S[i], strat->sevS[i],325 } while (!pLmShortDivisibleBy(strat->S[i], strat->sevS[i], 326 326 h->p, not_sev)); 327 327 enterL(&strat->L,&strat->Ll,&strat->Lmax,*h,at); … … 380 380 if (ph==NULL) 381 381 { 382 p Free(p);382 pLmFree(p); 383 383 pDelete(&((*h).p)); 384 if (h->lcm!=NULL) p Free((*h).lcm);384 if (h->lcm!=NULL) pLmFree((*h).lcm); 385 385 #ifdef KDEBUG 386 386 (*h).lcm=NULL; … … 390 390 else if (pLmCmp(ph,p) == -1) 391 391 { 392 p Free(p);392 pLmFree(p); 393 393 p = ph; 394 394 jbest = j; … … 396 396 else 397 397 { 398 p Free(ph);398 pLmFree(ph); 399 399 } 400 400 } 401 401 } 402 402 } 403 p Free(p);403 pLmFree(p); 404 404 (*h).p = ksOldSpolyRed(strat->T[jbest].p,(*h).p,strat->kNoether); 405 405 } 406 406 else 407 407 { 408 if (h->lcm!=NULL) p Free((*h).lcm);408 if (h->lcm!=NULL) pLmFree((*h).lcm); 409 409 #ifdef KDEBUG 410 410 (*h).lcm=NULL; … … 465 465 loop 466 466 { 467 if (p ShortDivisibleBy(strat->S[j], strat->sevS[j], h, not_sev))467 if (pLmShortDivisibleBy(strat->S[j], strat->sevS[j], h, not_sev)) 468 468 { 469 469 //if (strat->interpt) test_int_std(strat->kIdeal); … … 606 606 { 607 607 /* deletes the short spoly and computes */ 608 p Free(strat->P.p);608 pLmFree(strat->P.p); 609 609 /* the real one */ 610 610 ksCreateSpoly(&(strat->P), … … 669 669 if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat); 670 670 } 671 if (strat->P.lcm!=NULL) p Free(strat->P.lcm);671 if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm); 672 672 if (strat->sl>srmax) srmax = strat->sl; 673 673 } -
Singular/kstdfac.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstdfac.cc,v 1. 39 2000-09-14 14:07:23obachman Exp $ */4 /* $Id: kstdfac.cc,v 1.40 2000-09-18 09:19:09 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: factorizing alg. of Buchberger … … 9 9 #include "mod2.h" 10 10 #include "tok.h" 11 #include <omalloc.h>11 #include "omalloc.h" 12 12 #include "polys.h" 13 13 #include "ideals.h" … … 85 85 // copy .lcm ---------------------------------------------- 86 86 if (o->L[j].lcm!=NULL) 87 l[j].lcm=p Init(o->L[j].lcm);87 l[j].lcm=pLmInit(o->L[j].lcm); 88 88 else 89 89 l[j].lcm=NULL; … … 483 483 { 484 484 /* deletes the short spoly and computes */ 485 p Free(strat->P.p);485 pLmFree(strat->P.p); 486 486 /* the real one */ 487 487 strat->P.p = ksOldCreateSpoly(strat->P.p1, … … 563 563 } 564 564 } 565 if (strat->P.lcm!=NULL) p Free(strat->P.lcm);565 if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm); 566 566 int i; 567 567 -
Singular/kutil.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1.6 0 2000-09-14 14:07:23obachman Exp $ */4 /* $Id: kutil.cc,v 1.61 2000-09-18 09:19:09 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for kStd … … 15 15 #include "tok.h" 16 16 #include "febase.h" 17 #include <omalloc.h>17 #include "omalloc.h" 18 18 #include "numbers.h" 19 19 #include "polys.h" … … 27 27 #include "kutil.h" 28 28 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 */ 36 static 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 29 66 static poly redMora (poly h,int maxIndex,kStrategy strat); 30 67 static poly redBba (poly h,int maxIndex,kStrategy strat); … … 462 499 463 500 if (set[j].lcm!=NULL) 464 p Free(set[j].lcm);501 pLmFree(set[j].lcm); 465 502 if (set[j].p!=NULL) 466 503 { 467 504 if (pNext(set[j].p) == strat->tail) 468 505 { 469 p Free(set[j].p);506 pLmFree(set[j].p); 470 507 /*- tail belongs to several int spolys -*/ 471 508 } … … 525 562 { 526 563 assume(p_sev == pGetShortExpVector(p)); 527 if (!p ShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at])) return;564 if (!pLmShortDivisibleBy(p,p_sev, strat->S[*at], ~ strat->sevS[*at])) return; 528 565 deleteInS((*at),strat); 529 566 (*at)--; … … 627 664 */ 628 665 strat->cp++; 629 p Free(Lp.lcm);666 pLmFree(Lp.lcm); 630 667 Lp.lcm=NULL; 631 668 return; … … 635 672 if (strat->fromT && (strat->ecartS[i]>ecart)) 636 673 { 637 p Free(Lp.lcm);674 pLmFree(Lp.lcm); 638 675 Lp.lcm=NULL; 639 676 return; … … 658 695 if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0)) 659 696 { 660 p Free(Lp.lcm);697 pLmFree(Lp.lcm); 661 698 return; 662 699 } … … 692 729 */ 693 730 strat->cp++; 694 p Free(Lp.lcm);731 pLmFree(Lp.lcm); 695 732 Lp.lcm=NULL; 696 733 return; … … 698 735 if (strat->fromT && (strat->ecartS[i]>ecart)) 699 736 { 700 p Free(Lp.lcm);737 pLmFree(Lp.lcm); 701 738 Lp.lcm=NULL; 702 739 return; … … 717 754 if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0)) 718 755 { 719 p Free(Lp.lcm);756 pLmFree(Lp.lcm); 720 757 return; 721 758 } … … 760 797 *the first case is handeled in chainCrit 761 798 */ 762 if (Lp.lcm!=NULL) p Free(Lp.lcm);799 if (Lp.lcm!=NULL) pLmFree(Lp.lcm); 763 800 } 764 801 else … … 793 830 { 794 831 strat->cp++; 795 p Free(Lp.lcm);832 pLmFree(Lp.lcm); 796 833 Lp.lcm=NULL; 797 834 return; … … 800 837 { 801 838 compare=pDivComp(strat->L[j].lcm,Lp.lcm); 802 if ((compare==1) || (p Equal(strat->L[j].lcm,Lp.lcm)))839 if ((compare==1) || (pLmEqual(strat->L[j].lcm,Lp.lcm))) 803 840 { 804 841 strat->c3++; 805 p Free(Lp.lcm);842 pLmFree(Lp.lcm); 806 843 return; 807 844 } … … 817 854 if (Lp.p == NULL) 818 855 { 819 p Free(Lp.lcm);856 pLmFree(Lp.lcm); 820 857 } 821 858 else … … 905 942 { 906 943 if (i < 0) break; 907 if (p Equal(strat->B[j].lcm,strat->B[i].lcm))944 if (pLmEqual(strat->B[j].lcm,strat->B[i].lcm)) 908 945 { 909 946 strat->c3++; … … 953 990 for(i=j-1; i>=0; i--) 954 991 { 955 if (p Equal(strat->B[j].lcm,strat->B[i].lcm))992 if (pLmEqual(strat->B[j].lcm,strat->B[i].lcm)) 956 993 { 957 994 strat->c3++; … … 1025 1062 { 1026 1063 if (i < 0) break; 1027 if ((strat->L[i].p2 == p) && p Equal(strat->L[j].lcm,strat->L[i].lcm))1064 if ((strat->L[i].p2 == p) && pLmEqual(strat->L[j].lcm,strat->L[i].lcm)) 1028 1065 { 1029 1066 /*L[i] could be canceled but we search for a better one to cancel*/ … … 1031 1068 if (isInPairsetL(i-1,strat->L[j].p1,strat->L[i].p1,&l,strat) 1032 1069 && (pNext(strat->L[l].p) == strat->tail) 1033 && (!p Equal(strat->L[i].p,strat->L[l].p))1070 && (!pLmEqual(strat->L[i].p,strat->L[l].p)) 1034 1071 && pDivisibleBy(p,strat->L[l].lcm)) 1035 1072 { … … 1211 1248 j++; 1212 1249 if (j > strat->sl) break; 1213 if (p ShortDivisibleBy(strat->S[i], strat->sevS[i],1250 if (pLmShortDivisibleBy(strat->S[i], strat->sevS[i], 1214 1251 strat->S[j], ~ strat->sevS[j])) 1215 1252 { … … 2256 2293 while (j <= pos) 2257 2294 { 2258 if (p ShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev)2295 if (pLmShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev) 2259 2296 && ((e >= strat->ecartS[j]) 2260 2297 || strat->kHEdgeFound) … … 2311 2348 while (j <= pos) 2312 2349 { 2313 if (p ShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev))2350 if (pLmShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev)) 2314 2351 { 2315 2352 strat->redTailChange=TRUE; … … 2357 2394 while (j <= pos) 2358 2395 { 2359 if (p ShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev)2360 && (!p Equal(strat->S[j],h)))2396 if (pLmShortDivisibleBy(strat->S[j], strat->sevS[j], hn, not_sev) 2397 && (!pLmEqual(strat->S[j],h))) 2361 2398 { 2362 2399 ksOldSpolyTail(strat->S[j], p, h, strat->kNoether); … … 2822 2859 while (j <= maxIndex) 2823 2860 { 2824 if (p ShortDivisibleBy(strat->S[j],strat->sevS[j],h, not_sev))2861 if (pLmShortDivisibleBy(strat->S[j],strat->sevS[j],h, not_sev)) 2825 2862 return ksOldSpolyRedNew(strat->S[j],h,strat->kNoether); 2826 2863 else j++; … … 2894 2931 while (j<=strat->sl) 2895 2932 { 2896 if (p ShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev))2933 if (pLmShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev)) 2897 2934 { 2898 2935 h = ksOldSpolyRed(strat->S[j],h,strat->kNoether); … … 2917 2954 while (j <= maxIndex) 2918 2955 { 2919 if (p ShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev))2956 if (pLmShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev)) 2920 2957 { 2921 2958 h = ksOldSpolyRed(strat->S[j],h,strat->kNoether); … … 2945 2982 do 2946 2983 { 2947 if (p ShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev)2984 if (pLmShortDivisibleBy(strat->S[j],strat->sevS[j], h, not_sev) 2948 2985 && ((e >= strat->ecartS[j]) || strat->kHEdgeFound)) 2949 2986 { … … 3144 3181 } 3145 3182 } 3146 if (redSi!=NULL) pDelete 1(&redSi);3183 if (redSi!=NULL) pDeleteLm(&redSi); 3147 3184 #ifdef KDEBUG 3148 3185 kTest(strat); … … 3449 3486 /*- set B: should be empty -*/ 3450 3487 omFreeSize((ADDRESS)strat->B,(strat->Bmax)*sizeof(LObject)); 3451 pDelete 1(&strat->tail);3488 pDeleteLm(&strat->tail); 3452 3489 strat->syzComp=0; 3453 3490 if (strat->kIdeal!=NULL) … … 3489 3526 { 3490 3527 if ((Q->m[q]!=NULL) 3491 &&(p Equal(r->m[l],Q->m[q])))3528 &&(pLmEqual(r->m[l],Q->m[q]))) 3492 3529 { 3493 3530 if (TEST_OPT_REDSB) … … 3570 3607 scComputeHC(strat->Shdl,ak,strat->kHEdge); 3571 3608 /* compare old and new noether*/ 3572 newNoether = p Init(strat->kHEdge);3609 newNoether = pLmInit(strat->kHEdge); 3573 3610 j = pFDeg(newNoether); 3574 3611 for (i=1; i<=pVariables; i++) … … 3598 3635 return TRUE; 3599 3636 } 3600 p Free(newNoether);3637 pLmFree(newNoether); 3601 3638 return FALSE; 3602 3639 } -
Singular/kutil.h
rf3398d r512a2b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kutil.h,v 1. 29 2000-09-14 14:07:24obachman Exp $ */6 /* $Id: kutil.h,v 1.30 2000-09-18 09:19:10 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT: kernel: utils for kStd … … 10 10 #include <string.h> 11 11 #include "structs.h" 12 #include <omalloc.h>12 #include "omalloc.h" 13 13 #include "ring.h" 14 14 -
Singular/libparse.l
rf3398d r512a2b 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 /* $Id: libparse.l,v 1.4 1 2000-09-04 13:39:00obachman Exp $ */5 /* $Id: libparse.l,v 1.42 2000-09-18 09:19:11 obachman Exp $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 20 20 #include "tok.h" 21 21 #include "febase.h" 22 #include <omalloc.h>22 #include "omalloc.h" 23 23 #endif 24 24 #include "libparse.h" -
Singular/lists.h
rf3398d r512a2b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: lists.h,v 1.1 3 2000-08-14 12:56:35obachman Exp $ */6 /* $Id: lists.h,v 1.14 2000-09-18 09:19:12 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT: handling of the list type 9 9 */ 10 10 #include "structs.h" 11 #include <omalloc.h>11 #include "omalloc.h" 12 12 #include "subexpr.h" 13 13 #include "tok.h" -
Singular/longalg.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longalg.cc,v 1.4 2 2000-09-12 16:01:01obachman Exp $ */4 /* $Id: longalg.cc,v 1.43 2000-09-18 09:19:12 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: algebraic numbers … … 12 12 #include "structs.h" 13 13 #include "tok.h" 14 #include <omalloc.h>14 #include "omalloc.h" 15 15 #include "febase.h" 16 16 #include "longrat.h" -
Singular/longrat.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longrat.cc,v 1.3 0 2000-08-14 12:56:36obachman Exp $ */4 /* $Id: longrat.cc,v 1.31 2000-09-18 09:19:13 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: computation with long rational numbers (Hubert Grassmann) … … 11 11 #include "mod2.h" 12 12 #include "tok.h" 13 #include <omalloc.h>13 #include "omalloc.h" 14 14 #include "febase.h" 15 15 #include "numbers.h" -
Singular/longrat0.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: longrat0.cc,v 1.1 1 2000-08-14 12:56:37obachman Exp $ */4 /* $Id: longrat0.cc,v 1.12 2000-09-18 09:19:14 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - … … 12 12 #include "mod2.h" 13 13 #include "tok.h" 14 #include <omalloc.h>14 #include "omalloc.h" 15 15 #include "febase.h" 16 16 #include "longrat.h" -
Singular/maps.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: maps.cc,v 1.2 7 2000-09-12 16:01:02obachman Exp $ */4 /* $Id: maps.cc,v 1.28 2000-09-18 09:19:15 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - the mapping of polynomials to other rings … … 15 15 #include "ideals.h" 16 16 #include "matpol.h" 17 #include <omalloc.h>17 #include "omalloc.h" 18 18 #include "kstd1.h" 19 19 #include "lists.h" … … 653 653 if (product == NULL) 654 654 { 655 pDelete 1(&p);655 pDeleteLm(&p); 656 656 } 657 657 else -
Singular/matpol.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: matpol.cc,v 1.3 4 2000-09-12 16:01:02obachman Exp $ */4 /* $Id: matpol.cc,v 1.35 2000-09-18 09:19:15 obachman Exp $ */ 5 5 6 6 /* … … 19 19 #include "kstd1.h" 20 20 #include "polys.h" 21 #include <omalloc.h>21 #include "omalloc.h" 22 22 #include "febase.h" 23 23 #include "numbers.h" … … 1596 1596 else 1597 1597 { 1598 pDelete 1(&a2);1598 pDeleteLm(&a2); 1599 1599 a = pNext(a) = a1; 1600 1600 pIter(a1); … … 1611 1611 } 1612 1612 } 1613 pDelete 1(&p);1613 pDeleteLm(&p); 1614 1614 return p; 1615 1615 } -
Singular/misc.cc
rf3398d r512a2b 15 15 16 16 #include "mod2.h" 17 #include <omalloc.h>17 #include "omalloc.h" 18 18 #include "structs.h" 19 19 #include "tok.h" -
Singular/mminit.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mminit.cc,v 1.2 0 2000-08-14 12:56:39obachman Exp $ */4 /* $Id: mminit.cc,v 1.21 2000-09-18 09:19:17 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: init of memory management … … 12 12 #include "mod2.h" 13 13 #include "mmalloc.h" 14 #include "structs.h" 14 15 // this prevents the definition of malloc/free ad macros 15 16 // by omalloc 16 17 #define OMALLOC_C 17 #include <omalloc.h>18 #include "omalloc.h" 18 19 19 20 extern "C" … … 42 43 mp_set_memory_functions(malloc,reallocSize,freeSize); 43 44 om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc; 45 #ifndef OM_NDEBUG 46 om_Opts.ErrorHook = dErrorBreak; 47 #endif 44 48 omInitInfo(); 45 49 #ifdef OM_SING_KEEP -
Singular/mod2.h.in
rf3398d r512a2b 6 6 * DO NOT EDIT! 7 7 * 8 * Version: $Id: mod2.h.in,v 1. 89 2000-09-14 14:07:24obachman Exp $8 * Version: $Id: mod2.h.in,v 1.90 2000-09-18 09:19:17 obachman Exp $ 9 9 *******************************************************************/ 10 10 #ifndef MOD2_H … … 339 339 define PDEBUG to 340 340 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) 343 343 -- see also polys.h for more info 344 344 345 345 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.: 347 347 348 348 #define PDEBUG 2 … … 352 352 makes sure that all poly operations in your file are done with 353 353 PDEBUG == 2 354 To break after an error occured, set a debugger breakpoint on 355 dErrorBreak. 354 356 */ 355 357 #ifndef PDEBUG 356 // do this to disable poly debugging357 // #undef PDEBUG358 358 #define PDEBUG 0 359 #endif360 361 /* PDEBUG requires MDEBUG -- obachman: really?? if yes, why???*/362 #ifdef PDEBUG363 #ifndef MDEBUG364 #define MDEBUG 0365 #endif366 359 #endif 367 360 … … 373 366 then omDebug routines are used for memory allocation/free: 374 367 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: 377 370 OM_TRACK: strored with address : extra space 378 371 0 : no additional info is stored : 0 … … 390 383 4 : and so on 391 384 ==> 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.: 395 391 #define OM_CHECK 3 396 392 #define OM_TRACK 5 397 #include <omalloc.h> 393 #define OM_KEEP 1 394 #include "mod2.h" 395 #include "omalloc.h" 398 396 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. 400 399 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; 404 406 ExternalRoutine(); 405 om_Opts.MinCheck = 0; omOpts.MinTrack = 0;407 om_Opts.MinCheck = check; omOpts.MinTrack = track; omOpts.Keep = keep; 406 408 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. 408 411 409 412 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; 416 426 + to find out where "memory corruption" occured, increase value of 417 427 OM_CHECK - the higher this value is, the more consistency checks are … … 430 440 However, keep in mind that the efficiency decreases from 431 441 Bin over Size to General routines (i.e., omFreeBin is more efficient than 432 omFreeSize which is more efficient than omFree, likewise w qith the alloc442 omFreeSize which is more efficient than omFree, likewise with the alloc 433 443 routines). 434 + if OM_CHECK is undef ed or 0, then all omCheck routines are undefined435 + 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 om Debug and omCheck routines are undefined438 + to break a t the time an omError occurswithin a debugger,439 set a breakpoint on omReportError440 + to do checks from within the debugger, or to do checks with ex licit444 + 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 441 451 check level, use omTest routines. 442 452 */ 443 453 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 445 460 #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 446 472 #define OM_SING_KEEP 1000 473 #endif 474 447 475 #endif /* MDEBUG */ 448 476 … … 539 567 ******************************************************************/ 540 568 541 #ifndef HAVE_ASSUME542 #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 549 569 #ifdef __cplusplus 550 570 extern "C" { … … 558 578 } 559 579 #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) 560 588 561 589 #define assume(x) _assume(x, __FILE__, __LINE__) -
Singular/modulop.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: modulop.cc,v 1.1 6 2000-08-14 12:56:39obachman Exp $ */4 /* $Id: modulop.cc,v 1.17 2000-09-18 09:19:18 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: numbers modulo p (<=32003) … … 12 12 #include "tok.h" 13 13 #include "febase.h" 14 #include <omalloc.h>14 #include "omalloc.h" 15 15 #include "numbers.h" 16 16 #include "longrat.h" -
Singular/mpr_base.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpr_base.cc,v 1.2 2 2000-09-12 16:01:03obachman Exp $ */4 /* $Id: mpr_base.cc,v 1.23 2000-09-18 09:19:18 obachman Exp $ */ 5 5 6 6 /* … … 14 14 #include "mod2.h" 15 15 16 #include <omalloc.h>16 #include "omalloc.h" 17 17 18 18 //-> includes … … 2252 2252 divCount= 0; 2253 2253 for ( k= 0; k < IDELEMS(pDegDiv); k++ ) 2254 if ( p DivisibleBy2( (pDegDiv->m)[k], resVectorList[j].mon ) )2254 if ( pLmDivisibleByNoComp( (pDegDiv->m)[k], resVectorList[j].mon ) ) 2255 2255 divCount++; 2256 2256 resVectorList[j].isReduced= (divCount == 1); … … 2271 2271 { 2272 2272 //mprPROTnl("\tfree"); 2273 if ( p DivisibleBy2( (pDegDiv->m)[ (*iVO)[k] ], resVectorList[j].mon ) )2273 if ( pLmDivisibleByNoComp( (pDegDiv->m)[ (*iVO)[k] ], resVectorList[j].mon ) ) 2274 2274 { 2275 2275 //mprPROTPnl("\tdivisible by ",(pDegDiv->m)[ (*iVO)[k] ]); … … 2278 2278 { 2279 2279 //mprPROTPnl("\tchecking db ",(pDegDiv->m)[ (*iVO)[i] ]); 2280 if ( p DivisibleBy2( (pDegDiv->m)[ (*iVO)[i] ], resVectorList[j].mon ) )2280 if ( pLmDivisibleByNoComp( (pDegDiv->m)[ (*iVO)[i] ], resVectorList[j].mon ) ) 2281 2281 { 2282 2282 //mprPROTPnl("\t and divisible by",(pDegDiv->m)[ (*iVO)[i] ]); … … 2392 2392 { 2393 2393 matEntry= nCopy(pGetCoeff(pi)); 2394 pmatchPos= p Init( pi );2394 pmatchPos= pLmInit( pi ); 2395 2395 pSetCoeff0( pmatchPos, nInit(1) ); 2396 2396 2397 2397 for ( i= 0; i < numVectors; i++) 2398 if ( p Equal( pmatchPos, resVectorList[i].mon ) )2398 if ( pLmEqual( pmatchPos, resVectorList[i].mon ) ) 2399 2399 break; 2400 2400 … … 2427 2427 2428 2428 for ( i= 0; i < numVectors; i++) 2429 if ( p Equal( pmp, resVectorList[i].mon ) )2429 if ( pLmEqual( pmp, resVectorList[i].mon ) ) 2430 2430 break; 2431 2431 -
Singular/mpr_complex.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpr_complex.cc,v 1.2 6 2000-08-14 12:56:40obachman Exp $ */4 /* $Id: mpr_complex.cc,v 1.27 2000-09-18 09:19:19 obachman Exp $ */ 5 5 6 6 /* … … 17 17 #include "structs.h" 18 18 #include "febase.h" 19 #include <omalloc.h>19 #include "omalloc.h" 20 20 #include "numbers.h" 21 21 #include "longrat.h" -
Singular/mpr_inout.cc
rf3398d r512a2b 3 3 ****************************************/ 4 4 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 $ */ 6 6 7 7 /* … … 22 22 #include "ipshell.h" 23 23 #include "febase.h" 24 #include <omalloc.h>24 #include "omalloc.h" 25 25 #include "numbers.h" 26 26 #include "lists.h" -
Singular/mpr_numeric.cc
rf3398d r512a2b 3 3 ****************************************/ 4 4 5 /* $Id: mpr_numeric.cc,v 1. 9 2000-08-14 12:56:41obachman Exp $ */5 /* $Id: mpr_numeric.cc,v 1.10 2000-09-18 09:19:20 obachman Exp $ */ 6 6 7 7 /* … … 18 18 #include "structs.h" 19 19 #include "febase.h" 20 #include <omalloc.h>20 #include "omalloc.h" 21 21 #include "numbers.h" 22 22 #include "polys.h" -
Singular/mpsr.h
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr.h,v 1.1 8 2000-08-14 12:56:41 obachman Exp $ */4 /* $Id: mpsr.h,v 1.19 2000-09-18 09:19:21 obachman Exp $ */ 5 5 /*************************************************************** 6 6 * … … 26 26 #include"structs.h" 27 27 #include"subexpr.h" 28 #include <omalloc.h>28 #include"omalloc.h" 29 29 #include"polys.h" 30 30 #include"numbers.h" -
Singular/mpsr_GetPoly.cc
rf3398d r512a2b 3 3 ****************************************/ 4 4 5 /* $Id: mpsr_GetPoly.cc,v 1.2 8 2000-09-12 16:01:03obachman Exp $ */5 /* $Id: mpsr_GetPoly.cc,v 1.29 2000-09-18 09:19:22 obachman Exp $ */ 6 6 7 7 /*************************************************************** … … 21 21 22 22 #include "gmp.h" 23 #include <omalloc.h>23 #include "omalloc.h" 24 24 #include "tok.h" 25 25 #include "ipid.h" … … 569 569 minpoly = maIMap(subring, minpoly); 570 570 r->minpoly = minpoly->coef; 571 p Free(minpoly);571 pLmFree(minpoly); 572 572 } 573 573 rKill(subring); -
Singular/mpsr_PutPoly.cc
rf3398d r512a2b 3 3 ****************************************/ 4 4 5 /* $Id: mpsr_PutPoly.cc,v 1. 19 2000-08-14 12:56:43obachman Exp $ */5 /* $Id: mpsr_PutPoly.cc,v 1.20 2000-09-18 09:19:22 obachman Exp $ */ 6 6 7 7 /*************************************************************** … … 23 23 #include "mpsr_Tok.h" 24 24 #include "longalg.h" 25 #include <omalloc.h>25 #include "omalloc.h" 26 26 #include "ring.h" 27 27 #include "polys.h" -
Singular/numbers.h
rf3398d r512a2b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: numbers.h,v 1.1 4 2000-09-14 13:04:38obachman Exp $ */6 /* $Id: numbers.h,v 1.15 2000-09-18 09:19:23 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT: interface to coefficient aritmetics … … 13 13 /*typedef void (*numberproc)(number a,number b,number * c);*/ 14 14 /*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)24 15 25 16 #define n_Copy(n, r) nCopy(n) -
Singular/pDebug.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pDebug.cc,v 1. 3 2000-09-14 14:20:44obachman Exp $9 * Version: $Id: pDebug.cc,v 1.4 2000-09-18 09:19:23 obachman Exp $ 10 10 *******************************************************************/ 11 11 … … 18 18 #ifdef PDEBUG 19 19 20 #include "p olys.h"20 #include "p_polys.h" 21 21 #include "febase.h" 22 22 #include "omalloc.h" 23 23 #include "ring.h" 24 #include "numbers.h" 24 25 25 26 … … 68 69 if (custom != NULL) 69 70 { 70 pPolyAssumeReturn(custom == r); 71 pPolyAssumeReturnMsg(custom == r || rEqual((ring) custom, r, FALSE), 72 "monomial not from specified ring"); 71 73 return TRUE; 72 74 } … … 101 103 static int pDivisibleBy_FALSE = 1; 102 104 static int pDivisibleBy_ShortFalse = 1; 103 BOOLEAN pDebug ShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1,105 BOOLEAN pDebugLmShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1, 104 106 poly p2, unsigned long not_sev_2, ring r_2) 105 107 { … … 108 110 109 111 pDivisibleBy_number++; 110 BOOLEAN ret = _p_DivisibleBy1(p1, r_1, p2, r_2);112 BOOLEAN ret = p_LmDivisibleBy(p1, r_1, p2, r_2); 111 113 if (! ret) pDivisibleBy_FALSE++; 112 114 if (sev_1 & not_sev_2) … … 205 207 206 208 // special check for ringorder_s/S 207 if ( currRing->order[1] == ringorder_S)209 if (r->order[1] == ringorder_S) 208 210 { 209 211 long c1, cc1, ccc1, ec1; 210 sro_ord* o = &( currRing->typ[1]);211 212 c1 = p GetComp(p);212 sro_ord* o = &(r->typ[1]); 213 214 c1 = p_GetComp(p, r); 213 215 cc1 = o->data.syzcomp.Components[c1]; 214 216 ccc1 = o->data.syzcomp.ShiftedComponents[cc1]; 215 217 pPolyAssumeReturnMsg(c1 == 0 || cc1 != 0, "Component <-> TrueComponent zero mismatch"); 216 218 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]; 218 220 pPolyAssumeReturnMsg(ec1 == ccc1, "Shifted comp out of sync. should %d, is %d"); 219 221 } … … 224 226 poly p_should_equal = p_DebugInit(p, r, r); 225 227 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); 227 229 } 228 230 … … 280 282 poly pnext = pNext(lm); 281 283 pNext(lm) = tail; 282 BOOLEAN cmp = p_LmCmp(lm, tail );284 BOOLEAN cmp = p_LmCmp(lm, tail, lmRing); 283 285 if (cmp != 1) 284 286 dPolyReportError(lm, lmRing, "wrong order: lm <= Lm(tail)"); -
Singular/pInline0.h
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * 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 $ 10 10 *******************************************************************/ 11 11 #ifndef PINLINE0_H … … 19 19 20 20 #include "mod2.h" 21 #include "p olys.h"21 #include "p_polys.h" 22 22 23 23 PINLINE0 void p_SetCompP(poly p, int i, ring r) -
Singular/pInline1.h
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pInline1.h,v 1. 2 2000-09-14 13:04:38obachman Exp $9 * Version: $Id: pInline1.h,v 1.3 2000-09-18 09:19:24 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef PINLINE1_H … … 13 13 14 14 #ifndef PDIV_DEBUG 15 // define to enable debugging/statistics of p ShortDivisibleBy15 // define to enable debugging/statistics of pLmShortDivisibleBy 16 16 #undef PDIV_DEBUG 17 17 #endif … … 43 43 44 44 #ifdef PDIV_DEBUG 45 BOOLEAN pDebug ShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1,45 BOOLEAN pDebugLmShortDivisibleBy(poly p1, unsigned long sev_1, ring r_1, 46 46 poly p2, unsigned long not_sev_2, ring r_2); 47 47 #endif … … 51 51 #include "omalloc.h" 52 52 #include "numbers.h" 53 #include "p olys.h"53 #include "p_polys.h" 54 54 #include "p_MemAdd.h" 55 55 #include "p_MemCopy.h" … … 68 68 return p; 69 69 } 70 PINLINE1 poly p_ Init(poly p, ring r)70 PINLINE1 poly p_LmInit(poly p, ring r) 71 71 { 72 72 p_CheckPolyRing1(p, r); 73 73 poly np; 74 74 omTypeAllocBin(poly, np, r->PolyBin); 75 p_SetRingOfPoly(np, r); 75 76 p_ExpVectorCopy(np, p, r); 76 77 _pNext(np) = NULL; … … 78 79 return np; 79 80 } 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 }88 81 PINLINE1 poly p_Head(poly p, ring r) 89 82 { … … 92 85 poly np; 93 86 omTypeAllocBin(poly, np, r->PolyBin); 87 p_SetRingOfPoly(np, r); 94 88 p_ExpVectorCopy(np, p, r); 95 89 _pNext(np) = NULL; 96 _pSetCoeff0(np, p_nCopy(_pGetCoeff(p), r));90 _pSetCoeff0(np, n_Copy(_pGetCoeff(p), r)); 97 91 return np; 98 92 } … … 231 225 } 232 226 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 do242 {243 i--;244 if (ep[i] != eq[i]) return FALSE;245 }246 while (i);247 return p_nEqual(pGetCoeff(p), pGetCoeff(q), r);248 }249 227 250 228 /*************************************************************** … … 253 231 * 254 232 ***************************************************************/ 255 static inline BOOLEAN _p_ DivisibleBy2(poly a, poly b, ring r)233 static inline BOOLEAN _p_LmDivisibleByNoComp(poly a, poly b, ring r) 256 234 { 257 235 int i=r->N; … … 266 244 return TRUE; 267 245 } 268 static inline BOOLEAN _p_ DivisibleBy2(poly a, ring r_a, poly b, ring r_b)246 static inline BOOLEAN _p_LmDivisibleByNoComp(poly a, ring r_a, poly b, ring r_b) 269 247 { 270 248 int i=r_a->N; … … 280 258 return TRUE; 281 259 } 282 static inline BOOLEAN _p_ DivisibleBy1(poly a, poly b, ring r)260 static inline BOOLEAN _p_LmDivisibleBy(poly a, poly b, ring r) 283 261 { 284 262 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); 286 264 return FALSE; 287 265 } 288 static inline BOOLEAN _p_ DivisibleBy1(poly a, ring r_a, poly b, ring r_b)266 static inline BOOLEAN _p_LmDivisibleBy(poly a, ring r_a, poly b, ring r_b) 289 267 { 290 268 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); 292 270 return FALSE; 293 271 } 294 295 PINLINE1 BOOLEAN p_DivisibleBy2(poly a, poly b, ring r) 272 PINLINE1 BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, ring r) 296 273 { 297 274 p_CheckPolyRing1(a, r); 298 275 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 } 278 PINLINE1 BOOLEAN p_LmDivisibleBy(poly a, poly b, ring r) 302 279 { 303 280 p_CheckPolyRing1(b, r); 304 281 pIfThen1(a != NULL, p_CheckPolyRing1(b, r)); 305 282 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); 307 284 return FALSE; 308 285 } 309 286 PINLINE1 BOOLEAN p_DivisibleBy(poly a, poly b, ring r) 310 287 { 311 p _CheckPolyRing1(b, r);288 pIfThen1(b!=NULL, p_CheckPolyRing1(b, r)); 312 289 pIfThen1(a!=NULL, p_CheckPolyRing1(a, r)); 313 290 314 291 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); 316 293 return FALSE; 317 294 } 318 319 PINLINE1 BOOLEAN p_ShortDivisibleBy(poly a, unsigned long sev_a, 295 PINLINE1 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 } 301 PINLINE1 BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, 320 302 poly b, unsigned long not_sev_b, ring r) 321 303 { … … 328 310 if (sev_a & not_sev_b) 329 311 { 330 pAssume1(p_ DivisibleBy2(a, b, r) == FALSE);312 pAssume1(p_LmDivisibleByNoComp(a, b, r) == FALSE); 331 313 return FALSE; 332 314 } 333 return p_ DivisibleBy1(a, b, r);315 return p_LmDivisibleBy(a, b, r); 334 316 #else 335 return pDebug ShortDivisibleBy(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 321 PINLINE1 BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, ring r_a, 340 322 poly b, unsigned long not_sev_b, ring r_b) 341 323 { … … 348 330 if (sev_a & not_sev_b) 349 331 { 350 pAssume1(_p_ DivisibleBy2(a, r_a, b, r_b) == FALSE);332 pAssume1(_p_LmDivisibleByNoComp(a, r_a, b, r_b) == FALSE); 351 333 return FALSE; 352 334 } 353 return _p_ DivisibleBy1(a, r_a, b, r_b);335 return _p_LmDivisibleBy(a, r_a, b, r_b); 354 336 #else 355 return pDebug ShortDivisibleBy(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); 356 338 #endif 357 339 } -
Singular/pInline2.h
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pInline2.h,v 1. 3 2000-09-14 13:04:39obachman Exp $9 * Version: $Id: pInline2.h,v 1.4 2000-09-18 09:19:24 obachman Exp $ 10 10 *******************************************************************/ 11 11 #ifndef PINLINE2_H … … 22 22 #include "omalloc.h" 23 23 #include "structs.h" 24 #include "p olys.h"24 #include "p_polys.h" 25 25 #include "numbers.h" 26 26 #include "p_Procs.h" … … 30 30 { 31 31 p_CheckPolyRing2(p, r); 32 p_nDelete(&(p->coef), r);32 n_Delete(&(p->coef), r); 33 33 (p)->coef=n; 34 34 return n; … … 178 178 } 179 179 180 PINLINE2 void p_Delete 1(poly *p, ring r)180 PINLINE2 void p_DeleteLm(poly *p, ring r) 181 181 { 182 182 pIfThen2(*p != NULL, p_CheckPolyRing2(*p, r)); … … 184 184 if (h != NULL) 185 185 { 186 p_nDelete(&_pGetCoeff(h), r);186 n_Delete(&_pGetCoeff(h), r); 187 187 *p = _pNext(h); 188 188 omFreeBinAddr(h); 189 189 } 190 191 } 192 PINLINE2 void p_Free(poly p, ring r) 190 } 191 PINLINE2 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 } 200 PINLINE2 void p_LmFree(poly p, ring r) 193 201 { 194 202 p_CheckPolyRing2(p, r); 195 203 omFreeBinAddr(p); 196 204 } 197 PINLINE2 poly p_FreeAndNext(poly p, ring r) 198 { 199 p_CheckPolyRing2(p, r); 200 poly pnext = _pNext(p); 205 PINLINE2 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 } 212 PINLINE2 poly p_LmFreeAndNext(poly p, ring r) 213 { 214 p_CheckPolyRing2(p, r); 215 poly pnext = pNext(p); 201 216 omFreeBinAddr(p); 202 217 return pnext; … … 205 220 { 206 221 p_CheckPolyRing2(p, r); 207 p_nDelete(&_pGetCoeff(p), r);222 n_Delete(&_pGetCoeff(p), r); 208 223 omFreeBinAddr(p); 209 224 } 225 PINLINE2 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 } 210 233 PINLINE2 poly p_LmDeleteAndNext(poly p, ring r) 211 234 { 212 235 p_CheckPolyRing2(p, r); 213 236 poly pnext = _pNext(p); 214 p_nDelete(&_pGetCoeff(p), r);237 n_Delete(&_pGetCoeff(p), r); 215 238 omFreeBinAddr(p); 216 239 return pnext; … … 369 392 int shorter; 370 393 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); 373 396 pSetCoeff0(m, n_neg); 374 397 375 398 res = r->p_Procs->p_Minus_mm_Mult_qq(p, m, q, shorter, NULL, r); 376 399 pSetCoeff0(m, n_old); 377 p_nDelete(&n_neg, r);400 n_Delete(&n_neg, r); 378 401 return res; 379 402 } -
Singular/p_Add_q__Template.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * 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 $ 10 10 *******************************************************************/ 11 11 … … 19 19 poly p_Add_q(poly p, poly q, int &Shorter, const ring r) 20 20 { 21 p Test(p);22 p Test(q);23 #if def PDEBUG21 p_Test(p, r); 22 p_Test(q, r); 23 #if PDEBUG > 0 24 24 int l = pLength(p) + pLength(q); 25 25 #endif … … 38 38 39 39 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); 41 41 42 42 Equal: 43 43 n1 = pGetCoeff(p); 44 44 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); 49 49 50 if ( p_nIsZero(t, r))50 if (n_IsZero(t, r)) 51 51 { 52 52 shorter += 2; 53 p_nDelete(&t, r);54 FreeAndAdvance(p);53 n_Delete(&t, r); 54 p = p_LmFreeAndNext(p, r); 55 55 } 56 56 else … … 81 81 Shorter = shorter; 82 82 83 p Test(pNext(&rp));84 #if def PDEBUG85 assume(l - pLength(pNext(&rp)) == Shorter);83 p_Test(pNext(&rp), r); 84 #if PDEBUG > 0 85 pAssume1(l - pLength(pNext(&rp)) == Shorter); 86 86 #endif 87 87 return pNext(&rp); -
Singular/p_Copy__Template.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_Copy__Template.cc,v 1. 2 2000-09-12 16:01:06obachman Exp $9 * Version: $Id: p_Copy__Template.cc,v 1.3 2000-09-18 09:19:25 obachman Exp $ 10 10 *******************************************************************/ 11 11 12 12 poly p_Copy(poly s_p, const ring r) 13 13 { 14 pTest(s_p); 14 // let's not do tests here -- but instead allow 15 // to be sloppy 15 16 spolyrec dp; 16 17 poly d_p = &dp; … … 22 23 while (s_p != NULL) 23 24 { 24 omTypeAllocBin(poly, pNext(d_p), bin);25 p_AllocBin(pNext(d_p), bin, r); 25 26 pIter(d_p); 26 pSetCoeff0(d_p, p_nCopy(pGetCoeff(s_p), r));27 pSetCoeff0(d_p, n_Copy(pGetCoeff(s_p), r)); 27 28 // it is better to iter here, 28 29 // for MemCopy advances goes from low to high addresses … … 33 34 pNext(d_p) = NULL; 34 35 35 pTest(dp.next);36 #if PDEBUG37 assume(pEqual(s_p, dp.next));38 #endif39 36 return dp.next; 40 37 } -
Singular/p_Delete__Template.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_Delete__Template.cc,v 1. 1 2000-08-24 14:42:43obachman Exp $9 * Version: $Id: p_Delete__Template.cc,v 1.2 2000-09-18 09:19:25 obachman Exp $ 10 10 *******************************************************************/ 11 11 … … 16 16 while (p != NULL) 17 17 { 18 p_nDelete(&(p->coef), r);19 FreeAndAdvance(p);18 n_Delete(&(p->coef), r); 19 p = p_LmFreeAndNext(p, r); 20 20 } 21 21 *pp = NULL; -
Singular/p_Minus_mm_Mult_qq__Template.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * 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 $ 10 10 *******************************************************************/ 11 11 … … 20 20 poly p_Minus_mm_Mult_qq(poly p, poly m, poly q, int& Shorter, const poly spNoether, const ring r) 21 21 { 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 24 30 Shorter = 0; 25 31 // we are done if q == NULL || m == NULL … … 27 33 28 34 spolyrec rp; 29 poly a = &rp, 35 poly a = &rp, // collects the result 30 36 qm = NULL, // stores q*m 31 37 c; // used for temporary storage … … 33 39 34 40 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) 36 42 tb, // used for tm*coeff(a1) 37 43 tc; // used as intermediate number … … 47 53 if (p == NULL) goto Finish; // return tneg*q if (p == NULL) 48 54 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: 51 60 p_MemSum(qm->exp, q->exp, m_e, length); 52 53 // MAIN LOOP: 54 Top: 61 CmpTop: 55 62 // compare qm = m*q and p w.r.t. monomial ordering 56 63 p_MemCmp(qm->exp, p->exp, length, ordsgn, goto Equal, goto Greater, goto Smaller ); 57 64 58 65 Equal: // qm equals p 59 tb = p_nMult(pGetCoeff(q), tm, r);66 tb = n_Mult(pGetCoeff(q), tm, r); 60 67 tc = pGetCoeff(p); 61 if (! p_nEqual(tc, tb, r))68 if (!n_Equal(tc, tb, r)) 62 69 { 63 70 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); 66 73 pSetCoeff0(p,tc); // adjust coeff of p 67 74 a = pNext(a) = p; // append p to result and advance p … … 71 78 { // coeffs are equal, so their difference is 0: 72 79 shorter += 2; 73 p_nDelete(&tc, r);74 FreeAndAdvance(p);80 n_Delete(&tc, r); 81 p = p_LmFreeAndNext(p, r); 75 82 } 76 p_nDelete(&tb, r);83 n_Delete(&tb, r); 77 84 pIter(q); 78 85 if (q == NULL || p == NULL) goto Finish; // are we done ? 79 86 // no, so update qm 80 p_MemSum(qm->exp, q->exp, m_e, length); 81 goto Top; 82 87 goto SumTop; 88 83 89 84 90 Greater: 85 pSetCoeff0(qm, p_nMult(pGetCoeff(q), tneg, r));91 pSetCoeff0(qm, n_Mult(pGetCoeff(q), tneg, r)); 86 92 a = pNext(a) = qm; // append qm to result and advance q 87 93 pIter(q); … … 92 98 } 93 99 // construct new qm 94 omTypeAllocBin(poly, qm, bin); 95 p_MemSum(qm->exp, q->exp, m_e, length); 96 goto Top; 100 goto AllocTop; 97 101 98 102 Smaller: … … 100 104 pIter(p); 101 105 if (p == NULL) goto Finish;; 102 goto Top;106 goto CmpTop; 103 107 104 108 105 109 Finish: // q or p is NULL: Clean-up time 106 107 110 if (q == NULL) // append rest of p to result 108 111 pNext(a) = p; … … 114 117 } 115 118 116 p_nDelete(&tneg, r);117 if (qm != NULL) omFreeBinAddr(qm);119 n_Delete(&tneg, r); 120 if (qm != NULL) p_FreeBinAddr(qm, r); 118 121 Shorter = shorter; 119 p Test(pNext(&rp));122 p_Test(pNext(&rp), r); 120 123 return pNext(&rp); 121 124 } -
Singular/p_Mult_mm__Template.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_Mult_mm__Template.cc,v 1. 3 2000-09-12 16:01:07obachman Exp $9 * Version: $Id: p_Mult_mm__Template.cc,v 1.4 2000-09-18 09:19:26 obachman Exp $ 10 10 *******************************************************************/ 11 11 … … 19 19 poly p_Mult_mm(poly p, const poly m, const ring ri) 20 20 { 21 pTest(p); 21 p_Test(p, ri); 22 p_LmTest(m, ri); 22 23 if (p == NULL) return NULL; 24 pAssume(m != NULL); 23 25 poly q = p; 24 26 number ln = pGetCoeff(m); 25 27 DECLARE_LENGTH(const unsigned long length = ri->ExpLSize); 26 28 const unsigned long* m_e = m->exp; 27 assume(!p_nIsZero(ln,r));29 pAssume(!n_IsZero(ln,ri)); 28 30 29 31 while (p != NULL) 30 32 { 31 pSetCoeff0(p, p_nMult(ln, pGetCoeff(p), ri));33 pSetCoeff0(p, n_Mult(ln, pGetCoeff(p), ri)); 32 34 p_MemAdd(p->exp, m_e, length); 33 35 p = pNext(p); 34 36 } 35 p Test(q);37 p_Test(q, ri); 36 38 return q; 37 39 } -
Singular/p_Mult_nn__Template.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_Mult_nn__Template.cc,v 1. 1 2000-08-29 14:10:27obachman Exp $9 * Version: $Id: p_Mult_nn__Template.cc,v 1.2 2000-09-18 09:19:26 obachman Exp $ 10 10 *******************************************************************/ 11 11 … … 19 19 poly p_Mult_nn(poly p, const number n, const ring r) 20 20 { 21 assume(!p_nIsZero(n,r));22 p Test(p);21 pAssume(!n_IsZero(n,r)); 22 p_Test(p, r); 23 23 24 24 poly q = p; … … 26 26 { 27 27 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); 30 30 pIter(p); 31 31 } 32 p Test(q);32 p_Test(q, r); 33 33 return q; 34 34 } -
Singular/p_Mult_q.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_Mult_q.cc,v 1. 4 2000-09-14 13:04:39obachman Exp $9 * Version: $Id: p_Mult_q.cc,v 1.5 2000-09-18 09:19:26 obachman Exp $ 10 10 *******************************************************************/ 11 11 #include "mod2.h" … … 17 17 * Assumes: pLength(p) >= 2 pLength(q) >=2 18 18 ***************************************************************/ 19 #include "p olys.h"19 #include "p_polys.h" 20 20 #include "p_Procs.h" 21 21 #include "p_Numbers.h" … … 25 25 { 26 26 assume(p != NULL && pNext(p) != NULL && q != NULL && pNext(q) != NULL); 27 pAssume (! pHaveCommonMonoms(p, q));28 p Test(p);29 p Test(q);27 pAssume1(! pHaveCommonMonoms(p, q)); 28 p_Test(p, r); 29 p_Test(q, r); 30 30 31 31 poly res = pp_Mult_mm(p,q,r); // holds initially q1*p … … 68 68 Equal: 69 69 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)) 73 73 { 74 p_nDelete(&n, r);75 rn = p FreeAndNext(rn);74 n_Delete(&n, r); 75 rn = p_LmFreeAndNext(rn, r); 76 76 } 77 77 else … … 81 81 pIter(rn); 82 82 } 83 p_nDelete(&pGetCoeff(qn),r);84 qn = p FreeAndNext(qn);83 n_Delete(&pGetCoeff(qn),r); 84 qn = p_LmFreeAndNext(qn, r); 85 85 goto Work; 86 86 … … 91 91 p_Delete(&q, r); 92 92 } 93 p Test(res);93 p_Test(res, r); 94 94 return res; 95 95 } -
Singular/p_Neg__Template.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * 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 $ 10 10 *******************************************************************/ 11 11 … … 21 21 while (p != NULL) 22 22 { 23 pSetCoeff0(p, p_nNeg(pGetCoeff(p), r));23 pSetCoeff0(p, n_Neg(pGetCoeff(p), r)); 24 24 pIter(p); 25 25 } -
Singular/p_Numbers.h
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * 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 $ 10 10 *******************************************************************/ 11 11 #ifndef P_NUMBERS_H … … 13 13 14 14 #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) 23 23 24 24 #include "modulop.h" 25 #define p_nCopy_FieldZp(n, r)n26 #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) 33 33 34 34 #endif -
Singular/p_Procs.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: p_Procs.cc,v 1. 7 2000-09-14 15:06:33obachman Exp $9 * Version: $Id: p_Procs.cc,v 1.8 2000-09-18 09:19:27 obachman Exp $ 10 10 *******************************************************************/ 11 11 #include <string.h> … … 499 499 ***************************************************************/ 500 500 #include "structs.h" 501 #include "p_polys.h" 501 502 #include "ring.h" 502 #include "polys.h"503 #include "polys-impl.h"504 503 #include "p_Procs.h" 505 504 #include "p_Numbers.h" … … 507 506 #include "p_MemAdd.h" 508 507 #include "p_MemCopy.h" 509 #ifndef TEST_P_PROCS510 #undef pTest511 #define pTest(p) ((void)0)512 #endif513 514 #define FreeAndAdvance(p) \515 do \516 { \517 poly _pn = pNext(p); \518 omFreeBinAddr(p); \519 p = _pn; \520 } \521 while (0)522 508 523 509 #include "p_Procs.inc" … … 698 684 } 699 685 700 const char* macros_field[] = {" p_nCopy","p_nDelete", "p_nMult", "p_nAdd", "p_nSub", "p_nIsZero", "p_nEqual" , "p_nNeg", NULL};686 const char* macros_field[] = {"n_Copy","n_Delete", "n_Mult", "n_Add", "n_Sub", "n_IsZero", "n_Equal" , "n_Neg", NULL}; 701 687 702 688 const char* macros_length[] = -
Singular/p_Procs.h
rf3398d r512a2b 8 8 * Author: obachman (Olaf Bachmann) 9 9 * 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 $ 11 11 *******************************************************************/ 12 12 #ifndef P_PROCS_H 13 13 #define P_PROCS_H 14 14 #include "structs.h" 15 16 // define/undef P_INLINE to inline some procedures17 #undef NO_P_INLINE18 #if defined(NDEBUG) && !defined(NO_INLINE)19 #define P_INLINE inline20 #else21 #define NO_P_INLINE 122 #define P_INLINE23 #endif24 25 26 // NOTE: the actual procedures below are not inlined,27 // only the dispatching function call28 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 != NULL36 P_INLINE int p_LmCmp(const poly p, const poly q, const ring r = currRing);37 38 /*------------- Arithmetic operations ----------------------*/39 15 40 16 /*------------- p_Proc stuff ----------------------*/ … … 75 51 #endif 76 52 77 #include "p_Inline.cc"78 79 53 #endif /* ! P_PROCS_H */ -
Singular/p_ShallowCopyDelete__Template.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * 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 $ 10 10 *******************************************************************/ 11 11 … … 27 27 while (s_p != NULL) 28 28 { 29 omTypeAllocBin(poly, d_p->next, d_bin);29 p_AllocBin( d_p->next, d_bin, r); 30 30 pIter(d_p); 31 31 pSetCoeff0(d_p, pGetCoeff(s_p)); … … 33 33 s_p = pNext(s_p); 34 34 p_MemCopy(d_p->exp, h->exp, length); 35 omFreeBinAddr(h);35 p_FreeBinAddr(h, r); 36 36 } 37 37 pNext(d_p) = NULL; -
Singular/pcv.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: pcv.cc,v 1.3 0 2000-09-12 16:01:08 obachman Exp $ */4 /* $Id: pcv.cc,v 1.31 2000-09-18 09:19:28 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: conversion between polys and coef vectors … … 244 244 else 245 245 { 246 pDelete 1(&m);246 pDeleteLm(&m); 247 247 return NULL; 248 248 } … … 439 439 for(int d=d0,i=0;d<d1;d++) 440 440 i=pcvBasis(b,i,m,d,1); 441 pDelete 1(&m);441 pDeleteLm(&m); 442 442 return b; 443 443 } -
Singular/polys-impl.h
rf3398d r512a2b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys-impl.h,v 1.5 5 2000-09-14 15:06:34obachman Exp $ */6 /* $Id: polys-impl.h,v 1.56 2000-09-18 09:19:29 obachman Exp $ */ 7 7 8 8 /*************************************************************** … … 183 183 #define pPolyAssumeReturn1 pPolyAssumeReturn 184 184 #define _pPolyAssumeReturn1 _pPolyAssumeReturn 185 #define p_SetRingOfPoly1 p_SetRingOfPoly186 185 #define p_CheckPolyRing1 p_CheckPolyRing 187 186 #define p_CheckRing1 p_CheckRing … … 194 193 #define pPolyAssumeReturn1(cond) ((void)0) 195 194 #define _pPolyAssumeReturn1(cond,p,r)((void)0) 196 #define p_SetRingOfPoly1(p,r) ((void)0)197 195 #define p_CheckPolyRing1(p,r) ((void)0) 198 196 #define p_CheckRing1(r) ((void)0) … … 207 205 #define pPolyAssumeReturn2 pPolyAssumeReturn 208 206 #define _pPolyAssumeReturn2 _pPolyAssumeReturn 209 #define p_SetRingOfPoly2 p_SetRingOfPoly210 207 #define p_CheckPolyRing2 p_CheckPolyRing 211 208 #define p_CheckRing2 p_CheckRing … … 218 215 #define pPolyAssumeReturn2(cond) ((void)0) 219 216 #define _pPolyAssumeReturn2(cond,p,r)((void)0) 220 #define p_SetRingOfPoly2(p,r) ((void)0)221 217 #define p_CheckPolyRing2(p,r) ((void)0) 222 218 #define p_CheckRing2(r) ((void)0) … … 238 234 #define _p_GetComp(p, r) ((long) (r->pCompIndex >= 0 ? __p_GetComp(p, r) : 0)) 239 235 240 241 242 236 /*************************************************************** 237 * 238 * Macros for low-level allocation 239 * 240 ***************************************************************/ 241 #ifdef PDEBUG 242 #define p_AllocBin(p, bin, r) \ 243 do \ 244 { \ 245 omTypeAllocBin(poly, p, bin); \ 246 p_SetRingOfPoly(p, r); \ 247 } \ 248 while (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 243 254 244 255 /*************************************************************** -
Singular/polys.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys.cc,v 1.6 1 2000-09-13 13:16:40 SingularExp $ */4 /* $Id: polys.cc,v 1.62 2000-09-18 09:19:29 obachman Exp $ */ 5 5 6 6 /* … … 14 14 #include "mod2.h" 15 15 #include "tok.h" 16 #include <omalloc.h>16 #include "omalloc.h" 17 17 #include "febase.h" 18 18 #include "numbers.h" … … 827 827 if (prev==NULL) 828 828 { 829 pDelete 1(&result);829 pDeleteLm(&result); 830 830 a=result; 831 831 } 832 832 else 833 833 { 834 pDelete 1(&pNext(prev));834 pDeleteLm(&pNext(prev)); 835 835 a=pNext(prev); 836 836 } … … 902 902 done: 903 903 ok=!errorreported; 904 if (nIsZero(pGetCoeff(rc))) pDelete 1(&rc);904 if (nIsZero(pGetCoeff(rc))) pDeleteLm(&rc); 905 905 else 906 906 { … … 1286 1286 poly q; 1287 1287 1288 while ((*p!=NULL) && (pGetComp(*p)==k)) pDelete 1(p);1288 while ((*p!=NULL) && (pGetComp(*p)==k)) pDeleteLm(p); 1289 1289 if (*p==NULL) return; 1290 1290 q = *p; … … 1297 1297 { 1298 1298 if (pGetComp(pNext(q))==k) 1299 pDelete 1(&(pNext(q)));1299 pDeleteLm(&(pNext(q))); 1300 1300 else 1301 1301 { … … 1329 1329 1330 1330 1331 /* Hmm ... this should be inlined or made more efficient:1332 see Long/mregular.tst */1333 /*21334 *should return 1 if p divides q and p<q,1335 * -1 if q divides p and q<p1336 * 0 otherwise1337 */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 else1356 {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 }1367 1331 /*2 1368 1332 *divides p1 by its leading monomial … … 1525 1489 if (pGetExp(pNext(h),n)!=0) 1526 1490 { 1527 pDelete 1(&pNext(h));1491 pDeleteLm(&pNext(h)); 1528 1492 } 1529 1493 else … … 1580 1544 res=pAdd(res,m); 1581 1545 } 1582 pDelete 1(&h);1546 pDeleteLm(&h); 1583 1547 } 1584 1548 omFreeSize((ADDRESS)me,(pVariables+1)*sizeof(Exponent_t)); -
Singular/polys.h
rf3398d r512a2b 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys.h,v 1.3 7 2000-09-14 13:04:40 obachman Exp $ */6 /* $Id: polys.h,v 1.38 2000-09-18 09:19:30 obachman Exp $ */ 7 7 /* 8 * ABSTRACT - all basic methods to manipulate polynomials 8 * ABSTRACT - all basic methods to manipulate polynomials of the 9 currRing 9 10 */ 10 11 11 #include "structs.h" 12 #include "polys-impl.h" 13 /*************************************************************** 12 #include "p_polys.h" 13 /* 14 14 Some general remarks: 15 15 We divide poly operations into roughly 4 categories: … … 37 37 - debugging if PDEBUG >= 0 38 38 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" 40 42 However, PDEBUG will only be in effect, if !NDEBUG. 41 43 … … 44 46 just macros to the respective p_*(..,currRing). 45 47 46 ***************************************************************/48 */ 47 49 48 50 /*************************************************************** … … 52 54 * 53 55 ***************************************************************/ 54 // next55 #define pNext(p) _pNext(p)56 #define pIter(p) _pIter(p)57 58 // coeff59 #define pGetCoeff(p) _pGetCoeff(p)60 56 // deletes old coeff before setting the new one 61 57 #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);66 58 67 59 // Order 68 60 #define pGetOrder(p) p_GetOrder(p, currRing) 69 PINLINE2 Order_t p_GetOrder(poly p, ring r);70 61 // don't use this 71 62 #define pSetOrder(p, o) p_SetOrder(p, o, currRing) 72 PINLINE2 Order_t p_SetOrder(poly p, long order, ring r);73 63 74 64 // Component … … 79 69 #define pAddComp(p,v) p_AddComp(p,v,currRing) 80 70 #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);87 71 88 72 // Exponent … … 94 78 #define pSubExp(p,i,v) p_SubExp(p,i,v, currRing) 95 79 #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) 107 82 108 83 /*************************************************************** 109 84 * 110 85 * 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 * 112 88 ***************************************************************/ 113 89 // allocates the space for a new monomial -- no initialization !!! 114 90 #define pNew() p_New(currRing) 115 91 // 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 120 98 #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) 101 static inline void pDeleteLm(poly *p) {p_DeleteLm(p, currRing);} 102 // if (p!=NULL) delete p-coef and p 103 static inline void pDeleteLm(poly p) {p_DeleteLm(p, currRing);} 123 104 // frees the space of the monomial m, assumes m != NULL 124 105 // coef is not freed, m is not advanced 125 #define pFree(m) p_Free(m, currRing) 106 static inline void pLmFree(poly p) {p_LmFree(p, currRing);} 107 // like pLmFree, but advances p 108 static inline void pLmFree(poly *p) {p_LmFree(p, currRing);} 126 109 // assumes p != NULL, deletes p, returns pNext(p) 127 #define p FreeAndNext(p) p_FreeAndNext(p, currRing)110 #define pLmFreeAndNext(p) p_LmFreeAndNext(p, currRing) 128 111 // assume p != NULL, deletes Lm(p)->coef and Lm(p) 129 112 #define pLmDelete(p) p_LmDelete(p, currRing) 130 113 // like pLmDelete, returns pNext(p) 131 114 #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);142 115 // used by iparith.cc 143 116 extern poly pHeadProc(poly p); … … 148 121 * 149 122 ***************************************************************/ 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, otherwise161 PINLINE1 BOOLEAN p_ExpVectorEqual(poly p1, poly p2, ring r);162 // returns sum of all exponents163 PINLINE1 unsigned long p_ExpVectorQuerSum(poly p, ring r);164 123 165 124 #define pExpVectorCopy(d_p, s_p) p_ExpVectorCopy(d_p, s_p, currRing) … … 170 129 #define pExpVectorEqual(p1, p2) p_ExpVectorEqual(p1, p2, currRing) 171 130 #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 176 134 // filled in as follows: comp, e_1, .., e_n 177 135 #define pGetExpV(p, e) p_GetExpV(p, e, currRing) 178 136 #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 187 141 * 188 142 ***************************************************************/ … … 193 147 #define pLmCmpAction(p,q, actionE, actionG, actionS) \ 194 148 _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) 202 151 203 152 // pCmp: args may be NULL 204 153 // returns: (p2==NULL ? 1 : (p1 == NULL ? -1 : p_LmCmp(p1, p2))) 205 154 #define pCmp(p1, p2) p_Cmp(p1, p2, currRing) 206 PINLINE2 int p_Cmp(poly p1, poly p2, ring r);207 155 208 156 … … 214 162 ***************************************************************/ 215 163 // 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 != NULL164 // i.e., if there exists a expvector c > 0, s.t. b = a + c; 217 165 #define pDivisibleBy(a, b) p_DivisibleBy(a,b,currRing) 218 // like pDivisibleBy, except that it is assumed that a!=NULL 219 #define p DivisibleBy1(a,b) p_DivisibleBy1(a,b,currRing)220 // like p DivisibleBy1, does not check components221 #define p DivisibleBy2(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) 222 170 // Divisibility tests based on Short Exponent vectors 223 171 // sev_a == pGetShortExpVector(a) 224 172 // 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) 228 175 // returns the "Short Exponent Vector" -- used to speed up divisibility 229 176 // tests (see polys-impl.cc ) 230 177 #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);236 178 237 179 /*************************************************************** … … 242 184 // return a copy of the poly 243 185 #define pCopy(p) p_Copy(p, currRing) 244 // returns a copy of p245 PINLINE2 poly p_Copy(poly p, const ring r);246 // returns a copy of p with Lm(p) from lmRing and Tail(p) from tailRing247 PINLINE2 poly p_Copy(poly p, const ring lmRing, const ring tailRing);248 // deletes *p, and sets *p to NULL249 PINLINE2 void p_Delete(poly *p, const ring r);250 186 #define pDelete(p_ptr) p_Delete(p_ptr, currRing) 251 252 187 253 188 /*************************************************************** … … 261 196 * 262 197 ***************************************************************/ 263 // returns -p, p is destroyed264 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 p269 PINLINE2 poly p_Mult_nn(poly p, number n, const ring r);270 271 // returns p*m, does neither destroy p nor m272 PINLINE2 poly pp_Mult_mm(poly p, poly m, const ring r);273 // returns p*m, destroys p, const: m274 PINLINE2 poly p_Mult_mm(poly p, poly m, const ring r);275 276 // returns p+q, destroys p and q277 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,m283 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, m289 PINLINE2 poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, const ring r);290 291 // returns p*q, destroys p and q292 PINLINE2 poly p_Mult_q(poly p, poly q, const ring r);293 // returns p*q, does neither destroy p nor q294 PINLINE2 poly pp_Mult_qq(poly p, poly q, const ring r);295 296 198 #define pNeg(p) p_Neg(p, currRing) 297 199 #define ppMult_nn(p, n) pp_Mult_nn(p, n, currRing) … … 342 244 /*-----------the ordering of monomials:-------------*/ 343 245 #define pSetm(p) p_Setm(p, currRing) 344 extern void p_Setm(poly p, ring r);345 246 // TODO: 346 247 #define pSetmComp pSetm 347 #define p_SetmComp p_Setm348 248 349 249 extern pLDegProc pLDeg; … … 379 279 poly pDiffOp(poly a, poly b,BOOLEAN multiply); 380 280 381 int pLength(poly a);382 281 int pMaxComp(poly p); 383 282 int pMinComp(poly p, ring r=currRing); … … 385 284 int pWeight(int c); 386 285 #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);389 286 390 287 … … 463 360 464 361 /*-----------specials for spoly-computations--------------*/ 465 int pDivComp(poly p, poly q);466 362 BOOLEAN pCompareChain (poly p,poly p1,poly p2,poly lcm); 467 363 BOOLEAN pEqualPolys(poly p1,poly p2); 468 364 BOOLEAN pComparePolys(poly p1,poly p2); 469 365 470 /*-----------Misc stuff-----------------------------------*/471 // reverses the monomials of p472 PINLINE0 poly pReverse(poly p);473 366 474 367 … … 479 372 ***************************************************************/ 480 373 #ifdef PDEBUG 481 // Returns TRUE if m is monom of p, FALSE otherwise482 BOOLEAN pIsMonomOf(poly p, poly m);483 // Returns TRUE if p and q have common monoms484 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 false488 489 // check if poly p is from ring r490 BOOLEAN p_CheckIsFromRing(poly p, ring r);491 // check if p != NULL, r != NULL and initialized && p is from r492 BOOLEAN p_CheckPolyRing(poly p, ring r);493 // check if r != NULL and initialized494 BOOLEAN p_CheckRing(ring r);495 // only do check if cond496 #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 502 374 #define pTest(p) _p_Test(p, currRing, PDEBUG) 503 #define p_Test(p,r) _p_Test(p, r, PDEBUG)504 375 #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)507 376 508 377 #else // ! PDEBUG 509 378 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 518 379 #define pTest(p) ((void)0) 519 #define p_Test(p,r) ((void)0)520 380 #define pLmTest(p) ((void)0) 521 #define p_LmTest(p,r) ((void)0)522 #define pp_Test(p, lmRing, tailRing) ((void)0)523 524 381 #endif 525 382 526 383 #endif // POLYS_H 527 384 528 #include "pInline2.h"529 #include "pInline1.h" -
Singular/polys1.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys1.cc,v 1.4 5 2000-09-12 16:01:12obachman Exp $ */4 /* $Id: polys1.cc,v 1.46 2000-09-18 09:19:30 obachman Exp $ */ 5 5 6 6 /* … … 15 15 #include "tok.h" 16 16 #include "numbers.h" 17 #include <omalloc.h>17 #include "omalloc.h" 18 18 #include "febase.h" 19 19 #include "weight.h" … … 302 302 pMonMult(b,tail); 303 303 } 304 pDelete 1(&tail);304 pDeleteLm(&tail); 305 305 pNext(res) = b; 306 306 pNext(b) = NULL; … … 313 313 // if(nIsZero(pGetCoeff(pNext(tail)))) 314 314 // { 315 // pDelete 1(&pNext(tail));315 // pDeleteLm(&pNext(tail)); 316 316 // } 317 317 // else … … 455 455 if (pGetExp(a,k)!=0) 456 456 { 457 f = p Init(a);457 f = pLmInit(a); 458 458 t = nInit(pGetExp(a,k)); 459 459 pSetCoeff0(f,nMult(t,pGetCoeff(a))); 460 460 nDelete(&t); 461 461 if (nIsZero(pGetCoeff(f))) 462 pDelete 1(&f);462 pDeleteLm(&f); 463 463 else 464 464 { … … 493 493 { 494 494 nDelete(&n); 495 pDelete 1(&p);495 pDeleteLm(&p); 496 496 return NULL; 497 497 } … … 653 653 pSetCoeff0(rc,nInit(i)); 654 654 if (nIsZero(pGetCoeff(rc))) 655 pDelete 1(&rc);655 pDeleteLm(&rc); 656 656 } 657 657 return rc; … … 1016 1016 if (nIsZero(pGetCoeff(qq))) 1017 1017 { 1018 pDelete 1(&qq);1018 pDeleteLm(&qq); 1019 1019 } 1020 1020 else … … 1042 1042 { 1043 1043 /* this variable maps to 0 !*/ 1044 pDelete 1(&qq);1044 pDeleteLm(&qq); 1045 1045 break; 1046 1046 } … … 1333 1333 while ((p1 != NULL) && (p2 != NULL)) 1334 1334 { 1335 /* p1 and p2 are non-NULL, so we may use pLmCmp instead of pComp */1336 1335 if (! pLmEqual(p1, p2)) 1337 return FALSE; 1336 return FALSE; 1337 if (! nEqual(pGetCoeff(p1), pGetCoeff(p2))) 1338 return FALSE; 1338 1339 pIter(p1); 1339 1340 pIter(p2); … … 1350 1351 number n,nn; 1351 1352 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 1354 1356 return FALSE; 1355 1357 if ((pNext(p1)==NULL) && (pNext(p2)!=NULL)) … … 1362 1364 while ((p1 != NULL) /*&& (p2 != NULL)*/) 1363 1365 { 1364 if ( ! p Equal(p1, p2))1366 if ( ! pLmEqual(p1, p2)) 1365 1367 { 1366 1368 nDelete(&n); -
Singular/pp_Mult_mm__Template.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pp_Mult_mm__Template.cc,v 1. 2 2000-09-12 16:01:12obachman Exp $9 * Version: $Id: pp_Mult_mm__Template.cc,v 1.3 2000-09-18 09:19:31 obachman Exp $ 10 10 *******************************************************************/ 11 11 … … 20 20 poly pp_Mult_mm(poly p, const poly m, const poly spNoether, const ring ri) 21 21 { 22 p_Test(p, ri); 23 p_LmTest(p, ri); 22 24 if (p == NULL) return NULL; 23 25 spolyrec rp; … … 27 29 DECLARE_LENGTH(const unsigned long length = ri->ExpLSize); 28 30 const unsigned long* m_e = m->exp; 29 assume(!p_nIsZero(ln,r));31 pAssume(!n_IsZero(ln,r)); 30 32 31 33 if (spNoether == NULL) … … 33 35 do 34 36 { 35 omTypeAllocBin(poly, pNext(q), bin);37 p_AllocBin( pNext(q), bin, ri); 36 38 q = pNext(q); 37 pSetCoeff0(q, p_nMult(ln, pGetCoeff(p), ri));39 pSetCoeff0(q, n_Mult(ln, pGetCoeff(p), ri)); 38 40 p_MemSum(q->exp, p->exp, m_e, length); 39 41 p = pNext(p); … … 46 48 while (p != NULL) 47 49 { 48 omTypeAllocBin(poly, r, bin);50 p_AllocBin( r, bin, ri); 49 51 p_MemSum(r->exp, p->exp, m_e, length); 50 52 51 53 if (p_LmCmp(r, spNoether, ri) == -1) 52 54 { 53 omFreeBinAddr(r);55 p_FreeBinAddr(r, ri); 54 56 break; 55 57 } 56 58 q = pNext(q) = r; 57 pSetCoeff0(q, p_nMult(ln, pGetCoeff(p), ri));59 pSetCoeff0(q, n_Mult(ln, pGetCoeff(p), ri)); 58 60 pIter(p); 59 61 } 60 62 } 61 63 pNext(q) = NULL; 62 64 65 p_Test(pNext(&rp), ri); 63 66 return pNext(&rp); 64 67 } -
Singular/pp_Mult_nn__Template.cc
rf3398d r512a2b 7 7 * Author: obachman (Olaf Bachmann) 8 8 * Created: 8/00 9 * Version: $Id: pp_Mult_nn__Template.cc,v 1. 2 2000-09-12 16:01:13obachman Exp $9 * Version: $Id: pp_Mult_nn__Template.cc,v 1.3 2000-09-18 09:19:31 obachman Exp $ 10 10 *******************************************************************/ 11 11 … … 18 18 poly pp_Mult_nn(poly p, const number n, const ring r) 19 19 { 20 assume(!p_nIsZero(n,r));21 p Test(p);20 pAssume(!n_IsZero(n,r)); 21 p_Test(p, r); 22 22 if (p == NULL) return NULL; 23 23 spolyrec rp; … … 28 28 do 29 29 { 30 omTypeAllocBin(poly, pNext(q), bin);30 p_AllocBin(pNext(q), bin, r); 31 31 q = pNext(q); 32 32 number nc = pGetCoeff(p); 33 pSetCoeff0(q, p_nMult(n, nc, r));33 pSetCoeff0(q, n_Mult(n, nc, r)); 34 34 p_MemCopy(q->exp, p->exp, length); 35 35 pIter(p); … … 38 38 pNext(q) = NULL; 39 39 40 p Test(rp.next);40 p_Test(rp.next, r); 41 41 return rp.next; 42 42 } -
Singular/prCopy.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: prCopy.cc,v 1. 6 2000-09-14 13:04:40obachman Exp $ */4 /* $Id: prCopy.cc,v 1.7 2000-09-18 09:19:31 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - implementation of functions for Copy/Move/Delete for Polys … … 8 8 9 9 #include "mod2.h" 10 #include <omalloc.h>10 #include "omalloc.h" 11 11 #include "polys.h" 12 12 #include "numbers.h" -
Singular/ring.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.11 6 2000-09-13 13:43:44 SingularExp $ */4 /* $Id: ring.cc,v 1.117 2000-09-18 09:19:31 obachman Exp $ */ 5 5 6 6 /* … … 12 12 #include "mod2.h" 13 13 #include "structs.h" 14 #include <omalloc.h>14 #include "omalloc.h" 15 15 #include "tok.h" 16 16 #include "ipid.h" -
Singular/scanner.l
rf3398d r512a2b 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 /* $Id: scanner.l,v 1.2 8 2000-09-04 13:39:06obachman Exp $ */5 /* $Id: scanner.l,v 1.29 2000-09-18 09:19:32 obachman Exp $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 10 10 11 11 #include "mod2.h" 12 #include <omalloc.h>12 #include "omalloc.h" 13 13 #include "tok.h" 14 14 #include "stype.h" … … 310 310 #endif 311 311 #ifdef OM_TRACK 312 omPrintUsedTrackAddrs(stdout );312 omPrintUsedTrackAddrs(stdout, 1); 313 313 #endif 314 314 m2_end(0); -
Singular/sdb.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: sdb.cc,v 1.1 4 2000-08-14 12:56:49obachman Exp $ */4 /* $Id: sdb.cc,v 1.15 2000-09-18 09:19:33 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: Singular debugger … … 11 11 #include "mod2.h" 12 12 #include "tok.h" 13 #include <omalloc.h>13 #include "omalloc.h" 14 14 #include "febase.h" 15 15 #include "ipshell.h" -
Singular/silink.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: silink.cc,v 1.3 5 2000-08-14 12:56:49obachman Exp $ */4 /* $Id: silink.cc,v 1.36 2000-09-18 09:19:33 obachman Exp $ */ 5 5 6 6 /* … … 12 12 #include "mod2.h" 13 13 #include "tok.h" 14 #include <omalloc.h>14 #include "omalloc.h" 15 15 #include "febase.h" 16 16 #include "subexpr.h" -
Singular/sing_dbm.cc
rf3398d r512a2b 5 5 //**************************************************************************/ 6 6 // 7 // $Id: sing_dbm.cc,v 1.1 3 2000-08-14 12:56:50obachman Exp $7 // $Id: sing_dbm.cc,v 1.14 2000-09-18 09:19:33 obachman Exp $ 8 8 // 9 9 //**************************************************************************/ … … 23 23 # include "tok.h" 24 24 # include "febase.h" 25 # include <omalloc.h>25 # include "omalloc.h" 26 26 # include "ipid.h" 27 27 # include "silink.h" -
Singular/sing_mp.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: sing_mp.cc,v 1.3 2 2000-08-14 12:56:50obachman Exp $ */4 /* $Id: sing_mp.cc,v 1.33 2000-09-18 09:19:33 obachman Exp $ */ 5 5 6 6 /* … … 17 17 #include "mpsr.h" 18 18 #include "tok.h" 19 #include <omalloc.h>19 #include "omalloc.h" 20 20 #include "febase.h" 21 21 #include "subexpr.h" -
Singular/sparsmat.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: sparsmat.cc,v 1.3 5 2000-09-14 14:20:45obachman Exp $ */4 /* $Id: sparsmat.cc,v 1.36 2000-09-18 09:19:34 obachman Exp $ */ 5 5 6 6 /* … … 1766 1766 a = pNext(a) = pAdd(pNext(a), pNext(dummy)); 1767 1767 } while (a!=NULL); 1768 p Free(dummy);1768 pLmFree(dummy); 1769 1769 } 1770 1770 … … 1837 1837 if (b == NULL) 1838 1838 { 1839 p Free(e);1839 pLmFree(e); 1840 1840 return res; 1841 1841 } … … 1860 1860 pIter(b); 1861 1861 } while (b != NULL); 1862 p Free(e);1862 pLmFree(e); 1863 1863 return res; 1864 1864 } … … 1904 1904 a = pNext(a) = pAdd(pNext(a), h); 1905 1905 } while (a!=NULL); 1906 p Free(e);1906 pLmFree(e); 1907 1907 } 1908 1908 … … 2092 2092 { 2093 2093 x = nAdd(pGetCoeff(pb), pGetCoeff(r)); 2094 pDelete 1(&r);2094 pDeleteLm(&r); 2095 2095 if (nIsZero(x)) 2096 2096 { 2097 pDelete 1(&pb);2097 pDeleteLm(&pb); 2098 2098 pNext(pa) = pAdd(pb,r); 2099 2099 } … … 2140 2140 { 2141 2141 x = nAdd(pGetCoeff(pa), pGetCoeff(r)); 2142 pDelete 1(&r);2142 pDeleteLm(&r); 2143 2143 if (nIsZero(x)) 2144 2144 { 2145 pDelete 1(&pa);2145 pDeleteLm(&pa); 2146 2146 if (pp!=NULL) 2147 2147 pNext(pp) = pAdd(pa,r); -
Singular/spectrum.cc
rf3398d r512a2b 116 116 if( pLmCmp( f,m )>=0 ) 117 117 { 118 if( p DivisibleBy2( f,m ) )118 if( pLmDivisibleByNoComp( f,m ) ) 119 119 { 120 120 return TRUE; … … 214 214 else 215 215 { 216 pDelete 1(ptr);216 pDeleteLm(ptr); 217 217 } 218 218 } -
Singular/splist.cc
rf3398d r512a2b 271 271 while( *node!=(spectrumPolyNode*)NULL ) 272 272 { 273 if( pCmp( m,(*node)->mon )>=0 && p DivisibleBy2( m,(*node)->mon ) )273 if( pCmp( m,(*node)->mon )>=0 && pLmDivisibleByNoComp( m,(*node)->mon ) ) 274 274 { 275 275 delete_node( node ); … … 281 281 while( *f!=(poly)NULL ) 282 282 { 283 if( pCmp( m,*f )>=0 && p DivisibleBy2( m,*f ) )283 if( pCmp( m,*f )>=0 && pLmDivisibleByNoComp( m,*f ) ) 284 284 { 285 pDelete 1(f);285 pDeleteLm(f); 286 286 } 287 287 else -
Singular/subexpr.cc
rf3398d r512a2b 5 5 * ABSTRACT: handling of leftv 6 6 */ 7 /* $Id: subexpr.cc,v 1.6 4 2000-09-15 16:44:31 SingularExp $ */7 /* $Id: subexpr.cc,v 1.65 2000-09-18 09:19:35 obachman Exp $ */ 8 8 9 9 #include <stdlib.h> … … 1157 1157 // string[..].Data() modifies sleftv, so let's do it ourself 1158 1158 { 1159 char *dd= l->m[index-1].data;1159 char *dd=(char*)l->m[index-1].data; 1160 1160 int j=e->next->start-1; 1161 1161 r=(char *)omAllocBin(size_two_bin); … … 1410 1410 v->data = pGetCoeff(p); 1411 1411 pGetCoeff(p)=NULL; 1412 p Free(p);1412 pLmFree(p); 1413 1413 v->rtyp = NUMBER_CMD; 1414 1414 v->name = id; … … 1443 1443 v->data = pGetCoeff(p); 1444 1444 pGetCoeff(p)=NULL; 1445 p Free(p);1445 pLmFree(p); 1446 1446 v->rtyp = NUMBER_CMD; 1447 1447 v->name = id; -
Singular/syz.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz.cc,v 1.3 7 2000-08-14 12:56:53obachman Exp $ */4 /* $Id: syz.cc,v 1.38 2000-09-18 09:19:35 obachman Exp $ */ 5 5 6 6 /* … … 11 11 #include "mod2.h" 12 12 #include "tok.h" 13 #include <omalloc.h>13 #include "omalloc.h" 14 14 #include "polys.h" 15 15 #include "febase.h" -
Singular/syz0.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz0.cc,v 1.3 1 2000-09-12 16:01:20obachman Exp $ */4 /* $Id: syz0.cc,v 1.32 2000-09-18 09:19:36 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: resolutions … … 10 10 #include "mod2.h" 11 11 #include "tok.h" 12 #include <omalloc.h>12 #include "omalloc.h" 13 13 #include "polys.h" 14 14 #include "febase.h" … … 144 144 while (j < nxt) 145 145 { 146 if (p DivisibleBy2(redWith[j], hn))146 if (pLmDivisibleByNoComp(redWith[j], hn)) 147 147 { 148 148 //if (TEST_OPT_PROT) Print("r"); -
Singular/syz1.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz1.cc,v 1.6 2 2000-09-12 16:01:21obachman Exp $ */4 /* $Id: syz1.cc,v 1.63 2000-09-18 09:19:36 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: resolutions … … 11 11 #include "tok.h" 12 12 #include "attrib.h" 13 #include <omalloc.h>13 #include "omalloc.h" 14 14 #include "polys.h" 15 15 #include "febase.h" … … 337 337 while (j < pos) 338 338 { 339 if (p DivisibleBy2(redWith->m[j], hn))339 if (pLmDivisibleByNoComp(redWith->m[j], hn)) 340 340 { 341 341 //hn = sySPolyRed(hn,redWith->m[j]); … … 725 725 { 726 726 isDivisible = isDivisible || 727 p DivisibleBy2(o_r->m[l],tso.lcm);727 pLmDivisibleByNoComp(o_r->m[l],tso.lcm); 728 728 } 729 729 l++; … … 777 777 { 778 778 isDivisible = isDivisible || 779 p DivisibleBy2(o_r->m[l],tso.lcm);779 pLmDivisibleByNoComp(o_r->m[l],tso.lcm); 780 780 } 781 781 l++; … … 922 922 { 923 923 if (j<0) break; 924 if (p DivisibleBy2(redset[j],q))924 if (pLmDivisibleByNoComp(redset[j],q)) 925 925 { 926 926 pNext(p) = pHead(q); … … 1034 1034 ((sPairs)[i].syz!=NULL)) 1035 1035 { 1036 if (p DivisibleBy1(res->m[j],(sPairs)[i].syz))1036 if (pLmDivisibleBy(res->m[j],(sPairs)[i].syz)) 1037 1037 { 1038 1038 (sPairs)[i].syz = … … 1209 1209 if (nPm[j1]!=NULL) 1210 1210 { 1211 if (p DivisibleBy2(nPm[j1],p))1211 if (pLmDivisibleByNoComp(nPm[j1],p)) 1212 1212 { 1213 1213 pDelete(&p); 1214 1214 break; 1215 1215 } 1216 else if (p DivisibleBy2(p,nPm[j1]))1216 else if (pLmDivisibleByNoComp(p,nPm[j1])) 1217 1217 { 1218 1218 pDelete(&(nPm[j1])); … … 2277 2277 2278 2278 while ((pp!=NULL) && ((*toStrip)[pGetComp(pp)]!=0)) 2279 pDelete 1(&pp);2279 pDeleteLm(&pp); 2280 2280 p = pp; 2281 2281 if (pp!=NULL) … … 2284 2284 { 2285 2285 if ((*toStrip)[pGetComp(pNext(pp))]!=0) 2286 pDelete 1(&pNext(pp));2286 pDeleteLm(&pNext(pp)); 2287 2287 else 2288 2288 pIter(pp); … … 2759 2759 if (origR != syzstr->syRing) 2760 2760 rChangeCurrRing(origR,TRUE); 2761 pDelete 1(&redpol);2761 pDeleteLm(&redpol); 2762 2762 if (TEST_OPT_PROT) PrintLn(); 2763 2763 return syzstr; -
Singular/syz2.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz2.cc,v 1.1 7 2000-09-12 16:01:22obachman Exp $ */4 /* $Id: syz2.cc,v 1.18 2000-09-18 09:19:37 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: resolutions … … 10 10 #include "mod2.h" 11 11 #include "tok.h" 12 #include <omalloc.h>12 #include "omalloc.h" 13 13 #include "syz.h" 14 14 #include "polys.h" … … 132 132 if (nP->m[j]!=NULL) 133 133 { 134 if (p DivisibleBy2(nP->m[j],p))134 if (pLmDivisibleByNoComp(nP->m[j],p)) 135 135 { 136 136 pDelete(&p); … … 138 138 break; 139 139 } 140 else if (p DivisibleBy2(p,nP->m[j]))140 else if (pLmDivisibleByNoComp(p,nP->m[j])) 141 141 { 142 142 pDelete(&(nP->m[j])); … … 360 360 { 361 361 isDivisible = isDivisible || 362 p DivisibleBy1(o_r->m[l],tso.lcm);362 pLmDivisibleBy(o_r->m[l],tso.lcm); 363 363 } 364 364 l++; … … 423 423 loop 424 424 { 425 if (p DivisibleBy1(redWith->m[i],q))425 if (pLmDivisibleBy(redWith->m[i],q)) 426 426 { 427 427 number up = kBucketPolyRed(syzstr->bucket,redWith->m[i], … … 615 615 while (j<kres) 616 616 { 617 if ((redset[j].p!=NULL) && (p DivisibleBy1(redset[j].p,q))617 if ((redset[j].p!=NULL) && (pLmDivisibleBy(redset[j].p,q)) 618 618 && ((redset[j].ind1!=tso.ind1) || (redset[j].ind2!=tso.ind2))) 619 619 { -
Singular/syz3.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz3.cc,v 1. 4 2000-09-12 16:01:23obachman Exp $ */4 /* $Id: syz3.cc,v 1.5 2000-09-18 09:19:37 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: resolutions … … 11 11 #include "tok.h" 12 12 #include "attrib.h" 13 #include <omalloc.h>13 #include "omalloc.h" 14 14 #include "polys.h" 15 15 #include "febase.h" … … 379 379 if (prs[j1]!=NULL) 380 380 { 381 if (p DivisibleBy2(prs[j1],p))381 if (pLmDivisibleByNoComp(prs[j1],p)) 382 382 { 383 383 pDelete(&p); 384 384 break; 385 385 } 386 else if (p DivisibleBy2(p,prs[j1]))386 else if (pLmDivisibleByNoComp(p,prs[j1])) 387 387 { 388 388 pDelete(&(prs[j1])); … … 701 701 pp = pMult_mm(pCopy(old_repr->m[tso.ind2]),p); 702 702 kBucketInit(syzstr->syz_bucket,pp,-1); 703 pDelete 1(&p);703 pDeleteLm(&p); 704 704 p = pNeg(p); 705 705 pp = pCopy(old_repr->m[tso.ind2]); … … 708 708 { 709 709 kBucket_Minus_m_Mult_p(syzstr->syz_bucket,p,pp,&il,NULL); 710 pDelete 1(&p);710 pDeleteLm(&p); 711 711 } 712 712 pDelete(&pp); … … 718 718 { 719 719 kBucket_Minus_m_Mult_p(syzstr->syz_bucket,p,pp,&il,NULL); 720 pDelete 1(&p);720 pDeleteLm(&p); 721 721 } 722 722 pDelete(&pp); … … 1079 1079 if (prs[j1]!=NULL) 1080 1080 { 1081 if (p DivisibleBy2(prs[j1],p))1081 if (pLmDivisibleByNoComp(prs[j1],p)) 1082 1082 { 1083 1083 pDelete(&p); 1084 1084 break; 1085 1085 } 1086 else if (p DivisibleBy2(p,prs[j1]))1086 else if (pLmDivisibleByNoComp(p,prs[j1])) 1087 1087 { 1088 1088 pDelete(&(prs[j1])); … … 1986 1986 while ((j<IDELEMS(syzstr->fullres[index])) && 1987 1987 ((syzstr->fullres[index]->m[j]==NULL) || 1988 (!p Equal(syzstr->fullres[index]->m[j],totake[index]->m[i])))) j++;1988 (!pLmEqual(syzstr->fullres[index]->m[j],totake[index]->m[i])))) j++; 1989 1989 if (j<IDELEMS(syzstr->fullres[index])) 1990 1990 { -
Singular/tesths.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: tesths.cc,v 1.8 1 2000-08-14 12:56:56obachman Exp $ */4 /* $Id: tesths.cc,v 1.82 2000-09-18 09:19:38 obachman Exp $ */ 5 5 6 6 /* … … 21 21 #include "febase.h" 22 22 #include "cntrlc.h" 23 #include <omalloc.h>23 #include "omalloc.h" 24 24 #include "silink.h" 25 25 #include "ipid.h" -
Singular/weight.cc
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: weight.cc,v 1.1 3 2000-08-14 12:56:57obachman Exp $ */4 /* $Id: weight.cc,v 1.14 2000-09-18 09:19:38 obachman Exp $ */ 5 5 6 6 /* … … 11 11 #include "mod2.h" 12 12 #include "tok.h" 13 #include <omalloc.h>13 #include "omalloc.h" 14 14 #include "polys.h" 15 15 #include "intvec.h" -
Singular/weight0.c
rf3398d r512a2b 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: weight0.c,v 1. 6 2000-08-14 12:56:57obachman Exp $ */4 /* $Id: weight0.c,v 1.7 2000-09-18 09:19:39 obachman Exp $ */ 5 5 6 6 /* … … 11 11 #include <string.h> 12 12 #include "mod2.h" 13 #include <omalloc.h>13 #include "omalloc.h" 14 14 #include "tok.h" 15 15
Note: See TracChangeset
for help on using the changeset viewer.