Loading...
Searching...
No Matches
semic.h
Go to the documentation of this file.
// ----------------------------------------------------------------------------
// semic.h
// begin of file
// Stephan Endrass, endrass@mathematik.uni-mainz.de
// 23.7.99
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// here we define a class spectrum to test semicontinuity
// ----------------------------------------------------------------------------
#ifndef SEMIC_H
#define SEMIC_H
#ifdef HAVE_SPECTRUM
#include "kernel/spectrum/GMPrat.h"
typedef enum
{
OPEN,
LEFTOPEN,
RIGHTOPEN,
CLOSED
} interval_status;
/*typedef enum
{
semicOK,
semicMulNegative,
semicListTooShort,
semicListTooLong,
semicListFirstElementWrongType,
semicListSecondElementWrongType,
semicListThirdElementWrongType,
semicListFourthElementWrongType,
semicListFifthElementWrongType,
semicListSixthElementWrongType,
semicListNNegative,
semicListWrongNumberOfNumerators,
semicListWrongNumberOfDenominators,
semicListWrongNumberOfMultiplicities,
semicListMuNegative,
semicListPgNegative,
semicListNumNegative,
semicListDenNegative,
semicListMulNegative,
semicListNotSymmetric,
semicListNotMonotonous,
semicListMilnorWrong,
semicListPGWrong
} semicState; */ //TODO move to Singular
class spectrum
{
public:
int mu; // milnor number
int pg; // geometrical genus
int n; // # of spectrum numbers
Rational *s; // spectrum numbers
int *w; // multiplicities
// spectrum( );
// spectrum( lists );
/// Zero constructor
spectrum( )
{
copy_zero( );
}
spectrum( const spectrum& );
~spectrum( );
spectrum operator = ( const spectrum& );
// spectrum operator = ( lists );
friend spectrum operator + ( const spectrum&,const spectrum& );
friend spectrum operator * ( int,const spectrum& );
#ifdef SEMIC_PRINT
friend ostream & operator << ( ostream&,const spectrum& );
#endif /*SEMIC_PRINT*/
void copy_new ( int );
// void copy_delete ( void );
/// Delete the memory of a spectrum
inline void copy_delete( void )
{
if( s != (Rational*)NULL && n > 0 ) delete [] s;
if( w != (int*)NULL && n > 0 ) delete [] w;
copy_zero( );
}
/// Initialize with zero
inline void copy_zero( void )
{
mu = 0;
pg = 0;
n = 0;
s = (Rational*)NULL;
w = (int*)NULL;
}
/// Initialize shallow from another spectrum
inline void copy_shallow( spectrum &spec )
{
mu = spec.mu;
pg = spec.pg;
n = spec.n;
s = spec.s;
w = spec.w;
}
void copy_deep ( const spectrum& );
// void copy_deep ( lists );
// lists thelist ( void );
int add_subspectrum ( spectrum&,int );
int next_number ( Rational* );
int next_interval ( Rational*,Rational* );
int numbers_in_interval( Rational&,Rational&,interval_status );
int mult_spectrum ( spectrum& );
int mult_spectrumh ( spectrum& );
// int set_milnor ( void );
// int set_geometric_genus( void );
};
#endif /*HAVE_SPECTRUM*/
// ----------------------------------------------------------------------------
// semic.h
// end of file
// ----------------------------------------------------------------------------
#endif
GMPrat.h
Rational
Definition GMPrat.h:15
spectrum
Definition semic.h:64
spectrum::mu
int mu
Definition semic.h:67
spectrum::spectrum
spectrum()
Zero constructor.
Definition semic.h:77
spectrum::copy_deep
void copy_deep(const spectrum &)
Definition semic.cc:103
spectrum::copy_new
void copy_new(int)
Definition semic.cc:54
spectrum::operator=
spectrum operator=(const spectrum &)
Definition semic.cc:122
spectrum::s
Rational * s
Definition semic.h:70
spectrum::add_subspectrum
int add_subspectrum(spectrum &, int)
Definition semic.cc:279
spectrum::copy_shallow
void copy_shallow(spectrum &spec)
Initialize shallow from another spectrum.
Definition semic.h:118
spectrum::~spectrum
~spectrum()
Definition semic.cc:45
spectrum::mult_spectrum
int mult_spectrum(spectrum &)
Definition semic.cc:396
spectrum::n
int n
Definition semic.h:69
spectrum::pg
int pg
Definition semic.h:68
spectrum::next_number
int next_number(Rational *)
Definition semic.cc:300
spectrum::mult_spectrumh
int mult_spectrumh(spectrum &)
Definition semic.cc:425
spectrum::copy_delete
void copy_delete(void)
Delete the memory of a spectrum.
Definition semic.h:100
spectrum::next_interval
int next_interval(Rational *, Rational *)
Definition semic.cc:325
spectrum::operator*
friend spectrum operator*(int, const spectrum &)
Definition semic.cc:219
spectrum::w
int * w
Definition semic.h:71
spectrum::operator<<
friend ostream & operator<<(ostream &, const spectrum &)
Definition semic.cc:249
spectrum::operator+
friend spectrum operator+(const spectrum &, const spectrum &)
Definition semic.cc:134
spectrum::copy_zero
void copy_zero(void)
Initialize with zero.
Definition semic.h:108
spectrum::numbers_in_interval
int numbers_in_interval(Rational &, Rational &, interval_status)
Definition semic.cc:362
NULL
#define NULL
Definition omList.c:12
interval_status
interval_status
Definition semic.h:21
OPEN
@ OPEN
Definition semic.h:22
RIGHTOPEN
@ RIGHTOPEN
Definition semic.h:24
CLOSED
@ CLOSED
Definition semic.h:25
LEFTOPEN
@ LEFTOPEN
Definition semic.h:23