Loading...
Searching...
No Matches
spectrumPolyList Class Reference

`#include <splist.h>`

## Public Member Functions

| spectrumPolyList ()
| spectrumPolyList (newtonPolygon *)
| ~spectrumPolyList ()
void | copy_zero (void)
void | copy_shallow (spectrumPolyNode *, int, newtonPolygon *)
void | copy_shallow (spectrumPolyList &)
void | insert_node (poly, poly, const ring)
void | delete_node (spectrumPolyNode **)
void | delete_monomial (poly, const ring)

## Data Fields

spectrumPolyNode * | root
int | N
newtonPolygon * | np

## Detailed Description

Definition at line 56 of file splist.h.

## Constructor & Destructor Documentation

## spectrumPolyList() [1/2]

spectrumPolyList::spectrumPolyList | ( |  | ) |

Definition at line 146 of file splist.cc.

{
copy_zero( );
}
spectrumPolyList::copy_zero
void copy_zero(void)
Definition splist.cc:114

## spectrumPolyList() [2/2]

spectrumPolyList::spectrumPolyList | ( | newtonPolygon * | npolygon | ) |

Definition at line 155 of file splist.cc.

{
copy_shallow( (spectrumPolyNode*)NULL,0,npolygon );
}
spectrumPolyList::copy_shallow
void copy_shallow(spectrumPolyNode *, int, newtonPolygon *)
Definition splist.cc:125
NULL
#define NULL
Definition omList.c:12

## ~spectrumPolyList()

spectrumPolyList::~spectrumPolyList | ( |  | ) |

Definition at line 164 of file splist.cc.

{
spectrumPolyNode *node;
while( root!=(spectrumPolyNode*)NULL )
{
node = root->next;
delete root;
root = node;
}
copy_zero( );
}
spectrumPolyList::root
spectrumPolyNode * root
Definition splist.h:60

## Member Function Documentation

## copy_shallow() [1/2]

void spectrumPolyList::copy_shallow | ( | spectrumPolyList & | splist | ) |

Definition at line 137 of file splist.cc.

{
copy_shallow( splist.root,splist.N,splist.np );
}
spectrumPolyList::N
int N
Definition splist.h:61
spectrumPolyList::np
newtonPolygon * np
Definition splist.h:62

## copy_shallow() [2/2]

void spectrumPolyList::copy_shallow | ( | spectrumPolyNode * | node,
|  | int | k,
|  | newtonPolygon * | npolygon )

Definition at line 125 of file splist.cc.

{
root = node;
N = k;
np = npolygon;
}
k
int k
Definition cfEzgcd.cc:99

## copy_zero()

void spectrumPolyList::copy_zero | ( | void |  | ) |

Definition at line 114 of file splist.cc.

{
root = (spectrumPolyNode*)NULL;
N = 0;
np = (newtonPolygon*)NULL;
}
newtonPolygon
int ** newtonPolygon(const CanonicalForm &F, int &sizeOfNewtonPoly)
compute the Newton polygon of a bivariate polynomial
Definition cfNewtonPolygon.cc:282

## delete_monomial()

void spectrumPolyList::delete_monomial | ( | poly | m,
|  | const ring | R )

Definition at line 269 of file splist.cc.

{
spectrumPolyNode **node = &root;
poly *f;
m = p_Copy( m,R );
while( *node!=(spectrumPolyNode*)NULL )
{
if( p_Cmp( m,(*node)->mon,R )>=0 && p_LmDivisibleByNoComp( m,(*node)->mon, R ))
{
delete_node( node );
}
else if( (*node)->nf!=NULL )
{
f = &((*node)->nf);
while( *f!=NULL )
{
if( p_Cmp( m,*f,R )>=0 && p_LmDivisibleByNoComp( m,*f,R ) )
{
p_LmDelete(f,R);
}
else
{
f = &(pNext( *f ));
}
}
if( (*node)->nf==NULL )
{
delete_node( node );
}
else
{
node = &((*node)->next);
}
}
else
{
node = &((*node)->next);
}
}
p_Delete( &m,R );
}
m
int m
Definition cfEzgcd.cc:128
f
FILE * f
Definition checklibs.c:9
spectrumPolyList::delete_node
void delete_node(spectrumPolyNode **)
Definition splist.cc:256
pNext
#define pNext(p)
Definition monomials.h:36
p_LmDelete
static void p_LmDelete(poly p, const ring r)
Definition p_polys.h:725
p_Cmp
static int p_Cmp(poly p1, poly p2, ring r)
Definition p_polys.h:1748
p_LmDivisibleByNoComp
static BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, const ring r)
Definition p_polys.h:1898
p_Delete
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848
R
#define R
Definition sirandom.c:27

## delete_node()

void spectrumPolyList::delete_node | ( | spectrumPolyNode ** | node | ) |

Definition at line 256 of file splist.cc.

{
spectrumPolyNode *foo = *node;
*node = (*node)->next;
delete foo;
N--;
}
spectrumPolyNode::next
spectrumPolyNode * next
Definition splist.h:39
foo
object foo()
Definition playground.cc:12

## insert_node()

void spectrumPolyList::insert_node | ( | poly | m,
|  | poly | f,
|  | const ring | R )

Definition at line 184 of file splist.cc.

{
#ifdef SPLIST_DEBUG
if( np==(newtonPolygon*)NULL )
{
#ifdef SPLIST_PRINT
#ifdef SPLIST_IOSTREAM
cerr << "void spectrumPolyList::insert_node( poly f )" << endl;
cerr << " no Newton polygon" << endl;
cerr << " exiting..." << endl;
#else
fprintf( stderr,"void spectrumPolyList::insert_node( poly f )\n" );
fprintf( stderr," no Newton polygon\n" );
fprintf( stderr," exiting...\n" );
#endif
#endif
exit( 1 );
}
#endif
spectrumPolyNode *newnode = new spectrumPolyNode(
(spectrumPolyNode*)NULL,m,np->weight_shift( m,R ),f, R );
if( N==0 ||
root->weight>newnode->weight ||
( root->weight==newnode->weight &&
p_Cmp( root->mon,newnode->mon,R )<0 ) )
{
// ----------------------
// insert at position 0
// ----------------------
newnode->next = root;
root = newnode;
}
else if( N==1 )
{
// ---------------
// insert at end
// ---------------
root->next = newnode;
}
else
{
// ----------------------------
// insert according to weight
// ----------------------------
spectrumPolyNode *actual = root;
spectrumPolyNode *next = root->next;
while( next!=(spectrumPolyNode*)NULL &&
( newnode->weight>next->weight ||
( newnode->weight==next->weight &&
p_Cmp( newnode->mon,next->mon, R )<0 ) ) )
{
actual = next;
next = next->next;
}
actual->next = newnode;
newnode->next = next;
}
N++;
}
spectrumPolyNode::weight
Rational weight
Definition splist.h:41
spectrumPolyNode::mon
poly mon
Definition splist.h:40
next
ListNode * next
Definition janet.h:31

## Field Documentation

## N

int spectrumPolyList::N

Definition at line 61 of file splist.h.

## np

newtonPolygon* spectrumPolyList::np

Definition at line 62 of file splist.h.

## root

spectrumPolyNode* spectrumPolyList::root

Definition at line 60 of file splist.h.

The documentation for this class was generated from the following files:

- kernel/spectrum/splist.h
- kernel/spectrum/splist.cc