Changeset f550e86 in git for libpolys


Ignore:
Timestamp:
Mar 22, 2011, 10:21:59 AM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '2fa36c576e6a4ddbb1093b43c7f8e9835e17e52a')
Children:
ba0fc3d4dcb089fc5523e7af222a8f52d7cb44b8
Parents:
47a8626627fa6ec583d0e0d8c844f3fdce6e2930
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-03-22 10:21:59+01:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:04:08+01:00
Message:
- fixed weights.h
- moved Jet routines to p_polys.cc
Location:
libpolys/polys
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/Makefile.am

    r47a8626 rf550e86  
    1515        templates/p_Procs_Lib.cc \
    1616        polys0.cc polys1.cc prCopy.cc prCopyTemplate.cc \
    17         kbuckets.cc sbuckets.cc templates/p_Procs.cc
     17        kbuckets.cc sbuckets.cc templates/p_Procs.cc weights.cc
    1818
    1919BUILT_SOURCES = templates/p_Procs.inc
     
    2828        templates/p_Procs_Dynamic.h templates/p_Procs_Impl.h templates/p_Procs_Set.h templates/p_Procs_Static.h \
    2929        monomials/p_polys.h monomials/polys-impl.h monomials/maps.h polys.h prCopy.h prCopyMacros.h \
    30         kbuckets.h sbuckets.h simpleideals.h
     30        kbuckets.h sbuckets.h simpleideals.h weights.h
    3131
    3232P_PROCS_CPPFLAGS_COMMON = -DDYNAMIC_VERSION
  • libpolys/polys/monomials/p_polys.cc

    r47a8626 rf550e86  
    1717#include <polys/monomials/p_polys.h>
    1818#include <polys/monomials/ring.h>
     19#include <polys/weight.h>
    1920#include <coeffs/longrat.h>
    2021#include <misc/options.h>
     
    33293330  return result;
    33303331}
     3332/**************************************************************
     3333 *
     3334 * Jet
     3335 *
     3336 **************************************************************/
     3337
     3338poly pp_Jet(poly p, int m, const ring R)
     3339{
     3340  poly r=NULL;
     3341  poly t=NULL;
     3342
     3343  while (p!=NULL)
     3344  {
     3345    if (p_Totaldegree(p,R)<=m)
     3346    {
     3347      if (r==NULL)
     3348        r=p_Head(p,R);
     3349      else
     3350      if (t==NULL)
     3351      {
     3352        pNext(r)=p_Head(p,R);
     3353        t=pNext(r);
     3354      }
     3355      else
     3356      {
     3357        pNext(t)=p_Head(p,R);
     3358        pIter(t);
     3359      }
     3360    }
     3361    pIter(p);
     3362  }
     3363  return r;
     3364}
     3365
     3366poly p_Jet(poly p, int m,const ring R)
     3367{
     3368  poly t=NULL;
     3369
     3370  while((p!=NULL) && (p_Totaldegree(p,R)>m)) p_LmDelete(&p,R);
     3371  if (p==NULL) return NULL;
     3372  poly r=p;
     3373  while (pNext(p)!=NULL)
     3374  {
     3375    if (p_Totaldegree(pNext(p),R)>m)
     3376    {
     3377      p_LmDelete(&pNext(p),R);
     3378    }
     3379    else
     3380      pIter(p);
     3381  }
     3382  return r;
     3383}
     3384
     3385poly pp_JetW(poly p, int m, short *w, const ring R)
     3386{
     3387  poly r=NULL;
     3388  poly t=NULL;
     3389  while (p!=NULL)
     3390  {
     3391    if (totaldegreeWecart_IV(p,R,w)<=m)
     3392    {
     3393      if (r==NULL)
     3394        r=p_Head(p,R);
     3395      else
     3396      if (t==NULL)
     3397      {
     3398        pNext(r)=p_Head(p,R);
     3399        t=pNext(r);
     3400      }
     3401      else
     3402      {
     3403        pNext(t)=p_Head(p,R);
     3404        pIter(t);
     3405      }
     3406    }
     3407    pIter(p);
     3408  }
     3409  return r;
     3410}
     3411
     3412poly p_JetW(poly p, int m, short *w, const ring R)
     3413{
     3414  poly t=NULL;
     3415  while((p!=NULL) && (totaldegreeWecart_IV(p,R,w)>m)) p_LmDelete(&p,R);
     3416  if (p==NULL) return NULL;
     3417  poly r=p;
     3418  while (pNext(p)!=NULL)
     3419  {
     3420    if (totaldegreeWecart_IV(pNext(p),R,w)>m)
     3421    {
     3422      p_LmDelete(&pNext(p),R);
     3423    }
     3424    else
     3425      pIter(p);
     3426  }
     3427  return r;
     3428}
    33313429
    33323430/***************************************************************
  • libpolys/polys/monomials/p_polys.h

    r47a8626 rf550e86  
    226226void p_ShallowDelete(poly *p, const ring r);
    227227
    228  
     228
    229229
    230230/***************************************************************
     
    13161316  return np;
    13171317}
    1318 // set all exponents l..k to 0, assume exp. k+1..n and 1..l-1 are in 
     1318// set all exponents l..k to 0, assume exp. k+1..n and 1..l-1 are in
    13191319// different blocks
    13201320// set coeff to 1
     
    18171817void p_SetModDeg(intvec *w, ring r);
    18181818
     1819/*------------ Jet ----------------------------------*/
     1820poly pp_Jet(poly p, int m, const ring R);
     1821poly p_Jet(poly p, int m,const ring R);
     1822poly pp_JetW(poly p, int m, short *w, const ring R);
     1823poly p_JetW(poly p, int m, short *w, const ring R);
    18191824
    18201825
  • libpolys/polys/polys1.cc

    r47a8626 rf550e86  
    3333
    3434
    35 poly ppJet(poly p, int m)
    36 {
    37   poly r=NULL;
    38   poly t=NULL;
    39 
    40   while (p!=NULL)
    41   {
    42     if (p_Totaldegree(p,currRing)<=m)
    43     {
    44       if (r==NULL)
    45         r=pHead(p);
    46       else
    47       if (t==NULL)
    48       {
    49         pNext(r)=pHead(p);
    50         t=pNext(r);
    51       }
    52       else
    53       {
    54         pNext(t)=pHead(p);
    55         pIter(t);
    56       }
    57     }
    58     pIter(p);
    59   }
    60   return r;
    61 }
    62 
    63 poly pJet(poly p, int m)
    64 {
    65   poly t=NULL;
    66 
    67   while((p!=NULL) && (p_Totaldegree(p,currRing)>m)) pLmDelete(&p);
    68   if (p==NULL) return NULL;
    69   poly r=p;
    70   while (pNext(p)!=NULL)
    71   {
    72     if (p_Totaldegree(pNext(p),currRing)>m)
    73     {
    74       pLmDelete(&pNext(p));
    75     }
    76     else
    77       pIter(p);
    78   }
    79   return r;
    80 }
    81 
    82 poly ppJetW(poly p, int m, short *w)
    83 {
    84   poly r=NULL;
    85   poly t=NULL;
    86   while (p!=NULL)
    87   {
    88     if (totaldegreeWecart_IV(p,currRing,w)<=m)
    89     {
    90       if (r==NULL)
    91         r=pHead(p);
    92       else
    93       if (t==NULL)
    94       {
    95         pNext(r)=pHead(p);
    96         t=pNext(r);
    97       }
    98       else
    99       {
    100         pNext(t)=pHead(p);
    101         pIter(t);
    102       }
    103     }
    104     pIter(p);
    105   }
    106   return r;
    107 }
    108 
    109 poly pJetW(poly p, int m, short *w)
    110 {
    111   while((p!=NULL) && (totaldegreeWecart_IV(p,currRing,w)>m)) pLmDelete(&p);
    112   if (p==NULL) return NULL;
    113   poly r=p;
    114   while (pNext(p)!=NULL)
    115   {
    116     if (totaldegreeWecart_IV(pNext(p),currRing,w)>m)
    117     {
    118       pLmDelete(&pNext(p));
    119     }
    120     else
    121       pIter(p);
    122   }
    123   return r;
    124 }
    125 
    12635int pMinDeg(poly p,intvec *w)
    12736{
  • libpolys/polys/weight.h

    r47a8626 rf550e86  
    99/* $Id$ */
    1010
    11 #include <kernel/structs.h>
    12 #include <kernel/ring.h>
     11#include <polys/monomials/ring.h>
    1312
    14 extern short * ecartWeights;
    15 extern pFDegProc pFDegOld;
    16 extern pLDegProc pLDegOld;
     13//extern short * ecartWeights;
     14//extern pFDegProc pFDegOld;
     15//extern pLDegProc pLDegOld;
    1716
    18 void kEcartWeights(polyset s, int sl, short *eweight);
    19 BOOLEAN kWeight(leftv res,leftv id);
    20 BOOLEAN kQHWeight(leftv res,leftv v);
    21 long maxdegreeWecart(poly p,int *l, ring r = currRing);
    22 long totaldegreeWecart(poly p, ring r = currRing);
     17void kEcartWeights(poly* s, int sl, short *eweight);
     18//BOOLEAN kWeight(leftv res,leftv id);
     19//BOOLEAN kQHWeight(leftv res,leftv v);
     20long maxdegreeWecart(poly p,int *l, ring r);
     21long totaldegreeWecart(poly p, ring r);
    2322long totaldegreeWecart_IV(poly p, ring r, const short *w);
    2423
     
    3029extern "C" double wFunctionalBuch(int *degw, int *lpol, int npol,
    3130       double *rel, double wx, double wNsqr);
    32 void wCall(polyset s, int sl, int *x, double wNsqr);
     31void wCall(poly* s, int sl, int *x, double wNsqr);
    3332
    3433#endif
Note: See TracChangeset for help on using the changeset viewer.