Changeset 7bbbef in git


Ignore:
Timestamp:
May 31, 2010, 3:09:00 PM (14 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '648d28f488f6ff08f5607ff229b9ad9e4a5b93c2')
Children:
a98f56d0b08e7bf18c6536ebf73eecb1db4bc4eb
Parents:
b695dd84dfeeea2e9ac126f42fc4eb453f454056
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2010-05-31 15:09:00+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:54:59+01:00
Message:
access macros -> coeffs.h, internal proc renamed (n.. -> cf...)
Location:
coeffs
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • coeffs/coeffs.h

    rb695dd r7bbbef  
    7878                                // or NULL
    7979   // general stuff
    80    numberfunc nMult, nSub ,nAdd ,nDiv, nIntDiv, nIntMod, nExactDiv;
     80   numberfunc cfMult, cfSub ,cfAdd ,cfDiv, cfIntDiv, cfIntMod, cfExactDiv;
    8181   /// init with an integer
    8282   number  (*cfInit)(int i,const coeffs r);
    83    number  (*nPar)(int i, const coeffs r);
    84    int     (*nParDeg)(number n, const coeffs r);
     83   number  (*cfPar)(int i, const coeffs r);
     84   int     (*cfParDeg)(number n, const coeffs r);
    8585   /// how complicated, (0) => 0, or positive
    86    int     (*nSize)(number n, const coeffs r);
     86   int     (*cfSize)(number n, const coeffs r);
    8787   /// convertion, 0 if impossible
    88    int     (*n_Int)(number &n, const coeffs r);
     88   int     (*cfInt)(number &n, const coeffs r);
    8989#ifdef HAVE_RINGS
    90    int     (*nDivComp)(number a,number b,const coeffs r);
    91    BOOLEAN (*nIsUnit)(number a,const coeffs r);
    92    number  (*nGetUnit)(number a,const coeffs r);
    93    number  (*nExtGcd)(number a, number b, number *s, number *t,const coeffs r);
     90   int     (*cfDivComp)(number a,number b,const coeffs r);
     91   BOOLEAN (*cfIsUnit)(number a,const coeffs r);
     92   number  (*cfGetUnit)(number a,const coeffs r);
     93   number  (*cfExtGcd)(number a, number b, number *s, number *t,const coeffs r);
    9494#endif
    9595   /// changes argument  inline: a:= -a
    96    number  (*nNeg)(number a, const coeffs r);
     96   number  (*cfNeg)(number a, const coeffs r);
    9797   /// return 1/a
    98    number  (*nInvers)(number a, const coeffs r);
     98   number  (*cfInvers)(number a, const coeffs r);
    9999   /// return a copy of a
    100100   number  (*cfCopy)(number a, const coeffs r);
    101    number  (*nRePart)(number a, const coeffs r);
    102    number  (*nImPart)(number a, const coeffs r);
     101   number  (*cfRePart)(number a, const coeffs r);
     102   number  (*cfImPart)(number a, const coeffs r);
    103103   void    (*cfWrite)(number &a, const coeffs r);
    104    const char *  (*nRead)(const char * s, number * a, const coeffs r);
    105    void    (*nNormalize)(number &a, const coeffs r);
    106    BOOLEAN (*nGreater)(number a,number b, const coeffs r),
     104   const char *  (*cfRead)(const char * s, number * a, const coeffs r);
     105   void    (*cfNormalize)(number &a, const coeffs r);
     106   BOOLEAN (*cfGreater)(number a,number b, const coeffs r),
    107107#ifdef HAVE_RINGS
    108            (*nDivBy)(number a, number b, const coeffs r),
     108           (*cfDivBy)(number a, number b, const coeffs r),
    109109#endif
    110110            /// tests
    111            (*nEqual)(number a,number b, const coeffs r),
    112            (*nIsZero)(number a, const coeffs r),
    113            (*nIsOne)(number a, const coeffs r),
    114            (*nIsMOne)(number a, const coeffs r),
    115            (*nGreaterZero)(number a, const coeffs r);
    116    void    (*nPower)(number a, int i, number * result, const coeffs r);
     111           (*cfEqual)(number a,number b, const coeffs r),
     112           (*cfIsZero)(number a, const coeffs r),
     113           (*cfIsOne)(number a, const coeffs r),
     114           (*cfIsMOne)(number a, const coeffs r),
     115           (*cfGreaterZero)(number a, const coeffs r);
     116   void    (*cfPower)(number a, int i, number * result, const coeffs r);
    117117   number  (*cfGetDenom)(number &n, const coeffs r);
    118118   number  (*cfGetNumerator)(number &n, const coeffs r);
    119    number  (*nGcd)(number a, number b, const coeffs r);
    120    number  (*nLcm)(number a, number b, const coeffs r);
     119   number  (*cfGcd)(number a, number b, const coeffs r);
     120   number  (*cfLcm)(number a, number b, const coeffs r);
    121121   void    (*cfDelete)(number * a, const coeffs r);
    122122   nMapFunc (*cfSetMap)(const coeffs src, const coeffs dst);
    123123
    124124   /// For extensions (writes into global string buffer)
    125    char *  (*nName)(number n, const coeffs r);
     125   char *  (*cfName)(number n, const coeffs r);
    126126
    127127   /// Inline: a := b
    128    void    (*nInpMult)(number &a, number b, const coeffs r);
     128   void    (*cfInpMult)(number &a, number b, const coeffs r);
    129129   /// maps the bigint i (from dummy) into the coeffs dst
    130    number  (*nInit_bigint)(number i, const coeffs dummy, const coeffs dst);
     130   number  (*cfInit_bigint)(number i, const coeffs dummy, const coeffs dst);
    131131
    132132#ifdef LDEBUG
    133133   /// Test: is "a" a correct number?
    134    BOOLEAN (*nDBTest)(number a, const char *f,const int l,const coeffs r);
     134   BOOLEAN (*cfDBTest)(number a, const char *f,const int l,const coeffs r);
    135135#endif
    136136
     
    157157
    158158};
    159 
    160 #endif
    161 
     159//
     160// test properties and type
     161/// Returns the type of coeffs domain
     162static inline n_coeffType getCoeffType(const coeffs r)
     163{
     164  return r->type;
     165}
     166
     167static inline int nInternalChar(const coeffs r)
     168{
     169  return r->ch;
     170}
     171
     172/// one-time initialisations for new coeffs
     173coeffs nInitChar(n_coeffType t, void * parameter);
     174/// undo all initialisations
     175void nKillChar(coeffs r);
     176/// initialisations after each ring change
     177inline void nSetChar(coeffs r)
     178{
     179  if ((r!=NULL) && (r->cfSetChar!=NULL)) r->cfSetChar(r);
     180}
     181
     182//
     183// the access macros:
     184
     185#define n_Copy(n, r)          (r)->cfCopy(n,r)
     186#define n_Delete(n, r)        (r)->cfDelete(n,r)
     187#define n_Mult(n1, n2, r)     (r)->cfMult(n1, n2,r)
     188#define n_Add(n1, n2, r)      (r)->cfAdd(n1, n2,r)
     189#define n_IsZero(n, r)        (r)->cfIsZero(n,r)
     190#define n_Equal(n1, n2, r)    (r)->cfEqual(n1, n2,r)
     191#define n_Neg(n, r)           (r)->cfNeg(n,r)
     192#define n_Sub(n1, n2, r)      (r)->cfSub(n1, n2,r)
     193#define n_GetChar(r)          nInternalChar(r)
     194#define n_Init(i, r)          (r)->cfInit(i,r)
     195#define n_IsOne(n, r)         (r)->cfIsOne(n,r)
     196#define n_IsMOne(n, r)        (r)->cfIsMOne(n,r)
     197#define n_GreaterZero(n, r)   (r)->cfGreaterZero(n,r)
     198#define n_Write(n, r)         (r)->cfWrite(n,r)
     199#define n_Normalize(n, r)     (r)->cfNormalize(n,r)
     200#define n_Gcd(a, b, r)        (r)->cfGcd(a,b,r)
     201#define n_IntDiv(a, b, r)     (r)->cfIntDiv(a,b,r)
     202#define n_Div(a, b, r)        (r)->cfDiv(a,b,r)
     203#define n_Invers(a, r)        (r)->cfInvers(a,r)
     204#define n_ExactDiv(a, b, r)   (r)->cfExactDiv(a,b,r)
     205#define n_Test(a,r)           (r)->cfDBTest(a,r,__FILE__,__LINE__)
     206
     207#define n_InpMult(a, b, r)    (r)->cfInpMult(a,b,r)
     208#define n_Power(a, b, res, r) (r)->cfPower(a,b,res,r)
     209#define n_Size(n,r)           (r)->cfSize(n,r)
     210#define n_GetDenom(N,r)       (r)->cfGetDenom((N),r)
     211#define n_GetNumerator(N,r)   (r)->cfGetNumerator((N),r)
     212
     213#define n_New(n, r)           nNew(n)
     214
     215
     216// and the routines w.r.t. currRing:
     217// (should only be used in the context of currRing, i.e. in the interpreter)
     218void           nNew(number * a);
     219#define nCopy(n)          (currRing->cf)->cfCopy(n,currRing->cf)
     220#define nDelete(n)        (currRing->cf)->cfDelete(n,currRing->cf)
     221#define nMult(n1, n2)     (currRing->cf)->nMult(n1, n2,currRing->cf)
     222#define nAdd(n1, n2)      (currRing->cf)->nAdd(n1, n2,currRing->cf)
     223#define nIsZero(n)        (currRing->cf)->nIsZero(n,currRing->cf)
     224#define nEqual(n1, n2)    (currRing->cf)->nEqual(n1, n2,currRing->cf)
     225#define nNeg(n)           (currRing->cf)->nNeg(n,currRing->cf)
     226#define nSub(n1, n2)      (currRing->cf)->nSub(n1, n2,currRing->cf)
     227#define nGetChar()        nInternalChar(currRing->cf)
     228#define nInit(i)          (currRing->cf)->cfInit(i,currRing->cf)
     229#define nIsOne(n)         (currRing->cf)->nIsOne(n,currRing->cf)
     230#define nIsMOne(n)        (currRing->cf)->nIsMOne(n,currRing->cf)
     231#define nGreaterZero(n)   (currRing->cf)->nGreaterZero(n,currRing->cf)
     232#define nWrite(n)         (currRing->cf)->cfWrite(n,currRing->cf)
     233#define nNormalize(n)     (currRing->cf)->nNormalize(n,currRing->cf)
     234#define nGcd(a, b)        (currRing->cf)->nGcd(a,b,currRing->cf)
     235#define nIntDiv(a, b)     (currRing->cf)->nIntDiv(a,b,currRing->cf)
     236#define nDiv(a, b)        (currRing->cf)->nDiv(a,b,currRing->cf)
     237#define nInvers(a)        (currRing->cf)->nInvers(a,currRing->cf)
     238#define nExactDiv(a, b)   (currRing->cf)->nExactDiv(a,b,currRing->cf)
     239#define nTest(a)          (currRing->cf)->nDBTest(a,currRing->cf,__FILE__,__LINE__)
     240
     241#define nInpMult(a, b)    (currRing->cf)->nInpMult(a,b,currRing->cf)
     242#define nPower(a, b, res) (currRing->cf)->nPower(a,b,res,currRing->cf)
     243#define nSize(n)          (currRing->cf)->nSize(n,currRing->cf)
     244#define nGetDenom(N)      (currRing->cf)->cfGetDenom((N),currRing->cf)
     245#define nGetNumerator(N)  (currRing->cf)->cfGetNumerator((N),currRing->cf)
     246
     247#define nSetMap(R) (currRing->cf->cfSetMap(R,currRing))
     248
     249#endif
     250
  • coeffs/gnumpc.cc

    rb695dd r7bbbef  
    385385
    386386  n->cfDelete  = ngcDelete;
    387   n->nNormalize=ndNormalize;
     387  n->cfNormalize=ndNormalize;
    388388  n->cfInit   = ngcInit;
    389   n->n_Int    = ngcInt;
    390   n->nAdd     = ngcAdd;
    391   n->nSub     = ngcSub;
    392   n->nMult    = ngcMult;
    393   n->nDiv     = ngcDiv;
    394   n->nExactDiv= ngcDiv;
    395   n->nNeg     = ngcNeg;
    396   n->nInvers  = ngcInvers;
     389  n->cfInt    = ngcInt;
     390  n->cfAdd     = ngcAdd;
     391  n->cfSub     = ngcSub;
     392  n->cfMult    = ngcMult;
     393  n->cfDiv     = ngcDiv;
     394  n->cfExactDiv= ngcDiv;
     395  n->cfNeg     = ngcNeg;
     396  n->cfInvers  = ngcInvers;
    397397  n->cfCopy   = ngcCopy;
    398   n->nGreater = ngcGreater;
    399   n->nEqual   = ngcEqual;
    400   n->nIsZero  = ngcIsZero;
    401   n->nIsOne   = ngcIsOne;
    402   n->nIsMOne  = ngcIsMOne;
    403   n->nGreaterZero = ngcGreaterZero;
     398  n->cfGreater = ngcGreater;
     399  n->cfEqual   = ngcEqual;
     400  n->cfIsZero  = ngcIsZero;
     401  n->cfIsOne   = ngcIsOne;
     402  n->cfIsMOne  = ngcIsMOne;
     403  n->cfGreaterZero = ngcGreaterZero;
    404404  n->cfWrite  = ngcWrite;
    405   n->nRead    = ngcRead;
    406   n->nPower   = ngcPower;
     405  n->cfRead    = ngcRead;
     406  n->cfPower   = ngcPower;
    407407  n->cfSetMap = ngcSetMap;
    408   n->nPar     = ngcPar;
    409   n->nRePart  = ngcRePart;
    410   n->nImPart  = ngcImPart;
    411     // nSize  = ndSize;
     408  n->cfPar     = ngcPar;
     409  n->cfRePart  = ngcRePart;
     410  n->cfImPart  = ngcImPart;
     411    // cfSize  = ndSize;
    412412#ifdef LDEBUG
    413   n->nDBTest  = ndDBTest; // not yet implemented: ngcDBTest
     413  n->cfDBTest  = ndDBTest; // not yet implemented: ngcDBTest
    414414#endif
    415415
     
    422422  r->nCoeffIsEqual=nlCoeffsEqual;
    423423
    424   r->nMult  = nlMult;
    425   r->nSub   = nlSub;
    426   r->nAdd   = nlAdd;
    427   r->nDiv   = nlDiv;
    428   r->nIntDiv= nlIntDiv;
    429   r->nIntMod= nlIntMod;
    430   r->nExactDiv= nlExactDiv;
     424  r->cfMult  = nlMult;
     425  r->cfSub   = nlSub;
     426  r->cfAdd   = nlAdd;
     427  r->cfDiv   = nlDiv;
     428  r->cfIntDiv= nlIntDiv;
     429  r->cfIntMod= nlIntMod;
     430  r->cfExactDiv= nlExactDiv;
    431431  r->cfInit = nlInit;
    432   r->nPar = ndPar;
    433   r->nParDeg = ndParDeg;
    434   r->nSize  = nlSize;
    435   r->n_Int  = nlInt;
     432  r->cfPar = ndPar;
     433  r->cfParDeg = ndParDeg;
     434  r->cfSize  = nlSize;
     435  r->cfInt  = nlInt;
    436436#ifdef HAVE_RINGS
    437   r->nDivComp = NULL; // only for ring stuff
    438   r->nIsUnit = NULL; // only for ring stuff
    439   r->nGetUnit = NULL; // only for ring stuff
    440   r->nExtGcd = NULL; // only for ring stuff
     437  r->cfDivComp = NULL; // only for ring stuff
     438  r->cfIsUnit = NULL; // only for ring stuff
     439  r->cfGetUnit = NULL; // only for ring stuff
     440  r->cfExtGcd = NULL; // only for ring stuff
    441441#endif
    442   r->nNeg   = nlNeg;
    443   r->nInvers= nlInvers;
     442  r->cfNeg   = nlNeg;
     443  r->cfInvers= nlInvers;
    444444  r->cfCopy  = nl_Copy;
    445   r->nRePart = nl_Copy;
    446   r->nImPart = ndReturn0;
     445  r->cfRePart = nl_Copy;
     446  r->cfImPart = ndReturn0;
    447447  r->cfWrite = nlWrite;
    448   r->nRead = nlRead;
    449   r->nNormalize=nlNormalize;
    450   r->nGreater = nlGreater;
     448  r->cfRead = nlRead;
     449  r->cfNormalize=nlNormalize;
     450  r->cfGreater = nlGreater;
    451451#ifdef HAVE_RINGS
    452   r->nDivBy = NULL; // only for ring stuff
     452  r->cfDivBy = NULL; // only for ring stuff
    453453#endif
    454   r->nEqual = nlEqual;
    455   r->nIsZero = nlIsZero;
    456   r->nIsOne = nlIsOne;
    457   r->nIsMOne = nlIsMOne;
    458   r->nGreaterZero = nlGreaterZero;
    459   r->nPower = nlPower;
     454  r->cfEqual = nlEqual;
     455  r->cfIsZero = nlIsZero;
     456  r->cfIsOne = nlIsOne;
     457  r->cfIsMOne = nlIsMOne;
     458  r->cfGreaterZero = nlGreaterZero;
     459  r->cfPower = nlPower;
    460460  r->cfGetDenom = nlGetDenom;
    461461  r->cfGetNumerator = nlGetNumerator;
    462   r->nGcd  = nlGcd;
    463   r->nLcm  = nlLcm;
     462  r->cfGcd  = nlGcd;
     463  r->cfLcm  = nlLcm;
    464464  r->cfDelete= nlDelete;
    465465  r->cfSetMap = nlSetMap;
    466   r->nName = ndName;
    467   r->nInpMult=nlInpMult;
    468   r->nInit_bigint=nlCopyMap;
     466  r->cfName = ndName;
     467  r->cfInpMult=nlInpMult;
     468  r->cfInit_bigint=nlCopyMap;
    469469#ifdef LDEBUG
    470470  // debug stuff
    471   r->nDBTest=nlDBTest;
     471  r->cfDBTest=nlDBTest;
    472472#endif
    473473
  • coeffs/gnumpfl.cc

    rb695dd r7bbbef  
    418418
    419419  n->cfDelete  = ngfDelete;
    420   n->nNormalize=ndNormalize;
     420  n->cfNormalize=ndNormalize;
    421421  n->cfInit   = ngfInit;
    422   n->n_Int    = ngfInt;
    423   n->nAdd     = ngfAdd;
    424   n->nSub     = ngfSub;
    425   n->nMult    = ngfMult;
    426   n->nDiv     = ngfDiv;
    427   n->nExactDiv= ngfDiv;
    428   n->nNeg     = ngfNeg;
    429   n->nInvers  = ngfInvers;
     422  n->cfInt    = ngfInt;
     423  n->cfAdd     = ngfAdd;
     424  n->cfSub     = ngfSub;
     425  n->cfMult    = ngfMult;
     426  n->cfDiv     = ngfDiv;
     427  n->cfExactDiv= ngfDiv;
     428  n->cfNeg     = ngfNeg;
     429  n->cfInvers  = ngfInvers;
    430430  n->cfCopy   = ngfCopy;
    431   n->nGreater = ngfGreater;
    432   n->nEqual   = ngfEqual;
    433   n->nIsZero  = ngfIsZero;
    434   n->nIsOne   = ngfIsOne;
    435   n->nIsMOne  = ngfIsMOne;
    436   n->nGreaterZero = ngfGreaterZero;
     431  n->cfGreater = ngfGreater;
     432  n->cfEqual   = ngfEqual;
     433  n->cfIsZero  = ngfIsZero;
     434  n->cfIsOne   = ngfIsOne;
     435  n->cfIsMOne  = ngfIsMOne;
     436  n->cfGreaterZero = ngfGreaterZero;
    437437  n->cfWrite  = ngfWrite;
    438   n->nRead    = ngfRead;
    439   n->nPower   = ngfPower;
     438  n->cfRead    = ngfRead;
     439  n->cfPower   = ngfPower;
    440440  n->cfSetMap = ngfSetMap;
    441441#ifdef LDEBUG
    442   n->nDBTest  = ndDBTest; // not yet implemented: ngfDBTest
     442  n->cfDBTest  = ndDBTest; // not yet implemented: ngfDBTest
    443443#endif
    444444}
  • coeffs/longrat.cc

    rb695dd r7bbbef  
    24692469  r->nCoeffIsEqual=nlCoeffsEqual;
    24702470
    2471   r->nMult  = nlMult;
    2472   r->nSub   = nlSub;
    2473   r->nAdd   = nlAdd;
    2474   r->nDiv   = nlDiv;
    2475   r->nIntDiv= nlIntDiv;
    2476   r->nIntMod= nlIntMod;
    2477   r->nExactDiv= nlExactDiv;
     2471  r->cfMult  = nlMult;
     2472  r->cfSub   = nlSub;
     2473  r->cfAdd   = nlAdd;
     2474  r->cfDiv   = nlDiv;
     2475  r->cfIntDiv= nlIntDiv;
     2476  r->cfIntMod= nlIntMod;
     2477  r->cfExactDiv= nlExactDiv;
    24782478  r->cfInit = nlInit;
    2479   //r->nPar = ndPar;
    2480   //r->nParDeg = ndParDeg;
    2481   r->nSize  = nlSize;
    2482   r->n_Int  = nlInt;
     2479  //r->cfPar = ndPar;
     2480  //r->cfParDeg = ndParDeg;
     2481  r->cfSize  = nlSize;
     2482  r->cfInt  = nlInt;
    24832483  #ifdef HAVE_RINGS
    2484   //r->nDivComp = NULL; // only for ring stuff
    2485   //r->nIsUnit = NULL; // only for ring stuff
    2486   //r->nGetUnit = NULL; // only for ring stuff
    2487   //r->nExtGcd = NULL; // only for ring stuff
     2484  //r->cfDivComp = NULL; // only for ring stuff
     2485  //r->cfIsUnit = NULL; // only for ring stuff
     2486  //r->cfGetUnit = NULL; // only for ring stuff
     2487  //r->cfExtGcd = NULL; // only for ring stuff
     2488  //r->cfDivBy = NULL; // only for ring stuff
    24882489  #endif
    2489   r->nNeg   = nlNeg;
    2490   r->nInvers= nlInvers;
     2490  r->cfNeg   = nlNeg;
     2491  r->cfInvers= nlInvers;
    24912492  r->cfCopy  = nl_Copy;
    2492   r->nRePart = nl_Copy;
    2493   //r->nImPart = ndReturn0;
     2493  r->cfRePart = nl_Copy;
     2494  //r->cfImPart = ndReturn0;
    24942495  r->cfWrite = nlWrite;
    2495   r->nRead = nlRead;
    2496   r->nNormalize=nlNormalize;
    2497   r->nGreater = nlGreater;
    2498   #ifdef HAVE_RINGS
    2499   //r->nDivBy = NULL; // only for ring stuff
    2500   #endif
    2501   r->nEqual = nlEqual;
    2502   r->nIsZero = nlIsZero;
    2503   r->nIsOne = nlIsOne;
    2504   r->nIsMOne = nlIsMOne;
    2505   r->nGreaterZero = nlGreaterZero;
    2506   r->nPower = nlPower;
     2496  r->cfRead = nlRead;
     2497  r->cfNormalize=nlNormalize;
     2498  r->cfGreater = nlGreater;
     2499  r->cfEqual = nlEqual;
     2500  r->cfIsZero = nlIsZero;
     2501  r->cfIsOne = nlIsOne;
     2502  r->cfIsMOne = nlIsMOne;
     2503  r->cfGreaterZero = nlGreaterZero;
     2504  r->cfPower = nlPower;
    25072505  r->cfGetDenom = nlGetDenom;
    25082506  r->cfGetNumerator = nlGetNumerator;
    2509   r->nGcd  = nlGcd;
    2510   r->nLcm  = nlLcm;
     2507  r->cfGcd  = nlGcd;
     2508  r->cfLcm  = nlLcm;
    25112509  r->cfDelete= nlDelete;
    25122510  r->cfSetMap = nlSetMap;
    2513   //r->nName = ndName;
    2514   r->nInpMult=nlInpMult;
    2515   r->nInit_bigint=nlCopyMap;
     2511  //r->cfName = ndName;
     2512  r->cfInpMult=nlInpMult;
     2513  r->cfInit_bigint=nlCopyMap;
    25162514#ifdef LDEBUG
    25172515  // debug stuff
    2518   r->nDBTest=nlDBTest;
     2516  r->cfDBTest=nlDBTest;
    25192517#endif
    25202518 
  • coeffs/modulop.cc

    rb695dd r7bbbef  
    330330  r->nCoeffIsEqual=npCoeffsEqual;
    331331
    332   r->nMult  = npMult;
    333   r->nSub   = npSub;
    334   r->nAdd   = npAdd;
    335   r->nDiv   = npDiv;
    336   r->nIntDiv= npDiv;
    337   //r->nIntMod= ndIntMod;
    338   r->nExactDiv= npDiv;
     332  r->cfMult  = npMult;
     333  r->cfSub   = npSub;
     334  r->cfAdd   = npAdd;
     335  r->cfDiv   = npDiv;
     336  r->cfIntDiv= npDiv;
     337  //r->cfIntMod= ndIntMod;
     338  r->cfExactDiv= npDiv;
    339339  r->cfInit = npInit;
    340   //r->nPar = ndPar;
    341   //r->nParDeg = ndParDeg;
    342   //r->nSize  = ndSize;
    343   r->n_Int  = npInt;
     340  //r->cfPar = ndPar;
     341  //r->cfParDeg = ndParDeg;
     342  //r->cfSize  = ndSize;
     343  r->cfInt  = npInt;
    344344  #ifdef HAVE_RINGS
    345   //r->nDivComp = NULL; // only for ring stuff
    346   //r->nIsUnit = NULL; // only for ring stuff
    347   //r->nGetUnit = NULL; // only for ring stuff
    348   //r->nExtGcd = NULL; // only for ring stuff
     345  //r->cfDivComp = NULL; // only for ring stuff
     346  //r->cfIsUnit = NULL; // only for ring stuff
     347  //r->cfGetUnit = NULL; // only for ring stuff
     348  //r->cfExtGcd = NULL; // only for ring stuff
     349  // r->cfDivBy = NULL; // only for ring stuff
    349350  #endif
    350   r->nNeg   = npNeg;
    351   r->nInvers= npInvers;
     351  r->cfNeg   = npNeg;
     352  r->cfInvers= npInvers;
    352353  //r->cfCopy  = ndCopy;
    353   //r->nRePart = ndCopy;
    354   //r->nImPart = ndReturn0;
     354  //r->cfRePart = ndCopy;
     355  //r->cfImPart = ndReturn0;
    355356  r->cfWrite = npWrite;
    356   r->nRead = npRead;
    357   //r->nNormalize=ndNormalize;
    358   r->nGreater = npGreater;
    359   #ifdef HAVE_RINGS
    360   r->nDivBy = NULL; // only for ring stuff
    361   #endif
    362   r->nEqual = npEqual;
    363   r->nIsZero = npIsZero;
    364   r->nIsOne = npIsOne;
    365   r->nIsMOne = npIsMOne;
    366   r->nGreaterZero = npGreaterZero;
    367   r->nPower = npPower;
     357  r->cfRead = npRead;
     358  //r->cfNormalize=ndNormalize;
     359  r->cfGreater = npGreater;
     360  r->cfEqual = npEqual;
     361  r->cfIsZero = npIsZero;
     362  r->cfIsOne = npIsOne;
     363  r->cfIsMOne = npIsMOne;
     364  r->cfGreaterZero = npGreaterZero;
     365  r->cfPower = npPower;
    368366  r->cfGetDenom = ndGetDenom;
    369367  r->cfGetNumerator = ndGetNumerator;
    370   //r->nGcd  = ndGcd;
    371   //r->nLcm  = ndGcd;
     368  //r->cfGcd  = ndGcd;
     369  //r->cfLcm  = ndGcd;
    372370  //r->cfDelete= ndDelete;
    373371  r->cfSetMap = npSetMap;
    374   //r->nName = ndName;
    375   r->nInpMult=ndInpMult;
    376   r->nInit_bigint= npMap0;
     372  //r->cfName = ndName;
     373  r->cfInpMult=ndInpMult;
     374  r->cfInit_bigint= npMap0;
    377375#ifdef NV_OPS
    378376  if (c>NV_MAX_PRIME)
    379377  {
    380     r->nMult  = nvMult;
    381     r->nDiv   = nvDiv;
    382     r->nExactDiv= nvDiv;
    383     r->nInvers= nvInvers;
    384     r->nPower= nvPower;
     378    r->cfMult  = nvMult;
     379    r->cfDiv   = nvDiv;
     380    r->cfExactDiv= nvDiv;
     381    r->cfInvers= nvInvers;
     382    r->cfPower= nvPower;
    385383  }
    386384#endif
    387385#ifdef LDEBUG
    388386  // debug stuff
    389   r->nDBTest=npDBTest;
     387  r->cfDBTest=npDBTest;
    390388#endif
    391389 
  • coeffs/numbers.cc

    rb695dd r7bbbef  
    121121
    122122    // default entries (different from NULL) for some routines:
    123     n->nPar  = ndPar;
    124     n->nParDeg=ndParDeg;
    125     n->nSize = ndSize;
     123    n->cfPar  = ndPar;
     124    n->cfParDeg=ndParDeg;
     125    n->cfSize = ndSize;
    126126    n->cfGetDenom= ndGetDenom;
    127127    n->cfGetNumerator= ndGetNumerator;
    128     n->nName =  ndName;
    129     n->nImPart=ndReturn0;
     128    n->cfName =  ndName;
     129    n->cfImPart=ndReturn0;
    130130    n->cfDelete= ndDelete;
    131     n->nInpMult=ndInpMult;
     131    n->cfInpMult=ndInpMult;
    132132    n->cfCopy=nd_Copy;
    133     n->nIntMod=ndIntMod; /* dummy !! */
    134     n->nNormalize=ndNormalize;
    135     n->nGcd  = ndGcd;
    136     n->nLcm  = ndGcd; /* tricky, isn't it ?*/
    137 #ifdef HAVE_RINGS
    138     n->nDivComp = ndDivComp;
    139     n->nDivBy = ndDivBy;
    140     n->nIsUnit = ndIsUnit;
    141     n->nExtGcd = ndExtGcd;
    142     //n->nGetUnit = (nMapFunc)NULL;
     133    n->cfIntMod=ndIntMod; /* dummy !! */
     134    n->cfNormalize=ndNormalize;
     135    n->cfGcd  = ndGcd;
     136    n->cfLcm  = ndGcd; /* tricky, isn't it ?*/
     137#ifdef HAVE_RINGS
     138    n->cfDivComp = ndDivComp;
     139    n->cfDivBy = ndDivBy;
     140    n->cfIsUnit = ndIsUnit;
     141    n->cfExtGcd = ndExtGcd;
     142    //n->cfGetUnit = (nMapFunc)NULL;
    143143#endif
    144144  #if 0 /*vertagt*/
     
    190190       Werror("coeff init missing for %d",(int)t);
    191191    // post init settings:
    192     if (n->nRePart==NULL) n->nRePart=n->cfCopy;
    193     if (n->nIntDiv==NULL) n->nIntDiv=n->nDiv;
    194 #ifdef HAVE_RINGS
    195    if (n->nGetUnit==(nMapFunc)NULL) n->nGetUnit=n->cfCopy;
     192    if (n->cfRePart==NULL) n->cfRePart=n->cfCopy;
     193    if (n->cfIntDiv==NULL) n->cfIntDiv=n->cfDiv;
     194#ifdef HAVE_RINGS
     195   if (n->cfGetUnit==(nMapFunc)NULL) n->cfGetUnit=n->cfCopy;
    196196#endif
    197197  }
  • coeffs/numbers.h

    rb695dd r7bbbef  
    1010#include "coeffs.h"
    1111
    12 /// Returns the type of coeffs domain
    13 static inline n_coeffType getCoeffType(const coeffs r)
    14 {
    15   return r->type;
    16 }
    17 
    18 static inline int nInternalChar(const coeffs r)
    19 {
    20   return r->ch;
    21 }
    22 
    2312#define SHORT_REAL_LENGTH 6 // use short reals for real <= 6 digits
    24 
    25 #define n_Copy(n, r)          (r)->cfCopy(n,r)
    26 #define n_Delete(n, r)        (r)->cfDelete(n,r)
    27 #define n_Mult(n1, n2, r)     (r)->nMult(n1, n2,r)
    28 #define n_Add(n1, n2, r)      (r)->nAdd(n1, n2,r)
    29 #define n_IsZero(n, r)        (r)->nIsZero(n,r)
    30 #define n_Equal(n1, n2, r)    (r)->nEqual(n1, n2,r)
    31 #define n_Neg(n, r)           (r)->nNeg(n,r)
    32 #define n_Sub(n1, n2, r)      (r)->nSub(n1, n2,r)
    33 #define n_GetChar(r)          ((r)->ch)
    34 #define n_Init(i, r)          (r)->cfInit(i,r)
    35 #define n_IsOne(n, r)         (r)->nIsOne(n,r)
    36 #define n_IsMOne(n, r)        (r)->nIsMOne(n,r)
    37 #define n_GreaterZero(n, r)   (r)->nGreaterZero(n,r)
    38 #define n_Write(n, r)         (r)->cfWrite(n,r)
    39 #define n_Normalize(n, r)     (r)->nNormalize(n,r)
    40 #define n_Gcd(a, b, r)        (r)->nGcd(a,b,r)
    41 #define n_IntDiv(a, b, r)     (r)->nIntDiv(a,b,r)
    42 #define n_Div(a, b, r)        (r)->nDiv(a,b,r)
    43 #define n_Invers(a, r)        (r)->nInvers(a,r)
    44 #define n_ExactDiv(a, b, r)   (r)->nExactDiv(a,b,r)
    45 #define n_Test(a,r)           (r)->nDBTest(a,r,__FILE__,__LINE__)
    46 
    47 #define n_InpMult(a, b, r)    (r)->nInpMult(a,b,r)
    48 #define n_Power(a, b, res, r) (r)->nPower(a,b,res,r)
    49 #define n_Size(n,r)           (r)->nSize(n,r)
    50 #define n_GetDenom(N,r)       (r)->cfGetDenom((N),r)
    51 #define n_GetNumerator(N,r)   (r)->cfGetNumerator((N),r)
    52 
    53 #define n_New(n, r)           nNew(n)
    54 
    55 /* prototypes */
    56 void           nNew(number * a);
    57 
    58 #define nTest(a) (1)
    59 
    60 // please use n_* counterparts instead!!!
    61 // #define nDelete(A) (currRing)->cf->cfDelete(A,currRing)
    62 // #define nGetDenom(N) (currRing->cf->cfGetDenom((N),currRing))
    63 // #define nGetNumerator(N) (currRing->cf->cfGetNumerator((N),currRing))
    64 
    65 
    66 #define nSetMap(R) (currRing->cf->cfSetMap(R,currRing))
    6713
    6814/* the dummy routines: */
     
    8733void nDBDummy1(number* d,char *f, int l);
    8834#endif
    89 #define nGetChar() n_GetChar(currRing)
    90 
    91 /// one-time initialisations for new coeffs
    92 coeffs nInitChar(n_coeffType t, void * parameter);
    93 /// undo all initialisations
    94 void nKillChar(coeffs r);
    95 /// initialisations after each ring change
    96 inline void nSetChar(coeffs r)
    97 {
    98   if ((r!=NULL) && (r->cfSetChar!=NULL)) r->cfSetChar(r);
    99 }
    10035
    10136#define nDivBy0 "div by 0"
  • coeffs/shortfl.cc

    rb695dd r7bbbef  
    552552
    553553  n->cfInit = nrInit;
    554   n->n_Int  = nrInt;
    555   n->nAdd   = nrAdd;
    556   n->nSub   = nrSub;
    557   n->nMult  = nrMult;
    558   n->nDiv   = nrDiv;
    559   n->nExactDiv= nrDiv;
    560   n->nNeg   = nrNeg;
    561   n->nInvers= nrInvers;
     554  n->cfInt  = nrInt;
     555  n->cfAdd   = nrAdd;
     556  n->cfSub   = nrSub;
     557  n->cfMult  = nrMult;
     558  n->cfDiv   = nrDiv;
     559  n->cfExactDiv= nrDiv;
     560  n->cfNeg   = nrNeg;
     561  n->cfInvers= nrInvers;
    562562  n->cfCopy  = ndCopy;
    563   n->nGreater = nrGreater;
    564   n->nEqual = nrEqual;
    565   n->nIsZero = nrIsZero;
    566   n->nIsOne = nrIsOne;
    567   n->nIsMOne = nrIsMOne;
    568   n->nGreaterZero = nrGreaterZero;
     563  n->cfGreater = nrGreater;
     564  n->cfEqual = nrEqual;
     565  n->cfIsZero = nrIsZero;
     566  n->cfIsOne = nrIsOne;
     567  n->cfIsMOne = nrIsMOne;
     568  n->cfGreaterZero = nrGreaterZero;
    569569  n->cfWrite = nrWrite;
    570   n->nRead = nrRead;
    571   n->nPower = nrPower;
     570  n->cfRead = nrRead;
     571  n->cfPower = nrPower;
    572572  n->cfSetMap=nrSetMap;
    573573    /* nName= ndName; */
    574574    /*nSize  = ndSize;*/
    575575#ifdef LDEBUG
    576   n->nDBTest=ndDBTest; // not yet implemented: nrDBTest;
     576  n->cfDBTest=ndDBTest; // not yet implemented: nrDBTest;
    577577#endif
    578578 
Note: See TracChangeset for help on using the changeset viewer.