Ignore:
Timestamp:
Jul 17, 2012, 8:05:19 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'c987db42cd2ec943b97ac5746c99892ceddf909c')
Children:
98474f69bc5c570dd7cb85f5f8a0b2164abccb91
Parents:
644f813f8a73f38c6448af263a3ee11e37731a67
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-07-17 20:05:19+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-07-17 21:33:55+02:00
Message:
improved (standalone!) header for polynomials (polys/monomials/monomials.h)

chg: moved the basic primitives for accessing and setting fields of a poly from p_polys.h into monomials.h
NOTE: these basic functions either do NOT need a ring or are macros (or both)

chg: no need to include coeffs/coeffs.h and polys/monomials/ring.h in polys/monomials/monomials.h
NOTE: just forward-declare structures and typedef pointers at them.

chg: minor cleanup of includes in p_polys.cc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/monomials/p_polys.h

    r644f81 r805d0b1  
    3434#include <polys/nc/nc.h>
    3535#endif
    36 
    37 
    38 /***************************************************************
    39  *
    40  * Primitives for accessing and setting fields of a poly
    41  * poly must be != NULL
    42  *
    43  ***************************************************************/
    44 // next
    45 #define pNext(p)            ((p)->next)
    46 #define pIter(p)            ((p) = (p)->next)
    47 
    48 // coeff
    49 // #define pGetCoeff(p)        ((p)->coef)
    50 /// return an alias to the leading coefficient of p
    51 /// assumes that p != NULL
    52 /// NOTE: not copy
    53 static inline number& pGetCoeff(poly p)
    54 {
    55   assume(p != NULL);
    56   return p->coef;
    57 }
    58 
    59 #define p_GetCoeff(p,r)     pGetCoeff(p)
    60 //static inline number& p_GetCoeff(poly p, const ring r)
    61 //{
    62 //  assume(r != NULL);
    63 //  return pGetCoeff(p);
    64 //}
    65 
    66 
    67 
    68 //
    69 // deletes old coeff before setting the new one???
    70 #define pSetCoeff0(p,n)     (p)->coef=(n)
    71 
    72 #define p_SetCoeff0(p,n,r)  pSetCoeff0(p,n)
    73 
    74 #define __p_GetComp(p, r)   (p)->exp[r->pCompIndex]
    75 #define p_GetComp(p, r)    ((long) (r->pCompIndex >= 0 ? __p_GetComp(p, r) : 0))
    7636
    7737/***************************************************************
Note: See TracChangeset for help on using the changeset viewer.