Changeset c98410 in git for Singular


Ignore:
Timestamp:
Mar 7, 2002, 7:32:10 PM (22 years ago)
Author:
Mathias Schulze <mschulze@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
Children:
ede4b1438e7649ee4804381c07689bd711015cf2
Parents:
6eb633d64f25992a02dea1e0cd0a21e4cf71a100
Message:
*mschulze: division with 3 args


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

Legend:

Unmodified
Added
Removed
  • Singular/ideals.cc

    r6eb633d rc98410  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.128 2002-03-07 16:00:58 mschulze Exp $ */
     4/* $Id: ideals.cc,v 1.129 2002-03-07 18:32:09 mschulze Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    18861886
    18871887/*2
    1888 *computes division of P by Q with remainder up to weighted degree n
     1888*computes division of P by Q with remainder up to (w-weighted) degree n
    18891889*P, Q, and w are not changed
    18901890*/
    1891 lists idLiftW(ideal P, ideal Q, int n, short *w)
     1891lists idLiftW(ideal P,ideal Q,int n,short *w=NULL)
    18921892{
    18931893  int N=0;
    18941894  int i;
    18951895  for(i=IDELEMS(Q)-1;i>=0;i--)
    1896     N=max(N,pDegW(Q->m[i],w));
     1896    if(w==NULL)
     1897      N=max(N,pDeg(Q->m[i]));
     1898    else
     1899      N=max(N,pDegW(Q->m[i],w));
    18971900  N+=n;
    18981901
     
    19021905  for(i=IDELEMS(P)-1;i>=0;i--)
    19031906  {
    1904     poly p=ppJetW(P->m[i],N,w);
     1907    poly p;
     1908    if(w==NULL)
     1909      p=ppJet(P->m[i],N);
     1910    else
     1911      p=ppJetW(P->m[i],N,w);
    19051912
    19061913    int j=IDELEMS(Q)-1;
     
    19101917      {
    19111918        poly p0=pDivideM(pHead(p),pHead(Q->m[j]));
    1912         p=pJetW(pSub(p,ppMult_mm(Q->m[j],p0)),N,w);
     1919        if(w==NULL)
     1920          p=pJet(pSub(p,ppMult_mm(Q->m[j],p0)),N);
     1921        else
     1922          p=pJetW(pSub(p,ppMult_mm(Q->m[j],p0)),N,w);
    19131923        pNormalize(p);
    1914         if(pDegW(p0,w)>n)
     1924        if(w==NULL&&pDeg(p0)>n||w!=NULL&&pDegW(p0,w)>n)
    19151925          pDelete(&p0);
    19161926        else
     
    19251935          pIter(p);
    19261936          pNext(p0)=NULL;
    1927           if(pDegW(p0,w)>n)
     1937          if(w==NULL&&pDeg(p0)>n||w!=NULL&&pDegW(p0,w)>n)
    19281938            pDelete(&p0);
    19291939          else
  • Singular/ideals.h

    r6eb633d rc98410  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ideals.h,v 1.37 2002-02-28 17:56:33 mschulze Exp $ */
     6/* $Id: ideals.h,v 1.38 2002-03-07 18:32:10 mschulze Exp $ */
    77/*
    88* ABSTRACT - all basic methods to manipulate ideals
     
    9797             matrix *unit=NULL);
    9898
    99 lists   idLiftW (ideal P, ideal Q, int n, short *w);
     99lists idLiftW(ideal P,ideal Q,int n,short *w=NULL);
    100100
    101101intvec * idMWLift(ideal mod,intvec * weights);
  • Singular/iparith.cc

    r6eb633d rc98410  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iparith.cc,v 1.279 2002-03-07 16:00:57 mschulze Exp $ */
     4/* $Id: iparith.cc,v 1.280 2002-03-07 18:32:08 mschulze Exp $ */
    55
    66/*
     
    48164816
    48174817static BOOLEAN jjDIVISION4(leftv res, leftv v)
    4818 {
     4818{ // may have 3 or 4 arguments
    48194819  leftv v1=v;
    48204820  leftv v2=v1->next;
     
    48254825  int i2=iiTestConvert(v2->Typ(),MODUL_CMD);
    48264826
    4827   if(i1==0||i2==0||v3->Typ()!=INT_CMD||v4->Typ()!=INTVEC_CMD)
    4828   {
    4829     WarnS("<module>,<module>,<int>,<intvec> expected!");
     4827  if(i1==0||i2==0||v3->Typ()!=INT_CMD||(v4!=NULL&&v4->Typ()!=INTVEC_CMD))
     4828  {
     4829    WarnS("<module>,<module>,<int>[,<intvec>] expected!");
    48304830    return TRUE;
    48314831  }
     
    48384838
    48394839  int n=(int)v3->Data();
    4840   short *w=iv2array((intvec *)v4->Data());
    4841 
    4842   short *w0=w+1;
    4843   int i=pVariables;
    4844   while(i>0&&*w0>0)
    4845   {
    4846     w0++;
    4847     i--;
    4848   }
    4849   if(i>0)
    4850     WarnS("not all weights are positive!");
     4840  short *w=NULL;
     4841  if(v4!=NULL)
     4842  {
     4843    w=iv2array((intvec *)v4->Data());
     4844    short *w0=w+1;
     4845    int i=pVariables;
     4846    while(i>0&&*w0>0)
     4847    {
     4848      w0++;
     4849      i--;
     4850    }
     4851    if(i>0)
     4852      WarnS("not all weights are positive!");
     4853  }
    48514854
    48524855  lists L=idLiftW(P,Q,n,w);
    48534856
    4854   omFree(w);
     4857  if(w!=NULL)
     4858    omFree(w);
    48554859
    48564860  L->m[1].rtyp=v1->Typ();
     
    55045508,{jjCOEF_M,    COEF_CMD,        NONE,               4  }
    55055509,{jjCALL2ARG,  DIVISION_CMD,    ANY_TYPE/*or set by p*/,2  }
     5510,{jjDIVISION4, DIVISION_CMD,    ANY_TYPE/*or set by p*/,3  }
    55065511,{jjDIVISION4, DIVISION_CMD,    ANY_TYPE/*or set by p*/,4  }
    55075512,{jjDBPRINT,   DBPRINT_CMD,     NONE,               -2 }
Note: See TracChangeset for help on using the changeset viewer.