Changeset 48a41a in git


Ignore:
Timestamp:
Feb 17, 2012, 11:35:47 AM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
26acab557e4ad73e2c8ba02fa1ad998773365fff66e25f2bbb3969a1769c9710fee12d7ca6262dd7
Parents:
46eef0a30be9c81870e8f7f971a5e0748c9e8fcd
Message:
chg: introduce n_ParDeg for pardeg(number)
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    r46eef0 r48a41a  
    44454445static BOOLEAN jjPARDEG(leftv res, leftv v)
    44464446{
    4447   res->data = (char *)0L;
    44484447  number nn=(number)v->Data();
    4449   if (nn!=NULL)
    4450   {
    4451     if (getCoeffType(currRing->cf)==n_algExt)
    4452     {
    4453       poly qq=(poly)nn;
    4454       res->data = (char *)(long)currRing->cf->extRing->pFDeg(qq,
    4455         currRing->cf->extRing);
    4456     }
    4457     if(getCoeffType(currRing->cf)==n_transExt)
    4458     {
    4459       /* from transext.h:*/
    4460       struct fractionObject
    4461       {
    4462         poly numerator;
    4463         poly denominator;
    4464         int complexity;
    4465       };
    4466       typedef struct fractionObject * fraction;
    4467       #define NUM(f) (((fraction)f)->numerator)
    4468 
    4469       fraction qq=(fraction)nn;
    4470       res->data = (char *)(long)currRing->cf->extRing->pFDeg(NUM(qq),
    4471         currRing->cf->extRing);
    4472     }
    4473   }
     4448  res->data = (char *)(long)n_ParDeg(nn,currRing->cf);
    44744449  return FALSE;
    44754450}
  • libpolys/coeffs/coeffs.h

    r46eef0 r48a41a  
    183183   /// returns X with X mod q[i]=x[i], i=0..rl-1
    184184   number  (*cfChineseRemainder)(number *x, number *q,int rl, const coeffs);
     185
     186   /// degree for coeffcients: -1 for 0, 0 for "constants", ...
     187   int (*cfParDeg)(number x,const coeffs r);
    185188
    186189#ifdef HAVE_FACTORY
     
    610613}
    611614
     615static inline int n_ParDeg(number n, const coeffs r)
     616{
     617  assume(r != NULL);
     618  return r->cfParDeg(n,r);
     619}
     620
    612621static inline number  n_Init_bigint(number i, const coeffs dummy,
    613622                const coeffs dst)
  • libpolys/coeffs/numbers.cc

    r46eef0 r48a41a  
    8585  Werror("ChineseRemainder not implemented for (c=%d)",getCoeffType(r));
    8686  return n_Init(0,r);
     87}
     88
     89int ndParDeg(number n, const coeffs r)
     90{
     91  return (-n_IsZero(n,r));
    8792}
    8893
     
    252257    n->cfChineseRemainder = ndChineseRemainder;
    253258    n->cfFarey = ndFarey;
     259    n->cfParDeg = ndParDeg;
    254260
    255261#ifdef HAVE_RINGS
  • libpolys/polys/ext_fields/algext.cc

    r46eef0 r48a41a  
    737737 
    738738  return NULL;                                           /// default
     739}
     740
     741int naParDeg(number a, const coeffs cf)
     742{
     743  if (a == NULL) return -1;
     744  poly aa=(poly)a;
     745  return cf->extRing->pFDeg(aa,cf->extRing);
    739746}
    740747
     
    810817  cf->convSingNFactoryN=naConvSingNFactoryN;
    811818#endif
     819  cf->cfParDeg = naParDeg;
    812820 
    813821  return FALSE;
  • libpolys/polys/ext_fields/transext.cc

    r46eef0 r48a41a  
    12811281#endif
    12821282
     1283int ntParDeg(number a, const coeffs cf)
     1284{
     1285  if (IS0(a)) return -1;
     1286  fraction fa = (fraction)a;
     1287  return cf->extRing->pFDeg(NUM(fa),cf->extRing);
     1288}
     1289
    12831290BOOLEAN ntInitChar(coeffs cf, void * infoStruct)
    12841291{
     
    13491356  cf->convSingNFactoryN =ntConvSingNFactoryN;
    13501357#endif
     1358  cf->cfParDeg = ntParDeg;
    13511359
    13521360  return FALSE;
Note: See TracChangeset for help on using the changeset viewer.