Changeset 7e30dd in git


Ignore:
Timestamp:
Mar 5, 2001, 5:41:49 PM (22 years ago)
Author:
Mathias Schulze <mschulze@…>
Branches:
(u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
Children:
3be21912509b9d0d48aa864b1627f831fad50bf6
Parents:
07a268cace99ce7229a8b6c651fab8f17e3e5931
Message:
*mschulze: pMinDeg, idMinDeg, pJetW


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

Legend:

Unmodified
Added
Removed
  • Singular/ideals.cc

    r07a268 r7e30dd  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.123 2001-02-27 18:06:34 mschulze Exp $ */
     4/* $Id: ideals.cc,v 1.124 2001-03-05 16:41:47 mschulze Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    29052905}
    29062906
    2907 int idMinDegW(ideal M,intvec *w)
     2907int idMinDeg(ideal M,intvec *w)
    29082908{
    29092909  int d=-1;
    29102910  for(int i=0;i<IDELEMS(M);i++)
    29112911  {
    2912     int d0=pMinDegW(M->m[i],w);
     2912    int d0=pMinDeg(M->m[i],w);
    29132913    if(-1<d0&&(d0<d||d==-1))
    29142914      d=d0;
     
    29172917}
    29182918
    2919 ideal idSeries(int n,ideal M,matrix U=NULL)
     2919ideal idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL)
    29202920{
    29212921  for(int i=IDELEMS(M)-1;i>=0;i--)
    29222922  {
    29232923    if(U==NULL)
    2924       M->m[i]=pSeries(n,M->m[i]);
     2924      M->m[i]=pSeries(n,M->m[i],NULL,w);
    29252925    else
    29262926    {
    2927       M->m[i]=pSeries(n,M->m[i],MATELEM(U,i+1,i+1));
     2927      M->m[i]=pSeries(n,M->m[i],MATELEM(U,i+1,i+1),w);
    29282928      MATELEM(U,i+1,i+1)=NULL;
    29292929    }
  • Singular/ideals.h

    r07a268 r7e30dd  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ideals.h,v 1.33 2001-02-27 18:06:34 mschulze Exp $ */
     6/* $Id: ideals.h,v 1.34 2001-03-05 16:41:48 mschulze Exp $ */
    77/*
    88* ABSTRACT - all basic methods to manipulate ideals
     
    129129ideal   idJet(ideal i,int d);
    130130ideal   idJetW(ideal i,int d, intvec * iv);
    131 int idMinDegW(ideal M,intvec *w);
    132 ideal   idSeries(int n,ideal M,matrix U=NULL);
     131int idMinDeg(ideal M,intvec *w=NULL);
     132ideal   idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL);
    133133
    134134BOOLEAN idIsZeroDim(ideal i);
  • Singular/polys.h

    r07a268 r7e30dd  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys.h,v 1.55 2001-02-27 18:06:35 mschulze Exp $ */
     6/* $Id: polys.h,v 1.56 2001-03-05 16:41:49 mschulze Exp $ */
    77/*
    88* ABSTRACT - all basic methods to manipulate polynomials of the
     
    403403poly      pJet(poly p, int m);
    404404poly      ppJetW(poly p, int m, short * iv);
    405 int pMinDegW(poly p,intvec *w);
    406 poly      pSeries(int n,poly p,poly u=NULL);
    407 poly      pInvers(int n, poly p);
     405poly      pJetW(poly p, int m, short * iv);
     406int pMinDeg(poly p,intvec *w=NULL);
     407poly      pSeries(int n,poly p,poly u=NULL,intvec *w=NULL);
     408poly      pInvers(int n, poly p,intvec *w=NULL);
    408409// maximum weigthed degree of all monomials of p, w is indexed from
    409410// 1..pVariables
  • Singular/polys1.cc

    r07a268 r7e30dd  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys1.cc,v 1.65 2001-02-27 18:06:35 mschulze Exp $ */
     4/* $Id: polys1.cc,v 1.66 2001-03-05 16:41:48 mschulze Exp $ */
    55
    66/*
     
    11581158  poly t=NULL;
    11591159  short *wsave=ecartWeights;
    1160 
    11611160  ecartWeights=w;
    1162 
    11631161  while (p!=NULL)
    11641162  {
     
    11851183}
    11861184
    1187 int pMinDegW(poly p,intvec *w)
     1185poly pJetW(poly p, int m, short *w)
     1186{
     1187  poly t=NULL;
     1188  short *wsave=ecartWeights;
     1189  ecartWeights=w;
     1190  while((p!=NULL) && (totaldegreeWecart(p)>m)) pLmDelete(&p);
     1191  if (p==NULL) return NULL;
     1192  poly r=p;
     1193  while (pNext(p)!=NULL)
     1194  {
     1195    if (totaldegreeWecart(pNext(p))>m)
     1196    {
     1197      pLmDelete(&pNext(p));
     1198    }
     1199    else
     1200      pIter(p);
     1201  }
     1202  ecartWeights=wsave;
     1203  return r;
     1204}
     1205
     1206int pMinDeg(poly p,intvec *w=NULL)
    11881207{
    11891208  if(p==NULL)
    11901209    return -1;
    1191   int n=0;
    1192   if(w!=NULL)
    1193     n=w->length();
    1194   if(pVariables<n)
    1195     n=pVariables;
    11961210  int d=-1;
    11971211  while(p!=NULL)
    11981212  {
    11991213    int d0=0;
    1200     for(int j=0;j<n;j++)
    1201       d0+=(*w)[j]*pGetExp(p,j+1);
     1214    for(int j=0;j<pVariables;j++)
     1215      if(w==NULL||j>=w->length())
     1216        d0+=pGetExp(p,j+1);
     1217      else
     1218        d0+=(*w)[j]*pGetExp(p,j+1);
    12021219    if(d0<d||d==-1)
    12031220      d=d0;
     
    12071224}
    12081225
    1209 poly pSeries(int n,poly p,poly u=NULL)
    1210 {
     1226poly pSeries(int n,poly p,poly u=NULL,intvec *w=NULL)
     1227{
     1228  short *ww=iv2array(w);
    12111229  if(p!=NULL)
    12121230  {
    12131231    if(u==NULL)
    1214       p=pJet(p,n);
     1232      p=pJetW(p,n,ww);
    12151233    else
    1216       p=pJet(pMult(p,pInvers(n-pTotaldegree(p),u)),n);
    1217   }
     1234      p=pJetW(pMult(p,pInvers(n-pMinDeg(p,w),u,w)),n,ww);
     1235  }
     1236  omFreeSize((ADDRESS)ww,(pVariables+1)*sizeof(short));
    12181237  return p;
    12191238}
    12201239
    1221 poly pInvers(int n,poly u)
    1222 {
     1240poly pInvers(int n,poly u,intvec *w)
     1241{
     1242  short *ww=iv2array(w);
    12231243  if(n<0)
    12241244    return NULL;
     
    12271247  if(n==0)
    12281248    return v;
    1229   poly u1=pJet(pSub(pOne(),pMult_nn(u,u0)),n);
     1249  poly u1=pJetW(pSub(pOne(),pMult_nn(u,u0)),n,ww);
    12301250  if(u1==NULL)
    12311251    return v;
    12321252  poly v1=pMult_nn(pCopy(u1),u0);
    12331253  v=pAdd(v,pCopy(v1));
    1234   for(int i=n/pTotaldegree(u1);i>1;i--)
    1235   {
    1236     v1=pJet(pMult(v1,pCopy(u1)),n);
     1254  for(int i=n/pMinDeg(u1,w);i>1;i--)
     1255  {
     1256    v1=pJetW(pMult(v1,pCopy(u1)),n,ww);
    12371257    v=pAdd(v,pCopy(v1));
    12381258  }
    12391259  pDelete(&u1);
    12401260  pDelete(&v1);
     1261  omFreeSize((ADDRESS)ww,(pVariables+1)*sizeof(short));
    12411262  return v;
    12421263}
Note: See TracChangeset for help on using the changeset viewer.