Loading...
Searching...
No Matches
newtonPolygon Class Reference

`#include <npolygon.h>`

## Public Member Functions

| newtonPolygon ()
| newtonPolygon (const newtonPolygon &)
| newtonPolygon (poly, const ring r)
| ~newtonPolygon ()
newtonPolygon & | operator= (const newtonPolygon &)
void | copy_new (int)
void | copy_delete (void)
void | copy_zero (void)
void | copy_shallow (newtonPolygon &)
void | copy_deep (const newtonPolygon &)
void | add_linearForm (const linearForm &)
Rational | weight (poly, const ring r) const
Rational | weight_shift (poly, const ring r) const
Rational | weight1 (poly, const ring r) const
Rational | weight_shift1 (poly, const ring r) const

## Private Attributes

linearForm * | l
int | N

## Detailed Description

Definition at line 61 of file npolygon.h.

## Constructor & Destructor Documentation

## newtonPolygon() [1/3]

newtonPolygon::newtonPolygon | ( |  | ) |

inline

Definition at line 165 of file npolygon.h.

{
copy_zero( );
}
newtonPolygon::copy_zero
void copy_zero(void)
Definition npolygon.h:144

## newtonPolygon() [2/3]

newtonPolygon::newtonPolygon | ( | const newtonPolygon & | np | ) |

Definition at line 367 of file npolygon.cc.

{
copy_deep( np );
}
newtonPolygon::copy_deep
void copy_deep(const newtonPolygon &)
Definition npolygon.cc:353

## newtonPolygon() [3/3]

newtonPolygon::newtonPolygon | ( | poly | f,
|  | const ring | r )

Definition at line 397 of file npolygon.cc.

{
copy_zero( );
int *r=new int[s->N];
poly *m=new poly[s->N];
KMatrix<Rational> mat(s->N,s->N+1 );
int i,j,stop=FALSE;
linearForm sol;
// ---------------
// init counters
// ---------------
for( i=0; i<s->N; i++ )
{
r[i] = i;
}
m[0] = f;
for( i=1; i<s->N; i++ )
{
m[i] = pNext(m[i-1]);
}
// -----------------------------
// find faces (= linear forms)
// -----------------------------
do
{
// ---------------------------------------------------
// test if monomials p.m[r[0]]m,...,p.m[r[p.vars-1]]
// are linearely independent
// ---------------------------------------------------
for( i=0; i<s->N; i++ )
{
for( j=0; j<s->N; j++ )
{
// mat.set( i,j,pGetExp( m[r[i]],j+1 ) );
mat.set( i,j,p_GetExp( m[i],j+1,s ) );
}
mat.set( i,j,1 );
}
if( mat.solve( &(sol.c),&(sol.N) ) == s->N )
{
// ---------------------------------
// check if linearForm is positive
// check if linearForm is extremal
// ---------------------------------
if( sol.positive( ) && sol.pweight( f,s ) >= (Rational)1 )
{
// ----------------------------------
// this is a face or the polyhedron
// ----------------------------------
add_linearForm( sol );
sol.c = (Rational*)NULL;
sol.N = 0;
}
}
// --------------------
// increment counters
// --------------------
for( i=1; r[i-1] + 1 == r[i] && i < s->N; i++ );
for( j=0; j<i-1; j++ )
{
r[j]=j;
}
if( i>1 )
{
m[0]=f;
for( j=1; j<i-1; j++ )
{
m[j]=pNext(m[j-1]);
}
}
r[i-1]++;
m[i-1]=pNext(m[i-1]);
if( m[s->N-1] == (poly)NULL )
{
stop = TRUE;
}
} while( stop == FALSE );
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
f
FILE * f
Definition checklibs.c:9
linearForm::c
Rational * c
Definition npolygon.h:22
linearForm::N
int N
Definition npolygon.h:23
linearForm::pweight
Rational pweight(poly, const ring r) const
Definition npolygon.cc:205
linearForm::positive
int positive(void)
Definition npolygon.cc:279
newtonPolygon::add_linearForm
void add_linearForm(const linearForm &)
Definition npolygon.cc:525
s
const CanonicalForm int s
Definition facAbsFact.cc:51
j
int j
Definition facHensel.cc:110
pNext
#define pNext(p)
Definition monomials.h:36
NULL
#define NULL
Definition omList.c:12
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition p_polys.h:471

## ~newtonPolygon()

newtonPolygon::~newtonPolygon | ( |  | ) |

Definition at line 376 of file npolygon.cc.

{
copy_delete( );
}
newtonPolygon::copy_delete
void copy_delete(void)
Definition npolygon.cc:342

## Member Function Documentation

## add_linearForm()

void newtonPolygon::add_linearForm | ( | const linearForm & | l0 | ) |

Definition at line 525 of file npolygon.cc.

{
int i;
newtonPolygon np;
// -------------------------------------
// test if linear form is already here
// -------------------------------------
for( i=0; i<N; i++ )
{
if( l0==l[i] )
{
return;
}
}
np.copy_new( N+1 );
np.N = N+1;
for( i=0; i<N; i++ )
{
np.l[i].copy_shallow( l[i] );
l[i].copy_zero( );
}
np.l[N] = l0;
copy_delete( );
copy_shallow( np );
np.copy_zero( );
return;
}
linearForm::copy_shallow
void copy_shallow(linearForm &)
Definition npolygon.h:119
newtonPolygon::copy_new
void copy_new(int)
Definition npolygon.cc:296
newtonPolygon::copy_shallow
void copy_shallow(newtonPolygon &)
Definition npolygon.h:154
newtonPolygon::newtonPolygon
newtonPolygon()
Definition npolygon.h:165
newtonPolygon::N
int N
Definition npolygon.h:67
newtonPolygon::l
linearForm * l
Definition npolygon.h:66

## copy_deep()

void newtonPolygon::copy_deep | ( | const newtonPolygon & | np | ) |

Definition at line 353 of file npolygon.cc.

{
copy_new( np.N );
for( int i=0; i<np.N; i++ )
{
l[i] = np.l[i];
}
N = np.N;
}

## copy_delete()

void newtonPolygon::copy_delete | ( | void |  | ) |

Definition at line 342 of file npolygon.cc.

{
if( l != (linearForm*)NULL && N > 0 )
delete [] l;
copy_zero( );
}

## copy_new()

void newtonPolygon::copy_new | ( | int | k | ) |

Definition at line 296 of file npolygon.cc.

{
if( k > 0 )
{
l = new linearForm[k];
#ifndef SING_NDEBUG
if( l == (linearForm*)NULL )
{
#ifdef NPOLYGON_PRINT
#ifdef NPOLYGON_IOSTREAM
cerr <<
"void newtonPolygon::copy_new( int k ): no memory left ...\n";
#else
fprintf( stderr,
"void newtonPolygon::copy_new( int k ): no memory left ...\n" );
#endif
#endif
HALT();
}
#endif
}
else if( k == 0 )
{
l = (linearForm*)NULL;
}
else if( k < 0 )
{
#ifdef NPOLYGON_PRINT
#ifdef NPOLYGON_IOSTREAM
cerr << "void newtonPolygon::copy_new( int k ): k < 0 ...\n";
#else
fprintf( stderr,
"void newtonPolygon::copy_new( int k ): k < 0 ...\n" );
#endif
#endif
HALT();
}
}
k
int k
Definition cfEzgcd.cc:99
HALT
static void HALT(void)
Definition mod2.h:126

## copy_shallow()

void newtonPolygon::copy_shallow | ( | newtonPolygon & | np | ) |

inline

Definition at line 154 of file npolygon.h.

{
l = np.l;
N = np.N;
}

## copy_zero()

void newtonPolygon::copy_zero | ( | void |  | ) |

inline

Definition at line 144 of file npolygon.h.

{
l = (linearForm*)NULL;
N = 0;
}

## operator=()

newtonPolygon & newtonPolygon::operator= | ( | const newtonPolygon & | np | ) |

Definition at line 385 of file npolygon.cc.

{
copy_delete( );
copy_deep( np );
return *this;
}

## weight()

Rational newtonPolygon::weight | ( | poly | m,
|  | const ring | r ) const

Definition at line 564 of file npolygon.cc.

{
Rational ret = l[0].weight( m,r );
Rational tmp;
for( int i=1; i<N; i++ )
{
tmp = l[i].weight( m,r );
if( tmp < ret )
{
ret = tmp;
}
}
return ret;
}

## weight1()

Rational newtonPolygon::weight1 | ( | poly | m,
|  | const ring | r ) const

Definition at line 606 of file npolygon.cc.

{
Rational ret = l[0].weight1( m, r );
Rational tmp;
for( int i=1; i<N; i++ )
{
tmp = l[i].weight1( m, r );
if( tmp < ret )
{
ret = tmp;
}
}
return ret;
}

## weight_shift()

Rational newtonPolygon::weight_shift | ( | poly | m,
|  | const ring | r ) const

Definition at line 585 of file npolygon.cc.

{
Rational ret = l[0].weight_shift( m, r );
Rational tmp;
for( int i=1; i<N; i++ )
{
tmp = l[i].weight_shift( m, r );
if( tmp < ret )
{
ret = tmp;
}
}
return ret;
}

## weight_shift1()

Rational newtonPolygon::weight_shift1 | ( | poly | m,
|  | const ring | r ) const

Definition at line 628 of file npolygon.cc.

{
Rational ret = l[0].weight_shift1( m, r );
Rational tmp;
for( int i=1; i<N; i++ )
{
tmp = l[i].weight_shift1( m, r );
if( tmp < ret )
{
ret = tmp;
}
}
return ret;
}

## Field Documentation

## l

linearForm* newtonPolygon::l

private

Definition at line 66 of file npolygon.h.

## N

int newtonPolygon::N

private

Definition at line 67 of file npolygon.h.

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

- kernel/spectrum/npolygon.h
- kernel/spectrum/npolygon.cc