Loading...
Searching...
No Matches
npolygon.h
Go to the documentation of this file.
// ----------------------------------------------------------------------------
// npolygon.h
// begin of file
// Stephan Endrass, endrass@mathematik.uni-mainz.de
// 23.7.99
// ----------------------------------------------------------------------------
#ifndef NPOLYGON_H
#define NPOLYGON_H
#include "kernel/spectrum/GMPrat.h"
// ----------------------------------------------------------------------------
// Class representing a linear form QQ^N-->QQ
// ----------------------------------------------------------------------------
class linearForm
{
private:
Rational *c; // the coefficients
int N; // number of coefficients
public:
linearForm( );
linearForm( const linearForm& );
~linearForm( );
linearForm & operator = ( const linearForm& );
friend int operator == ( const linearForm&,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 );
#ifdef NPOLYGON_PRINT
friend ostream & operator << ( ostream&,const linearForm& );
#endif
friend class newtonPolygon;
};
// ----------------------------------------------------------------------------
// Class representing a Newton polygon
// ----------------------------------------------------------------------------
class newtonPolygon
{
private:
linearForm *l; // the linear forms
int N; // number of linear forms
public:
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;
//int is_sqh ( void ) const;
//Rational* sqh_weights( void ) const;
//int sqh_N ( void ) const;
#ifdef NPOLYGON_PRINT
friend ostream & operator << ( ostream&,const newtonPolygon& );
#endif
};
// ---------------------------------------
// inline functions for class linearForm
// ---------------------------------------
// ----------------------------------------------------------------------------
// Initialize with zero
// ----------------------------------------------------------------------------
inline void linearForm::copy_zero( void )
{
c = (Rational*)NULL;
N = 0;
}
// ----------------------------------------------------------------------------
// Initialize shallow from another linear form
// ----------------------------------------------------------------------------
inline void linearForm::copy_shallow( linearForm &l )
{
c = l.c;
N = l.N;
}
// ----------------------------------------------------------------------------
// Zero constructor
// ----------------------------------------------------------------------------
inline linearForm::linearForm( )
{
copy_zero( );
}
// ------------------------------------------
// inline functions for class newtonPolygon
// ------------------------------------------
// ----------------------------------------------------------------------------
// Initialize with zero
// ----------------------------------------------------------------------------
inline void newtonPolygon::copy_zero( void )
{
l = (linearForm*)NULL;
N = 0;
}
// ----------------------------------------------------------------------------
// Initialize shallow from another Newton polygon
// ----------------------------------------------------------------------------
inline void newtonPolygon::copy_shallow( newtonPolygon &np )
{
l = np.l;
N = np.N;
}
// ----------------------------------------------------------------------------
// Zero constructor
// ----------------------------------------------------------------------------
inline newtonPolygon::newtonPolygon( )
{
copy_zero( );
}
#endif /* NPOLYGON_H */
// ----------------------------------------------------------------------------
// npolygon.h
// end of file
// ----------------------------------------------------------------------------
GMPrat.h
l
int l
Definition cfEzgcd.cc:100
Rational
Definition GMPrat.h:15
linearForm
Definition npolygon.h:18
linearForm::weight_shift
Rational weight_shift(poly, const ring r) const
Definition npolygon.cc:229
linearForm::weight
Rational weight(poly, const ring r) const
Definition npolygon.cc:189
linearForm::copy_zero
void copy_zero(void)
Definition npolygon.h:109
linearForm::linearForm
linearForm()
Definition npolygon.h:130
linearForm::operator==
friend int operator==(const linearForm &, const linearForm &)
Definition npolygon.cc:172
linearForm::weight1
Rational weight1(poly, const ring r) const
Definition npolygon.cc:245
linearForm::copy_new
void copy_new(int)
Definition npolygon.cc:36
linearForm::c
Rational * c
Definition npolygon.h:22
linearForm::weight_shift1
Rational weight_shift1(poly, const ring r) const
Definition npolygon.cc:262
linearForm::N
int N
Definition npolygon.h:23
linearForm::copy_delete
void copy_delete(void)
Definition npolygon.cc:82
linearForm::newtonPolygon
friend class newtonPolygon
Definition npolygon.h:54
linearForm::operator=
linearForm & operator=(const linearForm &)
Definition npolygon.cc:125
linearForm::pweight
Rational pweight(poly, const ring r) const
Definition npolygon.cc:205
linearForm::~linearForm
~linearForm()
Definition npolygon.cc:116
linearForm::positive
int positive(void)
Definition npolygon.cc:279
linearForm::copy_shallow
void copy_shallow(linearForm &)
Definition npolygon.h:119
linearForm::copy_deep
void copy_deep(const linearForm &)
Definition npolygon.cc:93
newtonPolygon::add_linearForm
void add_linearForm(const linearForm &)
Definition npolygon.cc:525
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::weight
Rational weight(poly, const ring r) const
Definition npolygon.cc:564
newtonPolygon::N
int N
Definition npolygon.h:67
newtonPolygon::weight_shift1
Rational weight_shift1(poly, const ring r) const
Definition npolygon.cc:628
newtonPolygon::copy_delete
void copy_delete(void)
Definition npolygon.cc:342
newtonPolygon::operator=
newtonPolygon & operator=(const newtonPolygon &)
Definition npolygon.cc:385
newtonPolygon::l
linearForm * l
Definition npolygon.h:66
newtonPolygon::weight_shift
Rational weight_shift(poly, const ring r) const
Definition npolygon.cc:585
newtonPolygon::copy_zero
void copy_zero(void)
Definition npolygon.h:144
newtonPolygon::~newtonPolygon
~newtonPolygon()
Definition npolygon.cc:376
newtonPolygon::weight1
Rational weight1(poly, const ring r) const
Definition npolygon.cc:606
newtonPolygon::copy_deep
void copy_deep(const newtonPolygon &)
Definition npolygon.cc:353
NULL
#define NULL
Definition omList.c:12
operator<<
ostream & operator<<(ostream &s, const spectrum &spec)
Definition semic.cc:249