source: git/kernel/semic.h @ fbc7cb

jengelh-datetimespielwiese
Last change on this file since fbc7cb was a9c298, checked in by Hans Schoenemann <hannes@…>, 9 years ago
format stuff
  • Property mode set to 100644
File size: 3.4 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
15#ifdef HAVE_SPECTRUM
16
17
18#include <kernel/GMPrat.h>
19
20typedef enum
21{
22    OPEN,
23    LEFTOPEN,
24    RIGHTOPEN,
25    CLOSED
26
27} interval_status;
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
63class spectrum
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
77    spectrum( )
78    {
79       copy_zero( );
80    }
81
82    spectrum( const spectrum& );
83
84    ~spectrum( );
85
86    spectrum operator = ( const spectrum& );
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* );
134    int     next_interval      ( Rational*,Rational* );
135    int     numbers_in_interval( Rational&,Rational&,interval_status );
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
Note: See TracBrowser for help on using the repository browser.