Changeset 949e57 in git


Ignore:
Timestamp:
Nov 22, 2010, 4:41:43 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
5bc2461738edac589c7bb7fe19322b1ed8897029
Parents:
5c39a93f6a52a5a83fcc9028a16d640959005ca5
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2010-11-22 16:41:43+01:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:55:41+01:00
Message:
pSetDegProcs
Location:
polys
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • polys/monomials/p_polys.cc

    r5c39a9 r949e57  
    29142914  }
    29152915}
     2916//
     2917// resets the pFDeg and pLDeg: if pLDeg is not given, it is
     2918// set to currRing->pLDegOrig, i.e. to the respective LDegProc which
     2919// only uses pFDeg (and not pDeg, or pTotalDegree, etc)
     2920void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
     2921{
     2922  assume(new_FDeg != NULL);
     2923  r->pFDeg = new_FDeg;
     2924
     2925  if (new_lDeg == NULL)
     2926    new_lDeg = r->pLDegOrig;
     2927
     2928  r->pLDeg = new_lDeg;
     2929}
     2930
     2931// restores pFDeg and pLDeg:
     2932void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
     2933{
     2934  assume(old_FDeg != NULL && old_lDeg != NULL);
     2935  r->pFDeg = old_FDeg;
     2936  r->pLDeg = old_lDeg;
     2937}
     2938
    29162939
    29172940/***************************************************************
  • polys/monomials/p_polys.h

    r5c39a9 r949e57  
    18051805void p_SetGlobals(const ring r, BOOLEAN complete = TRUE);
    18061806
     1807// resets the pFDeg and pLDeg: if pLDeg is not given, it is
     1808// set to currRing->pLDegOrig, i.e. to the respective LDegProc which
     1809// only uses pFDeg (and not pDeg, or pTotalDegree, etc).
     1810// If you use this, make sure your procs does not make any assumptions
     1811// on ordering and/or OrdIndex -- otherwise they might return wrong results
     1812// on strat->tailRing
     1813void pSetDegProcs(ring r. pFDegProc new_FDeg, pLDegProc new_lDeg = NULL);
     1814// restores pFDeg and pLDeg:
     1815void pRestoreDegProcs(ring r. pFDegProc old_FDeg, pLDegProc old_lDeg);
     1816
     1817
    18071818#endif // P_POLYS_H
    18081819
  • polys/polys.cc

    r5c39a9 r949e57  
    2525#endif
    2626
    27 /* ----------- global variables, set by pSetGlobals --------------------- */
    28 /* computes length and maximal degree of a POLYnomial */
    29 pLDegProc pLDeg;
    30 /* computes the degree of the initial term, used for std */
    31 pFDegProc pFDeg;
    32 /* the monomial ordering of the head monomials a and b */
    33 /* returns -1 if a comes before b, 0 if a=b, 1 otherwise */
    34 
    3527/* 1 for polynomial ring, -1 otherwise */
    3628int     pOrdSgn;
     
    4234/* the highest monomial below pHEdge */
    4335poly      ppNoether = NULL;
    44 
    45 // resets the pFDeg and pLDeg: if pLDeg is not given, it is
    46 // set to currRing->pLDegOrig, i.e. to the respective LDegProc which
    47 // only uses pFDeg (and not pDeg, or pTotalDegree, etc)
    48 void pSetDegProcs(pFDegProc new_FDeg, pLDegProc new_lDeg)
    49 {
    50   assume(new_FDeg != NULL);
    51   pFDeg = new_FDeg;
    52   currRing->pFDeg = new_FDeg;
    53 
    54   if (new_lDeg == NULL)
    55     new_lDeg = currRing->pLDegOrig;
    56 
    57   pLDeg = new_lDeg;
    58   currRing->pLDeg = new_lDeg;
    59 }
    60 
    61 
    62 // restores pFDeg and pLDeg:
    63 extern void pRestoreDegProcs(pFDegProc old_FDeg, pLDegProc old_lDeg)
    64 {
    65   assume(old_FDeg != NULL && old_lDeg != NULL);
    66   pFDeg = old_FDeg;
    67   currRing->pFDeg = old_FDeg;
    68   pLDeg = old_lDeg;
    69   currRing->pLDeg = old_lDeg;
    70 }
    7136
    7237#ifdef HAVE_RINGS   //TODO Oliver
  • polys/polys.h

    r5c39a9 r949e57  
    230230
    231231
    232 /*-------------ring management:----------------------*/
    233 
    234 // resets the pFDeg and pLDeg: if pLDeg is not given, it is
    235 // set to currRing->pLDegOrig, i.e. to the respective LDegProc which
    236 // only uses pFDeg (and not pDeg, or pTotalDegree, etc).
    237 // If you use this, make sure your procs does not make any assumptions
    238 // on ordering and/or OrdIndex -- otherwise they might return wrong results
    239 // on strat->tailRing
    240 extern void pSetDegProcs(pFDegProc new_FDeg, pLDegProc new_lDeg = NULL);
    241 // restores pFDeg and pLDeg:
    242 extern void pRestoreDegProcs(pFDegProc old_FDeg, pLDegProc old_lDeg);
    243 
    244232/*-----------the ordering of monomials:-------------*/
    245233#define pSetm(p)    p_Setm(p, currRing)
     
    252240 *
    253241 ***************************************************************/
    254 extern pLDegProc pLDeg;
    255 extern pFDegProc pFDeg;
     242static inline long  pFDeg(const poly p, const ring r)  { return r->pFDeg(p,r); }
     243static inline long  pLDeg(const poly p,  int *l, const ring r)  { return r->pLDeg(p,l,r); }
    256244#define pWeight(c) p_Weight(c,currRing)
    257245#define pDeg(p)    p_Deg(p,currRing)
Note: See TracChangeset for help on using the changeset viewer.