Changeset 805d0b1 in git


Ignore:
Timestamp:
Jul 17, 2012, 8:05:19 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
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
Location:
libpolys/polys/monomials
Files:
3 edited

Legend:

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

    r644f81 r805d0b1  
    1010
    1111#include <omalloc/omalloc.h>
    12 #include <coeffs/coeffs.h>
    13 #include <polys/monomials/ring.h>
     12
     13struct snumber;
     14typedef struct snumber *   number;
     15
     16struct ip_sring;
     17typedef struct ip_sring *         ring;
     18typedef struct ip_sring const *   const_ring;
    1419
    1520/***************************************************************
     
    2126struct spolyrec;
    2227typedef struct spolyrec *          poly;
     28
    2329struct  spolyrec
    2430{
     
    2733  unsigned long exp[1];     // make sure that exp is aligned
    2834};
     35
     36/***************************************************************
     37 *
     38 * Primitives for accessing and setting fields of a poly
     39 * poly must be != NULL
     40 *
     41 ***************************************************************/
     42// next
     43#define pNext(p)            ((p)->next)
     44#define pIter(p)            ((p) = (p)->next)
     45
     46// coeff
     47// #define pGetCoeff(p)        ((p)->coef)
     48/// return an alias to the leading coefficient of p
     49/// assumes that p != NULL
     50/// NOTE: not copy
     51static inline number& pGetCoeff(poly p)
     52{
     53  assume(p != NULL);
     54  return p->coef;
     55}
     56
     57#define p_GetCoeff(p,r)     pGetCoeff(p)
     58//static inline number& p_GetCoeff(poly p, const ring r)
     59//{
     60//  assume(r != NULL);
     61//  return pGetCoeff(p);
     62//}
     63
     64
     65//
     66// deletes old coeff before setting the new one???
     67#define pSetCoeff0(p,n)     (p)->coef=(n)
     68#define p_SetCoeff0(p,n,r)  pSetCoeff0(p,n)
     69
     70
     71#define __p_GetComp(p, r)   (p)->exp[r->pCompIndex]
     72#define p_GetComp(p, r)    ((long) (r->pCompIndex >= 0 ? __p_GetComp(p, r) : 0))
     73
    2974
    3075/***************************************************************
  • libpolys/polys/monomials/p_polys.cc

    r644f81 r805d0b1  
    2424#define TRANSEXT_PRIVATES
    2525
    26 #include "ext_fields/transext.h"
    27 #include "ext_fields/algext.h"
    28 
    29 #include "weight.h"
    30 #include "simpleideals.h"
    31 
    32 #include "monomials/ring.h"
    33 #include "monomials/p_polys.h"
     26#include <polys/ext_fields/transext.h>
     27#include <polys/ext_fields/algext.h>
     28
     29#include <polys/weight.h>
     30#include <polys/simpleideals.h>
     31
     32#include "ring.h"
     33#include "p_polys.h"
     34
    3435#include <polys/templates/p_MemCmp.h>
    3536#include <polys/templates/p_MemAdd.h>
  • 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.