Changeset 9af8d18 in git
- Timestamp:
- Jul 19, 2011, 2:55:33 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- 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
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/splist.cc
re6e2198 r9af8d18 22 22 #include <kernel/GMPrat.h> 23 23 #include <coeffs/numbers.h> 24 #include <polys/ polys.h>24 #include <polys/monomials/p_polys.h> 25 25 #include <kernel/npolygon.h> 26 26 #include <kernel/splist.h> … … 41 41 weight = (Rational)0; 42 42 nf = NULL; 43 r = NULL; 43 44 } 44 45 … … 48 49 49 50 void 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 ) 51 52 { 52 53 next = pnode; … … 54 55 weight = w; 55 56 nf = f; 57 r = R; 56 58 } 57 59 … … 66 68 weight = node.weight; 67 69 nf = node.nf; 70 r = node.r; 68 71 } 69 72 … … 82 85 83 86 spectrumPolyNode::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 ); 87 90 } 88 91 … … 91 94 // ---------------------------------------------------------------------------- 92 95 93 spectrumPolyNode::~spectrumPolyNode( 94 { 95 if( mon!=NULL ) p Delete( &mon);96 if( nf !=NULL ) p Delete( &nf);96 spectrumPolyNode::~spectrumPolyNode() 97 { 98 if( mon!=NULL ) p_Delete( &mon, r ); 99 if( nf !=NULL ) p_Delete( &nf,r ); 97 100 copy_zero( ); 98 101 } … … 176 179 // ---------------------------------------------------------------------------- 177 180 178 void spectrumPolyList::insert_node( poly m,poly f )181 void spectrumPolyList::insert_node( poly m,poly f, const ring R ) 179 182 { 180 183 #ifdef SPLIST_DEBUG … … 198 201 199 202 spectrumPolyNode *newnode = new spectrumPolyNode( 200 (spectrumPolyNode*)NULL,m,np->weight_shift( m ),f);203 (spectrumPolyNode*)NULL,m,np->weight_shift( m,R ),f, R ); 201 204 202 205 if( N==0 || 203 206 root->weight>newnode->weight || 204 207 ( root->weight==newnode->weight && 205 p Cmp( root->mon,newnode->mon)<0 ) )208 p_Cmp( root->mon,newnode->mon,R )<0 ) ) 206 209 { 207 210 // ---------------------- … … 232 235 ( newnode->weight>next->weight || 233 236 ( newnode->weight==next->weight && 234 p Cmp( newnode->mon,next->mon)<0 ) ) )237 p_Cmp( newnode->mon,next->mon, R )<0 ) ) ) 235 238 { 236 239 actual = next; … … 261 264 // ---------------------------------------------------------------------------- 262 265 263 void spectrumPolyList::delete_monomial( poly m )266 void spectrumPolyList::delete_monomial( poly m, const ring R ) 264 267 { 265 268 spectrumPolyNode **node = &root; 266 269 poly *f; 267 270 268 m = p Copy( m);271 m = p_Copy( m,R ); 269 272 270 273 while( *node!=(spectrumPolyNode*)NULL ) 271 274 { 272 if( p Cmp( m,(*node)->mon )>=0 && pLmDivisibleByNoComp( m,(*node)->mon ))275 if( p_Cmp( m,(*node)->mon,R )>=0 && p_LmDivisibleByNoComp( m,(*node)->mon, R )) 273 276 { 274 277 delete_node( node ); … … 280 283 while( *f!=NULL ) 281 284 { 282 if( p Cmp( m,*f )>=0 && pLmDivisibleByNoComp( m,*f) )285 if( p_Cmp( m,*f,R )>=0 && p_LmDivisibleByNoComp( m,*f,R ) ) 283 286 { 284 p LmDelete(f);287 p_LmDelete(f,R); 285 288 } 286 289 else … … 304 307 } 305 308 } 306 p Delete( &m);309 p_Delete( &m,R ); 307 310 } 308 311 -
kernel/splist.h
re6e2198 r9af8d18 41 41 Rational weight; 42 42 poly nf; 43 ring r; 43 44 44 45 spectrumPolyNode( ); 45 spectrumPolyNode( spectrumPolyNode*,poly,const Rational&,poly 46 spectrumPolyNode( spectrumPolyNode*,poly,const Rational&,poly, const ring); 46 47 ~spectrumPolyNode( ); 47 48 48 49 void copy_zero ( void ); 49 void copy_shallow( spectrumPolyNode*,poly,const Rational&,poly 50 void copy_shallow( spectrumPolyNode*,poly,const Rational&,poly, const ring); 50 51 void copy_shallow( spectrumPolyNode& ); 51 52 }; … … 69 70 void copy_shallow( spectrumPolyList& ); 70 71 71 void insert_node( poly,poly );72 void insert_node( poly,poly, const ring ); 72 73 void delete_node( spectrumPolyNode** ); 73 74 74 void delete_monomial( poly );75 void delete_monomial( poly, const ring ); 75 76 76 77 spectrumState spectrum( lists*,int );
Note: See TracChangeset
for help on using the changeset viewer.