source: git/Singular/semic.h @ 5ca9807

spielwiese
Last change on this file since 5ca9807 was 7885020, checked in by Hans Schönemann <hannes@…>, 25 years ago
* hannes: integrated "spectrum" by Stefan Endrass, inactive by default (Makefile.in claptmpl.cc feResource.cc iparith.cc mod2.h.in tok.h GMPrat.h GMPrat.cc kmatrix.h multicnt.h multicnt.cc npolygon.h npolygon.cc semic.h semic.cc spectrum.h spectrum.cc splist.h splist.cc) git-svn-id: file:///usr/local/Singular/svn/trunk@3423 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.7 KB
Line 
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
15typedef enum
16{
17    OPEN,
18    LEFTOPEN,
19    RIGHTOPEN,
20    CLOSED
21
22} interval_status;
23
24typedef enum
25{
26    semicOK,
27    semicMulNegative,
28
29    semicListTooShort,
30    semicListTooLong,
31
32    semicListFirstElementWrongType,
33    semicListSecondElementWrongType,
34    semicListThirdElementWrongType,
35    semicListFourthElementWrongType,
36    semicListFifthElementWrongType,
37    semicListSixthElementWrongType,
38
39    semicListNNegative,
40    semicListWrongNumberOfNumerators,
41    semicListWrongNumberOfDenominators,
42    semicListWrongNumberOfMultiplicities,
43
44    semicListMuNegative,
45    semicListPgNegative,
46    semicListNumNegative,
47    semicListDenNegative,
48    semicListMulNegative,
49
50    semicListNotSymmetric,
51    semicListNotMonotonous,
52
53    semicListMilnorWrong,
54    semicListPGWrong
55
56} semicState;
57
58class spectrum
59{
60public:
61
62    int         mu;      // milnor number
63    int         pg;      // geometrical genus
64    int         n;       // # of spectrum numbers
65    Rational    *s;      // spectrum numbers
66    int         *w;      // multiplicities
67
68    spectrum( );
69    spectrum( const spectrum& );
70    spectrum( lists );
71
72    ~spectrum( );
73
74    spectrum operator = ( const spectrum& );
75    spectrum operator = ( lists );
76
77    friend spectrum   operator + ( const spectrum&,const spectrum& );
78    friend spectrum   operator * ( int,const spectrum& );
79
80    #ifdef SEMIC_PRINT
81    friend ostream &  operator << ( ostream&,const spectrum& );
82    #endif SEMIC_PRINT
83
84    void    copy_new    ( int );
85    void    copy_delete ( void );
86    void    copy_zero   ( void );
87
88    void    copy_shallow( spectrum& );
89    void    copy_deep   ( const spectrum& );
90    void    copy_deep   ( lists );
91
92    lists   thelist     ( void );
93
94    int     add_subspectrum    ( spectrum&,int );
95    int     next_number        ( Rational* );
96    int     next_interval      ( Rational*,Rational* );
97    int     numbers_in_interval( Rational&,Rational&,interval_status );
98    int     mult_spectrum      ( spectrum& );
99    int     mult_spectrumh     ( spectrum& );
100
101    //    int     set_milnor         ( void );
102    //   int     set_geometric_genus( void );
103};
104
105
106// ----------------------------------------------------------------------------
107//  Initialize with zero
108// ----------------------------------------------------------------------------
109
110inline void spectrum::copy_zero( void )
111{
112    mu = 0;
113    pg = 0;
114    n  = 0;
115    s  = (Rational*)NULL;
116    w  = (int*)NULL;
117}
118
119// ----------------------------------------------------------------------------
120//  Initialize shallow from another spectrum
121// ----------------------------------------------------------------------------
122
123inline void spectrum::copy_shallow( spectrum &spec )
124{
125    mu = spec.mu;
126    pg = spec.pg;
127    n  = spec.n;
128    s  = spec.s;
129    w  = spec.w;
130}
131
132// ----------------------------------------------------------------------------
133//  Zero constructor
134// ----------------------------------------------------------------------------
135
136inline spectrum::spectrum( )
137{
138    copy_zero( );
139}
140
141// ----------------------------------------------------------------------------
142//  semic.h
143//  end of file
144// ----------------------------------------------------------------------------
145#endif
Note: See TracBrowser for help on using the repository browser.