Loading...
Searching...
No Matches
linearForm Class Reference

`#include <npolygon.h>`

## Public Member Functions

| linearForm ()
| linearForm (const linearForm &)
| ~linearForm ()
linearForm & | operator= (const linearForm &)
void | copy_new (int)
void | copy_delete (void)
void | copy_zero (void)
void | copy_shallow (linearForm &)
void | copy_deep (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
Rational | pweight (poly, const ring r) const
int | positive (void)

## Private Attributes

Rational * | c
int | N

## Friends

class | newtonPolygon
int | operator== (const linearForm &l1, const linearForm &l2)

## Detailed Description

Definition at line 17 of file npolygon.h.

## Constructor & Destructor Documentation

## linearForm() [1/2]

linearForm::linearForm | ( |  | ) |

inline

Definition at line 130 of file npolygon.h.

{
copy_zero( );
}
linearForm::copy_zero
void copy_zero(void)
Definition npolygon.h:109

## linearForm() [2/2]

linearForm::linearForm | ( | const linearForm & | l | ) |

Definition at line 107 of file npolygon.cc.

{
copy_deep( l );
}
l
int l
Definition cfEzgcd.cc:100
linearForm::copy_deep
void copy_deep(const linearForm &)
Definition npolygon.cc:93

## ~linearForm()

linearForm::~linearForm | ( |  | ) |

Definition at line 116 of file npolygon.cc.

{
copy_delete( );
}
linearForm::copy_delete
void copy_delete(void)
Definition npolygon.cc:82

## Member Function Documentation

## copy_deep()

void linearForm::copy_deep | ( | const linearForm & | l | ) |

Definition at line 93 of file npolygon.cc.

{
copy_new( l.N );
for( int i=l.N-1; i>=0; i-- )
{
c[i] = l.c[i];
}
N = l.N;
}
i
int i
Definition cfEzgcd.cc:132
linearForm::copy_new
void copy_new(int)
Definition npolygon.cc:36
linearForm::c
Rational * c
Definition npolygon.h:22
linearForm::N
int N
Definition npolygon.h:23

## copy_delete()

void linearForm::copy_delete | ( | void |  | ) |

Definition at line 82 of file npolygon.cc.

{
if( c != (Rational*)NULL && N > 0 )
delete [] c;
copy_zero( );
}
NULL
#define NULL
Definition omList.c:12

## copy_new()

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

Definition at line 36 of file npolygon.cc.

{
if( k > 0 )
{
c = new Rational[k];
#ifndef NBDEBUG
if( c == (Rational*)NULL )
{
#ifdef NPOLYGON_PRINT
#ifdef NPOLYGON_IOSTREAM
cerr <<
"void linearForm::copy_new( int k ): no memory left ...\n" ;
#else
fprintf( stderr,
"void linearForm::copy_new( int k ): no memory left ...\n");
#endif
#endif
HALT();
}
#endif
}
else if( k == 0 )
{
c = (Rational*)NULL;
}
else if( k < 0 )
{
#ifdef NPOLYGON_PRINT
#ifdef NPOLYGON_IOSTREAM
cerr <<
"void linearForm::copy_new( int k ): k < 0 ...\n";
#else
fprintf( stderr,
"void linearForm::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 linearForm::copy_shallow | ( | linearForm & | l | ) |

inline

Definition at line 119 of file npolygon.h.

{
c = l.c;
N = l.N;
}

## copy_zero()

void linearForm::copy_zero | ( | void |  | ) |

inline

Definition at line 109 of file npolygon.h.

{
c = (Rational*)NULL;
N = 0;
}

## operator=()

linearForm & linearForm::operator= | ( | const linearForm & | l | ) |

Definition at line 125 of file npolygon.cc.

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

## positive()

int linearForm::positive | ( | void |  | ) |

Definition at line 279 of file npolygon.cc.

{
for( int i=0; i<N; i++ )
{
if( c[i] <= (Rational)0 )
{
return FALSE;
}
}
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97

## pweight()

Rational linearForm::pweight | ( | poly | m,
|  | const ring | r ) const

Definition at line 205 of file npolygon.cc.

{
if( m==(poly)NULL )
return (Rational)0;
Rational ret = weight( m, r );
Rational tmp;
for( m=pNext(m); m!=(poly)NULL; pIter(m) )
{
tmp = weight( m, r );
if( tmp<ret )
{
ret = tmp;
}
}
return ret;
}
m
int m
Definition cfEzgcd.cc:128
linearForm::weight
Rational weight(poly, const ring r) const
Definition npolygon.cc:189
pIter
#define pIter(p)
Definition monomials.h:37
pNext
#define pNext(p)
Definition monomials.h:36

## weight()

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

Definition at line 189 of file npolygon.cc.

{
Rational ret=(Rational)0;
for( int i=0,j=1; i<N; i++,j++ )
{
ret += c[i]*(Rational)p_GetExp( m,j,r );
}
return ret;
}
j
int j
Definition facHensel.cc:110
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

## weight1()

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

Definition at line 245 of file npolygon.cc.

{
Rational ret=(Rational)0;
for( int i=0,j=2; i<N; i++,j++ )
{
ret += c[i]*(Rational)p_GetExp( m,j,r );
}
return ret;
}

## weight_shift()

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

Definition at line 229 of file npolygon.cc.

{
Rational ret=(Rational)0;
for( int i=0,j=1; i<N; i++,j++ )
{
ret += c[i]*(Rational)( p_GetExp( m,j,r ) + 1 );
}
return ret;
}

## weight_shift1()

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

Definition at line 262 of file npolygon.cc.

{
Rational ret=(Rational)0;
for( int i=0,j=2; i<N; i++,j++ )
{
ret += c[i]*(Rational)( p_GetExp( m,j,r ) + 1 );
}
return ret;
}

## Friends And Related Symbol Documentation

## newtonPolygon

friend class newtonPolygon

friend

Definition at line 54 of file npolygon.h.

## operator==

int operator== | ( | const linearForm & | l1,
|  | const linearForm & | l2 )

friend

Definition at line 172 of file npolygon.cc.

{
if( l1.N!=l2.N )
return FALSE;
for( int i=l1.N-1; i >=0 ; i-- )
{
if( l1.c[i]!=l2.c[i] )
return FALSE;
}
return TRUE;
}

## Field Documentation

## c

Rational* linearForm::c

private

Definition at line 22 of file npolygon.h.

## N

int linearForm::N

private

Definition at line 23 of file npolygon.h.

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

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