My Project
Loading...
Searching...
No Matches
semic.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------------
2// semic.h
3// begin of file
4// Stephan Endrass, endrass@mathematik.uni-mainz.de
5// 23.7.99
6// ----------------------------------------------------------------------------
7
8// ----------------------------------------------------------------------------
9// here we define a class spectrum to test semicontinuity
10// ----------------------------------------------------------------------------
11
12#ifndef SEMIC_H
13#define SEMIC_H
14
15#ifdef HAVE_SPECTRUM
16
17
19
20typedef enum
21{
25 CLOSED
26
28
29/*typedef enum
30{
31 semicOK,
32 semicMulNegative,
33
34 semicListTooShort,
35 semicListTooLong,
36
37 semicListFirstElementWrongType,
38 semicListSecondElementWrongType,
39 semicListThirdElementWrongType,
40 semicListFourthElementWrongType,
41 semicListFifthElementWrongType,
42 semicListSixthElementWrongType,
43
44 semicListNNegative,
45 semicListWrongNumberOfNumerators,
46 semicListWrongNumberOfDenominators,
47 semicListWrongNumberOfMultiplicities,
48
49 semicListMuNegative,
50 semicListPgNegative,
51 semicListNumNegative,
52 semicListDenNegative,
53 semicListMulNegative,
54
55 semicListNotSymmetric,
56 semicListNotMonotonous,
57
58 semicListMilnorWrong,
59 semicListPGWrong
60
61} semicState; */ //TODO move to Singular
62
64{
65public:
66
67 int mu; // milnor number
68 int pg; // geometrical genus
69 int n; // # of spectrum numbers
70 Rational *s; // spectrum numbers
71 int *w; // multiplicities
72
73// spectrum( );
74// spectrum( lists );
75
76 /// Zero constructor
78 {
79 copy_zero( );
80 }
81
82 spectrum( const spectrum& );
83
84 ~spectrum( );
85
87// spectrum operator = ( lists );
88
89 friend spectrum operator + ( const spectrum&,const spectrum& );
90 friend spectrum operator * ( int,const spectrum& );
91
92 #ifdef SEMIC_PRINT
93 friend ostream & operator << ( ostream&,const spectrum& );
94 #endif /*SEMIC_PRINT*/
95
96 void copy_new ( int );
97// void copy_delete ( void );
98
99/// Delete the memory of a spectrum
100inline void copy_delete( void )
101{
102 if( s != (Rational*)NULL && n > 0 ) delete [] s;
103 if( w != (int*)NULL && n > 0 ) delete [] w;
104 copy_zero( );
105}
106
107/// Initialize with zero
108inline void copy_zero( void )
109{
110 mu = 0;
111 pg = 0;
112 n = 0;
113 s = (Rational*)NULL;
114 w = (int*)NULL;
115}
116
117/// Initialize shallow from another spectrum
118inline void copy_shallow( spectrum &spec )
119{
120 mu = spec.mu;
121 pg = spec.pg;
122 n = spec.n;
123 s = spec.s;
124 w = spec.w;
125}
126
127 void copy_deep ( const spectrum& );
128// void copy_deep ( lists );
129
130// lists thelist ( void );
131
132 int add_subspectrum ( spectrum&,int );
133 int next_number ( Rational* );
136 int mult_spectrum ( spectrum& );
137 int mult_spectrumh ( spectrum& );
138
139 // int set_milnor ( void );
140 // int set_geometric_genus( void );
141};
142
143#endif /*HAVE_SPECTRUM*/
144// ----------------------------------------------------------------------------
145// semic.h
146// end of file
147// ----------------------------------------------------------------------------
148#endif
Definition: semic.h:64
int mu
Definition: semic.h:67
friend spectrum operator+(const spectrum &, const spectrum &)
Definition: semic.cc:134
spectrum()
Zero constructor.
Definition: semic.h:77
void copy_deep(const spectrum &)
Definition: semic.cc:103
void copy_new(int)
Definition: semic.cc:54
spectrum operator=(const spectrum &)
Definition: semic.cc:122
Rational * s
Definition: semic.h:70
int add_subspectrum(spectrum &, int)
Definition: semic.cc:279
void copy_shallow(spectrum &spec)
Initialize shallow from another spectrum.
Definition: semic.h:118
~spectrum()
Definition: semic.cc:45
int mult_spectrum(spectrum &)
Definition: semic.cc:396
int n
Definition: semic.h:69
int pg
Definition: semic.h:68
friend ostream & operator<<(ostream &, const spectrum &)
Definition: semic.cc:249
int next_number(Rational *)
Definition: semic.cc:300
int mult_spectrumh(spectrum &)
Definition: semic.cc:425
void copy_delete(void)
Delete the memory of a spectrum.
Definition: semic.h:100
int next_interval(Rational *, Rational *)
Definition: semic.cc:325
int * w
Definition: semic.h:71
void copy_zero(void)
Initialize with zero.
Definition: semic.h:108
int numbers_in_interval(Rational &, Rational &, interval_status)
Definition: semic.cc:362
friend spectrum operator*(int, const spectrum &)
Definition: semic.cc:219
#define NULL
Definition: omList.c:12
interval_status
Definition: semic.h:21
@ OPEN
Definition: semic.h:22
@ RIGHTOPEN
Definition: semic.h:24
@ CLOSED
Definition: semic.h:25
@ LEFTOPEN
Definition: semic.h:23