Changeset 9af8d18 in git


Ignore:
Timestamp:
Jul 19, 2011, 2:55:33 PM (13 years ago)
Author:
mlee <martinlee84@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '79dfb9a6d258bfeb991428bdb25b8f55e9e809b2')
Children:
660a68fc35c514edd7c0ed668a72a1375b26af96
Parents:
e6e2198ed93af775c39a664d74d4d9deadd803ab
git-author:
mlee <martinlee84@web.de>2011-07-19 14:55:33+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:40:43+01:00
Message:
added a member ring to class spectrumPolyNode
added const ring to ring dependend functions
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/splist.cc

    re6e2198 r9af8d18  
    2222#include <kernel/GMPrat.h>
    2323#include <coeffs/numbers.h>
    24 #include <polys/polys.h>
     24#include <polys/monomials/p_polys.h>
    2525#include <kernel/npolygon.h>
    2626#include <kernel/splist.h>
     
    4141    weight = (Rational)0;
    4242    nf     = NULL;
     43    r      = NULL;
    4344}
    4445
     
    4849
    4950void    spectrumPolyNode::copy_shallow(
    50                 spectrumPolyNode *pnode,poly m,const Rational &w,poly f )
     51         spectrumPolyNode *pnode,poly m,const Rational &w,poly f, const ring R )
    5152{
    5253    next   = pnode;
     
    5455    weight = w;
    5556    nf     = f;
     57    r      = R;
    5658}
    5759
     
    6668    weight = node.weight;
    6769    nf     = node.nf;
     70    r      = node.r;
    6871}
    6972
     
    8285
    8386spectrumPolyNode::spectrumPolyNode(
    84         spectrumPolyNode *pnode,poly m,const Rational &w,poly f )
    85 {
    86     copy_shallow( pnode,m,w,f );
     87        spectrumPolyNode *pnode,poly m,const Rational &w,poly f, const ring R )
     88{
     89    copy_shallow( pnode,m,w,f,R );
    8790}
    8891
     
    9194// ----------------------------------------------------------------------------
    9295
    93 spectrumPolyNode::~spectrumPolyNode( )
    94 {
    95     if( mon!=NULL ) pDelete( &mon );
    96     if( nf !=NULL ) pDelete( &nf );
     96spectrumPolyNode::~spectrumPolyNode()
     97{
     98    if( mon!=NULL ) p_Delete( &mon, r );
     99    if( nf !=NULL ) p_Delete( &nf,r );
    97100    copy_zero( );
    98101}
     
    176179// ----------------------------------------------------------------------------
    177180
    178 void    spectrumPolyList::insert_node( poly m,poly f )
     181void    spectrumPolyList::insert_node( poly m,poly f, const ring R )
    179182{
    180183    #ifdef SPLIST_DEBUG
     
    198201
    199202    spectrumPolyNode    *newnode = new spectrumPolyNode(
    200         (spectrumPolyNode*)NULL,m,np->weight_shift( m ),f );
     203        (spectrumPolyNode*)NULL,m,np->weight_shift( m,R ),f, R );
    201204
    202205    if( N==0 ||
    203206              root->weight>newnode->weight ||
    204207            ( root->weight==newnode->weight &&
    205               pCmp( root->mon,newnode->mon )<0 ) )
     208              p_Cmp( root->mon,newnode->mon,R )<0 ) )
    206209    {
    207210        // ----------------------
     
    232235               ( newnode->weight>next->weight ||
    233236               ( newnode->weight==next->weight &&
    234                  pCmp( newnode->mon,next->mon )<0 ) ) )
     237                 p_Cmp( newnode->mon,next->mon, R )<0 ) ) )
    235238        {
    236239            actual = next;
     
    261264// ----------------------------------------------------------------------------
    262265
    263 void    spectrumPolyList::delete_monomial( poly m )
     266void    spectrumPolyList::delete_monomial( poly m, const ring R )
    264267{
    265268    spectrumPolyNode **node = &root;
    266269    poly              *f;
    267270
    268     m = pCopy( m );
     271    m = p_Copy( m,R );
    269272
    270273    while( *node!=(spectrumPolyNode*)NULL )
    271274    {
    272         if( pCmp( m,(*node)->mon )>=0 && pLmDivisibleByNoComp( m,(*node)->mon ) )
     275        if( p_Cmp( m,(*node)->mon,R )>=0 && p_LmDivisibleByNoComp( m,(*node)->mon, R ))
    273276        {
    274277            delete_node( node );
     
    280283            while( *f!=NULL )
    281284            {
    282                 if( pCmp( m,*f )>=0 && pLmDivisibleByNoComp( m,*f ) )
     285                if( p_Cmp( m,*f,R )>=0 && p_LmDivisibleByNoComp( m,*f,R ) )
    283286                {
    284                     pLmDelete(f);
     287                    p_LmDelete(f,R);
    285288                }
    286289                else
     
    304307        }
    305308    }
    306     pDelete( &m );
     309    p_Delete( &m,R );
    307310}
    308311
  • kernel/splist.h

    re6e2198 r9af8d18  
    4141    Rational            weight;
    4242    poly                nf;
     43    ring                r;
    4344
    4445    spectrumPolyNode( );
    45     spectrumPolyNode( spectrumPolyNode*,poly,const Rational&,poly );
     46    spectrumPolyNode( spectrumPolyNode*,poly,const Rational&,poly, const ring);
    4647    ~spectrumPolyNode( );
    4748
    4849    void    copy_zero   ( void );
    49     void    copy_shallow( spectrumPolyNode*,poly,const Rational&,poly );
     50    void    copy_shallow( spectrumPolyNode*,poly,const Rational&,poly, const ring);
    5051    void    copy_shallow( spectrumPolyNode& );
    5152};
     
    6970    void    copy_shallow( spectrumPolyList& );
    7071
    71     void    insert_node( poly,poly );
     72    void    insert_node( poly,poly, const ring );
    7273    void    delete_node( spectrumPolyNode** );
    7374
    74     void    delete_monomial( poly );
     75    void    delete_monomial( poly, const ring );
    7576
    7677    spectrumState  spectrum( lists*,int );
Note: See TracChangeset for help on using the changeset viewer.