Changeset 9d72fe in git


Ignore:
Timestamp:
Aug 24, 2000, 4:42:47 PM (24 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c7af8613769b29c741d6c338945669719f1fc4f8')
Children:
d04e5c6da27fdd8c08fbad5b2d62afe127e20d5c
Parents:
30d8a152a104abfe89fae353b5945c3210760945
Message:
* new p_Procs stuff


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

Legend:

Unmodified
Added
Removed
  • Singular/Makefile.in

    r30d8a1 r9d72fe  
    100100    pcv.cc kbuckets.cc prProcs.cc \
    101101    mpr_inout.cc mpr_base.cc mpr_numeric.cc \
    102     prCopy.cc
     102    prCopy.cc p_Procs.cc
    103103
    104104
     
    110110
    111111SOURCES=${CSOURCES} ${CXXSOURCES} ${ESOURCES} mmalloc.cc\
    112         grammar.y scanner.l libparse.l syz2.cc
     112        grammar.y scanner.l libparse.l syz2.cc \
     113        p_Delete__Template.cc p_ShallowCopyDelete__Template.cc \
     114        p_Copy__Template.cc p_Mult_n__Template.cc p_Mult_m__Template.cc \
     115        p_Minus_m_Mult_q__Template.cc p_Add_q__Template.cc
    113116
    114117
     
    130133        mpr_global.h mpr_inout.h mpr_base.h mpr_numeric.h \
    131134        feOpt.h fegetopt.h distrib.h walk.h \
    132         prCopy.h
     135        prCopy.h \
     136        p_MemAdd.h p_MemCopy.h p_MemCmp.h p_Numbers.h
    133137
    134138INCS=febase.inc polys.inc iparith.inc mpsr_Tok.inc feOpt.inc
     
    268272        $(PERL) prCopy.pl > prCopy.inc
    269273
     274p_Procs.inc: p_Procs.cc p_Procs.h mod2.h
     275        $(CXX) -g -Wall -DGENERATE_P_PROCS p_Procs.cc -o p_Procs
     276        ./p_Procs > p_Procs.inc
     277
     278
    270279src: scanner.cc grammar.h grammar.cc libparse.cc
    271280
     
    348357##
    349358mostlyclean:
    350         -rm -f Singular Singular-static Singularg Singularp Singularb libparse feOpt*.inc
    351         -rm -f *.o *.og core *.op *.ob *.ot Singulart
     359        -rm -f Singular Singular-static Singulara Singularg Singularp Singularb libparse feOpt*.inc p_Procs.inc
     360        -rm -f *.o *.og core *.op *.ob *.ot Singulart *.od *_d.cc *_d.c p_Procs *.oa
    352361        -rm ESingular* TSingular*
    353362
     
    498507
    499508##
    500 ## op and ob files for gprof and bprof, ot for mtrack
     509## op and ob files for gprof and bprof, ot for mtrack, oc for OMCHECK=1
    501510##
    502511
     
    585594
    586595
     596#
     597# for Singulara
     598#
     599DEFSA = -DOM_CHECK=1 -DHAVE_ASSUME -DNDEBUG -D@SING_UNAME@ @DEFS@
     600OBJA1 := $(CXXSOURCES:.cc=.oa)
     601OBJA2 := $(CSOURCES:.c=.oa)
     602OBJA=$(OBJA1) $(OBJA2)
     603CFLAGSA         = -g  -O -Wall -Wno-unused ${PIPE}
     604CXXFLAGSA       = -g  -O -Wall -Wno-unused ${PIPE}
     605
     606claptmpl.oa: claptmpl.cc mod2.h
     607        $(CXX)  ${CXXFLAGSA} ${CPPFLAGS} ${DEFSA} -c $< -o $@
     608
     609$(OBJA1) mmalloc.oa: %.oa: %.cc
     610        $(CXX) ${CXXFLAGSA} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFSA} -c $< -o $@
     611
     612$(OBJA2) : %.oa: %.c
     613        $(CCP)  ${CFLAGSA} ${CPPFLAGS} ${DEFSA} -c $< -o $@
     614
     615Singulara: scanner.cc   $(OBJA) iparith.oa mpsr_Tok.oa claptmpl.oa tesths.cc version.h  mmalloc.oa
     616        $(CXXP) ${CXXFLAGSA} ${CPPFLAGS} ${DEFSA} -o Singulara \
     617        tesths.cc iparith.oa mpsr_Tok.oa claptmpl.oa $(OBJA) ${LDFLAGS} ${LIBS} -lomalloc mmalloc.oa \
     618        ${LD_DYN_FLAGS}
     619
     620iparith.oa: iparith.inc iparith.cc
     621        $(CXXP)  ${CXXFLAGSA} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFSA} -c iparith.cc -o iparith.oa
     622
     623mpsr_Tok.oa: iparith.inc mpsr_Tok.cc
     624        $(CXXP) ${CXXFLAGAT} ${CXXTEMPLFLAGSB} ${CPPFLAGS} ${DEFSA} -c mpsr_Tok.cc -o mpsr_Tok.oa
     625
     626#
     627# for Macro expansion
     628#
     629CXXSOURCESD := $(CXXSOURCES:%.cc=%_d.cc)
     630CSOURCESD := $(CSOURCES:%.c=%_d.c)
     631OBJD1 := $(CXXSOURCESD:.cc=.od)
     632OBJD2 := $(CSOURCESD:.c=.od)
     633
     634p_ProcsGen_d.cc: p_Procs.cc p_Procs.h mod2.h
     635        $(CCG) -DGENERATE_P_PROCS ${CPPFLAGS} -E -P p_Procs.cc | $(PERL) -p -e 's/;/;\n/g' | $(PERL) -p -e 's/\{/\n\{/g' | $(PERL) -p -e 's/\}/\n\}/g' > $@
     636p_ProcsGen_d: p_Procs_d.cc
     637        gcc -g -Wall -DGENERATE_P_PROCS p_Procs_d.cc -o p_ProcsGen_d
     638
     639%_d.c : %.c
     640        $(CCG) $(CFLAGSG) ${CPPFLAGS} -E -P $< | $(PERL) -p -e 's/;/;\n/g' | $(PERL) -p -e 's/\{/\n\{/g' | $(PERL) -p -e 's/\}/\n\}/g' > $@
     641
     642%_d.cc : %.cc
     643        $(CCG) $(CXXFLAGS) ${CPPFLAGS} -E -P $< | $(PERL) -p -e 's/;/;\n/g' | $(PERL) -p -e 's/\{/\n\{/g' | $(PERL) -p -e 's/\}/\n\}/g' > $@
     644
     645.PRECIOUS: %_d.cc %_d.c
     646
     647%.od : %.c
     648        $(CCG)  ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
     649
     650%.od : %.cc
     651        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
     652
     653Singular_d: scanner.cc  $(OBJD)  mmalloc.od\
     654           iparith.od mpsr_Tok.od claptmpl.og tesths.cc version.h
     655        $(CXXG) ${CXXFLAGSG} ${CXXTEMPLFLAGSG} ${CPPFLAGS} ${DEFSG} -o Singularg_d \
     656        tesths.cc iparith.od mpsr_Tok.od claptmpl.og $(OBJG) ${LDFLAGS} ${LIBS} -lomalloc mmalloc.od \
     657        ${LD_DYN_FLAGS} ${LD_LIBC}
     658
    587659##
    588660## check_aso
     
    595667
    596668%.dd: %.cc mod2.h
    597         echo $(@:.dd=.og) $(@:.dd=.op) $(@:.dd=.ob) $(@:.dd=.ot)" " \\ > $@
     669        echo $(@:.dd=.og) $(@:.dd=.op) $(@:.dd=_d.cc) $(@:.dd=.od) $(@:.dd=.ob) $(@:.dd=.ot) $(@:.dd=.oa) " " \\ > $@
    598670        $(CXXM) -DGENTABLE ${CPPFLAGS} ${DEFSG} $< >> $@
    599671
    600672%.d: %.c mod2.h
    601         echo $(@:.d=.og) $(@:.d=.op) $(@:.d=.ob) $(@:.d=.ot)" " \\ > $@
     673        echo $(@:.d=.og) $(@:.d=.od) $(@:.dd=_d.c) $(@:.d=.op) $(@:.d=.ob) $(@:.d=.ot) $(@:.dd=.oa)" " \\ > $@
    602674        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
    603675
    604 depend:   $(CXXSOURCES:.cc=.dd) $(CSOURCES:.c=.d) mmalloc.dd mod2.h
     676depend:   $(CXXSOURCES:.cc=.dd) $(CSOURCES:.c=.d) iparith.dd mmalloc.dd mod2.h
    605677        cat *.d *.dd >depend
    606678
     
    610682
    611683
    612 
  • Singular/extra.cc

    r30d8a1 r9d72fe  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: extra.cc,v 1.138 2000-08-14 14:35:50 Singular Exp $ */
     4/* $Id: extra.cc,v 1.139 2000-08-24 14:42:39 obachman Exp $ */
    55/*
    66* ABSTRACT: general interface to internals of Singular ("system" command)
     
    628628    char *sys_cmd=(char *)(h->Data());
    629629    h=h->next;
     630#ifdef RDEBUG
    630631/*==================== poly debug ==================================*/
    631632    if(strcmp(sys_cmd,"p")==0)
     
    642643    }
    643644    else
     645#endif
    644646/*==================== mtrack ==================================*/
    645647    if(strcmp(sys_cmd,"mtrack")==0)
  • Singular/febase.cc

    r30d8a1 r9d72fe  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: febase.cc,v 1.88 2000-08-14 12:56:06 obachman Exp $ */
     4/* $Id: febase.cc,v 1.89 2000-08-24 14:42:40 obachman Exp $ */
    55/*
    66* ABSTRACT: i/o system
     
    407407{
    408408  fprintf(stderr, "Internal assume violation: file %s line %d\n", file, line);
     409  omPrintCurrentBackTrace(stderr);
    409410}
    410411}
  • Singular/iparith.cc

    r30d8a1 r9d72fe  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iparith.cc,v 1.220 2000-08-14 12:56:21 obachman Exp $ */
     4/* $Id: iparith.cc,v 1.221 2000-08-24 14:42:40 obachman Exp $ */
    55
    66/*
     
    2424#include "longalg.h"
    2525#include "polys.h"
     26#include "polys-comp.h"
    2627#include "ideals.h"
    2728#include "matpol.h"
  • Singular/mod2.h.in

    r30d8a1 r9d72fe  
    66 *          DO NOT EDIT!
    77 *
    8  *  Version: $Id: mod2.h.in,v 1.84 2000-08-14 12:56:39 obachman Exp $
     8 *  Version: $Id: mod2.h.in,v 1.85 2000-08-24 14:42:42 obachman Exp $
    99 *******************************************************************/
    1010#ifndef MOD2_H
     
    104104/* Define if you have petpwnam */
    105105#undef HAVE_GETPWNAM
     106/* Define if you have popen */
     107#undef HAVE_POPEN
    106108/* Define sizeof(char) */
    107109#define SIZEOF_CHAR 1
  • Singular/omSingularConfig.h

    r30d8a1 r9d72fe  
    22 *  File:    omSingularConfig.h
    33 *  Purpose: declaration of External Config stuff for omalloc
     4 *           This file is inlcuded by omDefaultConfig.h, i.e., at the the time
     5 *           the omalloc library is built. Any changes to the default config
     6 *           of omalloc should be done here (and, of course, you need to
     7 *           rebuilt the library).
    48 *  Author:  obachman@mathematik.uni-kl.de (Olaf Bachmann)
    59 *  Created: 8/00
    6  *  Version: $Id: omSingularConfig.h,v 1.1 2000-08-14 12:57:49 obachman Exp $
     10 *  Version: $Id: omSingularConfig.h,v 1.2 2000-08-24 14:42:42 obachman Exp $
    711 *******************************************************************/
    812#ifndef OM_SINGULAR_CONFIG_H
  • Singular/polys-comp.h

    r30d8a1 r9d72fe  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys-comp.h,v 1.23 2000-08-18 15:42:06 Singular Exp $ */
     6/* $Id: polys-comp.h,v 1.24 2000-08-24 14:42:44 obachman Exp $ */
    77
    88/***************************************************************
     
    100100
    101101// need to undefine this, since longs might be negative
    102 #define u_s
     102#define u_s unsigned
    103103
    104104#define _memcmp(p1, p2, i, l, actionE, actionD) \
     
    137137#endif
    138138
    139 #if defined(PDEBUG) && defined(HAVE_SHIFTED_EXPONENTS)
    140 extern int pDBsyzComp;
    141 int rComp0(poly p1, poly p2);
     139#ifdef PDEBUG
     140extern int rComp0(poly p1, poly p2);
    142141#else
    143142inline int rComp0(poly p1, poly p2)
  • Singular/polys-impl.cc

    r30d8a1 r9d72fe  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys-impl.cc,v 1.46 2000-08-24 14:28:55 Singular Exp $ */
     4/* $Id: polys-impl.cc,v 1.47 2000-08-24 14:42:44 obachman Exp $ */
    55
    66/***************************************************************
     
    915915
    916916#ifdef HAVE_SHIFTED_EXPONENTS
    917 #ifdef PDEBUG
    918 int rComp0(poly p1,poly p2)
     917int rComp0_Func(poly p1,poly p2)
    919918{
    920919  int i;
     
    931930  return 0;
    932931}
     932
     933#ifdef PDEBUG
     934int rComp0(poly p1,poly p2)
     935{
     936  int i;
     937  for(i=0; i<=currRing->pCompHighIndex;i++)
     938  {
     939    if (p1->exp.l[i] != p2->exp.l[i])
     940    {
     941      if (p1->exp.l[i] > p2->exp.l[i])
     942        return currRing->ordsgn[i];
     943      else
     944        return -currRing->ordsgn[i];
     945    }
     946  }
     947  return 0;
     948}
    933949#endif
    934950#endif
  • Singular/polys.h

    r30d8a1 r9d72fe  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys.h,v 1.32 2000-08-14 12:56:46 obachman Exp $ */
     6/* $Id: polys.h,v 1.33 2000-08-24 14:42:45 obachman Exp $ */
    77/*
    88* ABSTRACT - all basic methods to manipulate polynomials
     
    124124// frees the space of monomial and frees coefficient
    125125#define pDelete1(m)     _pDelete1(m, currPolyBin)
    126 // deletes the whole polynomial p
    127 #define pDelete(p)      _pDelete(p, currPolyBin)
     126
    128127
    129128// similar to routines above, except that monomials are assumed to be from heap h (resp. are allocated from heap h)
     
    154153
    155154extern  poly pHeadProc(poly p);
    156 // Returns copy of the whole polynomial
    157 #define pCopy(p)        _pCopy(currPolyBin, p)
    158155// Returns copy of the whole poly, new monomials are taken from dest_heap
    159156#define pHeapCopy(dest_heap, p) _pCopy(dest_heap, p)
     
    180177
    181178/*-------------operations on polynomials:------------*/
    182 poly      pAdd(poly p1, poly p2);
    183179poly      pNeg(poly p);
    184180poly      pSub(poly a, poly b);
     
    187183poly      pMultCopyN(poly a, number c);
    188184poly      pPower(poly p, int i);
     185
     186
     187// ----------------- define to enable new p_procs -----*/
     188// #define HAVE_P_PROCS
     189#ifdef HAVE_P_PROCS
     190#include "p_Procs.h"
     191#define pDelete p_Delete
     192#define pCopy   p_Copy
     193#define pAdd    p_Add_q
     194#else
     195// deletes the whole polynomial p
     196#define pDelete(p)      _pDelete(p, currPolyBin)
     197// Returns copy of the whole polynomial
     198#define pCopy(p)        _pCopy(currPolyBin, p)
     199poly      pAdd(poly p1, poly p2);
     200#endif
    189201
    190202// return TRUE, if exponent and component of Lm(p1) and Lm(p2) are equal,
  • Singular/polys1.cc

    r30d8a1 r9d72fe  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys1.cc,v 1.42 2000-08-24 11:21:45 Singular Exp $ */
     4/* $Id: polys1.cc,v 1.43 2000-08-24 14:42:45 obachman Exp $ */
    55
    66/*
     
    136136}
    137137
     138#ifndef HAVE_P_PROCS
    138139/*-------------operations on polynomials:------------*/
    139140/*2
     
    206207  return p;
    207208}
     209#endif
     210
    208211
    209212/*2
  • Singular/prProcs.cc

    r30d8a1 r9d72fe  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: prProcs.cc,v 1.3 2000-08-14 12:56:47 obachman Exp $ */
     4/* $Id: prProcs.cc,v 1.4 2000-08-24 14:42:45 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Routines for primitive poly arithmetic
     
    4343}                                               \
    4444while(0)
    45 /***************************************************************
    46  *
    47  * General:  pr_Mult_n which always works
    48  * Returns:  p*n
    49  * Destroys: p
    50  * Const:    n
    51  *
    52  ***************************************************************/
    5345
    5446poly pr_Mult_n_General(poly p, number n)
  • Singular/ring.cc

    r30d8a1 r9d72fe  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.106 2000-08-24 11:21:46 Singular Exp $ */
     4/* $Id: ring.cc,v 1.107 2000-08-24 14:42:46 obachman Exp $ */
    55
    66/*
     
    2828#include "ring.h"
    2929#include "prCopy.h"
     30#include "p_Procs.h"
    3031
    3132#define BITS_PER_LONG 8*SIZEOF_LONG
     
    186187
    187188  if (ppNoether!=NULL) pDelete(&ppNoether);
    188   if ((sLastPrinted.rtyp>BEGIN_RING) && (sLastPrinted.rtyp<END_RING))
     189  if (((sLastPrinted.rtyp>BEGIN_RING) && (sLastPrinted.rtyp<END_RING)) ||
     190      ((sLastPrinted.rtyp==LIST_CMD)&&(lRingDependend((lists)sLastPrinted.data))))
     191
    189192  {
    190193    sLastPrinted.CleanUp();
     
    874877      }
    875878      if (ppNoether!=NULL) pDelete(&ppNoether);
    876       if ((sLastPrinted.rtyp>BEGIN_RING) && (sLastPrinted.rtyp<END_RING))
     879      if (((sLastPrinted.rtyp>BEGIN_RING) && (sLastPrinted.rtyp<END_RING)) ||
     880          ((sLastPrinted.rtyp==LIST_CMD)&&(lRingDependend((lists)sLastPrinted.data))))
    877881      {
    878882        sLastPrinted.CleanUp();
     
    25552559  // r->pCompHighIndex already set
    25562560  r->pCompLSize = r->pCompHighIndex + 1;
    2557   r->ordsgn=(long *)omAlloc0(r->pCompLSize*sizeof(long));
     2561  r->ordsgn=(long *)omAlloc0(r->ExpLSize*sizeof(long));
    25582562
    25592563  for(j=0;j<=r->pCompHighIndex;j++)
     
    25782582  // ----------------------------
    25792583  // indices for (first copy of ) variable entries in exp.e vector (VarOffset):
    2580   // BIGENDIAN:
    25812584  r->VarOffset=v;
    25822585
     
    25982601  if (i==r->pCompIndex) i++;
    25992602  r->pOrdIndex=i;
     2603
     2604  // ----------------------------
     2605  // p_Procs
     2606  r->p_Procs = omAlloc(sizeof(p_Procs_s));
     2607  p_SetProcs(r, r->p_Procs);
    26002608  return FALSE;
    26012609}
     
    29852993#endif
    29862994  r->pCompLSize = r->pCompHighIndex - r->pCompLowIndex + 1;
    2987   r->ordsgn=(long *)omAlloc0(r->pCompLSize*sizeof(long));
     2995  r->ordsgn=(long *)omAlloc0(r->ExpLSize*sizeof(long));
    29882996
    29892997#ifndef WORDS_BIGENDIAN
     
    31163124    }
    31173125    if (r->ordsgn != NULL && r->pCompLSize != 0)
    3118       omFreeSize((ADDRESS)r->ordsgn,r->pCompLSize*sizeof(long));
    3119   }
    3120 }
    3121 
     3126      omFreeSize((ADDRESS)r->ordsgn,r->pExpLSize*sizeof(long));
     3127    if (r->p_Procs != NULL)
     3128      omFreeSize(r->p_Procs, sizeof(p_Procs_s));
     3129  }
     3130}
     3131
     3132#ifdef RDEBUG
    31223133void rDebugPrint(ring r)
    31233134{
     
    32253236      PrintLn();
    32263237  }
    3227 }
     3238
     3239  // p_Procs stuff
     3240  p_Procs_s proc_names;
     3241  char* field;
     3242  char* length;
     3243  char* ord;
     3244  p_Debug_GetProcNames(r, &proc_names);
     3245  p_Debug_GetSpecNames(r, field, length, ord);
     3246
     3247  Print("p_Spec  : %s, %s, %s\n", field, length, ord);
     3248  PrintS("p_Procs :\n");
     3249  for (i=0; i<sizeof(p_Procs_s)/sizeof(void*); i++)
     3250  {
     3251    Print(" %s,\n", ((char**) &proc_names)[i]);
     3252  }
     3253}
     3254
    32283255void pDebugPrint(poly p)
    32293256{
     
    32503277  }
    32513278}
     3279#endif // RDEBUG
    32523280
    32533281
  • Singular/structs.h

    r30d8a1 r9d72fe  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: structs.h,v 1.34 2000-08-24 11:21:47 Singular Exp $ */
     6/* $Id: structs.h,v 1.35 2000-08-24 14:42:46 obachman Exp $ */
    77/*
    88* ABSTRACT
     
    105105typedef struct reca *      alg;
    106106
    107 
    108107#ifdef __cplusplus
    109108typedef idrec *            idhdl;
     
    120119typedef namerec *          namehdl;
    121120typedef kBucket*           kBucket_pt;
     121typedef struct p_Procs_s p_Procs_s;
    122122
    123123// for hdegree.cc   
     
    305305  short      OrdSize; /* size of ord vector (in sro_ord) */
    306306
     307  p_Procs_s* p_Procs;
    307308  short      ref; /* reference counter to the ring */
    308309};
  • Singular/subexpr.cc

    r30d8a1 r9d72fe  
    55* ABSTRACT: handling of leftv
    66*/
    7 /* $Id: subexpr.cc,v 1.58 2000-08-14 12:56:52 obachman Exp $ */
     7/* $Id: subexpr.cc,v 1.59 2000-08-24 14:42:47 obachman Exp $ */
    88
    99#include <stdlib.h>
     
    15231523          omCheckAddr(d->arg1.name);
    15241524          nok=nok||iiAssign(&d->arg1,&d->arg2);
    1525           omDebugIf(d->arg1.name != NULL,  // OB: ????
    1526                    omCheckAddr(d->arg1.name));
     1525          omCheckIf(d->arg1.name != NULL,  // OB: ????
     1526                    omCheckAddr(d->arg1.name));
    15271527          if (!nok)
    15281528          {
Note: See TracChangeset for help on using the changeset viewer.