Changeset 9e5836 in git


Ignore:
Timestamp:
Feb 7, 2001, 1:48:27 PM (23 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
1c1d96b5e535776d8281b913f2c6508b4340cac7
Parents:
de901962a53d16256a7fc9fa7fa204030baca7b3
Message:
*hannes: some optimizations


git-svn-id: file:///usr/local/Singular/svn/trunk@5202 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/units.cc

    rde90196 r9e5836  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: units.cc,v 1.4 2001-02-02 11:34:53 mschulze Exp $ */
     4/* $Id: units.cc,v 1.5 2001-02-07 12:48:27 Singular Exp $ */
    55/*
    66* ABSTRACT: procedures to compute with units
     
    2020BOOLEAN isunit(poly u)
    2121{
    22   if(u==NULL||pTotaldegree(u)>0)
    23     return FALSE;
    24   return TRUE;
     22  return (u!=NULL) && pIsConstant(u);
     23//  if(u==NULL||pTotaldegree(u)>0)
     24//    return FALSE;
     25//  return TRUE;
    2526}
    2627
     
    6768        return FALSE;
    6869      }
    69     } 
     70    }
    7071 }
    7172  WerrorS("<int>,[<poly>|<matrix>] expected");
     
    8586    return NULL;
    8687  number u0=nInvers(pGetCoeff(u));
    87   poly v=pOne();
    88   pSetCoeff(v,u0);
     88  poly v=pNSet(u0);
    8989  if(n==0)
    9090    return v;
     
    106106matrix invunit(int n,matrix U)
    107107{
     108  assume(MATCOLS(u)==MATROWS(U));
    108109  for(int i=MATCOLS(U);i>=1;i--)
    109110    MATELEM(U,i,i)=invunit(n,MATELEM(U,i,i));
     
    125126        h=h->next;
    126127        if(h==NULL)
    127         {
     128        {
    128129          res->rtyp=typ;
    129130          res->data=(void*)series(n,pCopy(p));
    130131          return FALSE;
    131         }
     132        }
    132133        if(h->Typ()==POLY_CMD)
    133134        {
     
    264265          res->data=(void*)rednf(idCopy(N),pCopy(p),pCopy(u));
    265266          return FALSE;
    266         }
     267        }
    267268      }
    268269    }
     
    319320  else
    320321  {
    321     matrix U=mpInitI(1,1,NULL);
     322    matrix U=mpNew(1,1);
    322323    MATELEM(U,1,1)=u;
    323324    M0=rednf(N,M,U);
     325    idDelete((ideal*)&U);
    324326  }
    325327  poly p0=M0->m[0];
Note: See TracChangeset for help on using the changeset viewer.