[35aab3] | 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 | |
---|
[599326] | 15 | #include <kernel/GMPrat.h> |
---|
[35aab3] | 16 | |
---|
| 17 | typedef enum |
---|
| 18 | { |
---|
| 19 | OPEN, |
---|
| 20 | LEFTOPEN, |
---|
| 21 | RIGHTOPEN, |
---|
| 22 | CLOSED |
---|
| 23 | |
---|
| 24 | } interval_status; |
---|
| 25 | |
---|
| 26 | typedef enum |
---|
| 27 | { |
---|
| 28 | semicOK, |
---|
| 29 | semicMulNegative, |
---|
| 30 | |
---|
| 31 | semicListTooShort, |
---|
| 32 | semicListTooLong, |
---|
| 33 | |
---|
| 34 | semicListFirstElementWrongType, |
---|
| 35 | semicListSecondElementWrongType, |
---|
| 36 | semicListThirdElementWrongType, |
---|
| 37 | semicListFourthElementWrongType, |
---|
| 38 | semicListFifthElementWrongType, |
---|
| 39 | semicListSixthElementWrongType, |
---|
| 40 | |
---|
| 41 | semicListNNegative, |
---|
| 42 | semicListWrongNumberOfNumerators, |
---|
| 43 | semicListWrongNumberOfDenominators, |
---|
| 44 | semicListWrongNumberOfMultiplicities, |
---|
| 45 | |
---|
| 46 | semicListMuNegative, |
---|
| 47 | semicListPgNegative, |
---|
| 48 | semicListNumNegative, |
---|
| 49 | semicListDenNegative, |
---|
| 50 | semicListMulNegative, |
---|
| 51 | |
---|
| 52 | semicListNotSymmetric, |
---|
| 53 | semicListNotMonotonous, |
---|
| 54 | |
---|
| 55 | semicListMilnorWrong, |
---|
| 56 | semicListPGWrong |
---|
| 57 | |
---|
| 58 | } semicState; |
---|
| 59 | |
---|
| 60 | class spectrum |
---|
| 61 | { |
---|
| 62 | public: |
---|
| 63 | |
---|
| 64 | int mu; // milnor number |
---|
| 65 | int pg; // geometrical genus |
---|
| 66 | int n; // # of spectrum numbers |
---|
| 67 | Rational *s; // spectrum numbers |
---|
| 68 | int *w; // multiplicities |
---|
| 69 | |
---|
| 70 | spectrum( ); |
---|
| 71 | spectrum( const spectrum& ); |
---|
| 72 | spectrum( lists ); |
---|
| 73 | |
---|
| 74 | ~spectrum( ); |
---|
| 75 | |
---|
| 76 | spectrum operator = ( const spectrum& ); |
---|
| 77 | spectrum operator = ( lists ); |
---|
| 78 | |
---|
| 79 | friend spectrum operator + ( const spectrum&,const spectrum& ); |
---|
| 80 | friend spectrum operator * ( int,const spectrum& ); |
---|
| 81 | |
---|
| 82 | #ifdef SEMIC_PRINT |
---|
| 83 | friend ostream & operator << ( ostream&,const spectrum& ); |
---|
[91f1a3] | 84 | #endif /*SEMIC_PRINT*/ |
---|
[35aab3] | 85 | |
---|
| 86 | void copy_new ( int ); |
---|
| 87 | void copy_delete ( void ); |
---|
| 88 | void copy_zero ( void ); |
---|
| 89 | |
---|
| 90 | void copy_shallow( spectrum& ); |
---|
| 91 | void copy_deep ( const spectrum& ); |
---|
| 92 | void copy_deep ( lists ); |
---|
| 93 | |
---|
| 94 | lists thelist ( void ); |
---|
| 95 | |
---|
| 96 | int add_subspectrum ( spectrum&,int ); |
---|
| 97 | int next_number ( Rational* ); |
---|
| 98 | int next_interval ( Rational*,Rational* ); |
---|
| 99 | int numbers_in_interval( Rational&,Rational&,interval_status ); |
---|
| 100 | int mult_spectrum ( spectrum& ); |
---|
| 101 | int mult_spectrumh ( spectrum& ); |
---|
| 102 | |
---|
| 103 | // int set_milnor ( void ); |
---|
| 104 | // int set_geometric_genus( void ); |
---|
| 105 | }; |
---|
| 106 | |
---|
| 107 | |
---|
| 108 | // ---------------------------------------------------------------------------- |
---|
| 109 | // Initialize with zero |
---|
| 110 | // ---------------------------------------------------------------------------- |
---|
| 111 | |
---|
| 112 | inline void spectrum::copy_zero( void ) |
---|
| 113 | { |
---|
| 114 | mu = 0; |
---|
| 115 | pg = 0; |
---|
| 116 | n = 0; |
---|
| 117 | s = (Rational*)NULL; |
---|
| 118 | w = (int*)NULL; |
---|
| 119 | } |
---|
| 120 | |
---|
| 121 | // ---------------------------------------------------------------------------- |
---|
| 122 | // Initialize shallow from another spectrum |
---|
| 123 | // ---------------------------------------------------------------------------- |
---|
| 124 | |
---|
| 125 | inline void spectrum::copy_shallow( spectrum &spec ) |
---|
| 126 | { |
---|
| 127 | mu = spec.mu; |
---|
| 128 | pg = spec.pg; |
---|
| 129 | n = spec.n; |
---|
| 130 | s = spec.s; |
---|
| 131 | w = spec.w; |
---|
| 132 | } |
---|
| 133 | |
---|
| 134 | // ---------------------------------------------------------------------------- |
---|
| 135 | // Zero constructor |
---|
| 136 | // ---------------------------------------------------------------------------- |
---|
| 137 | |
---|
| 138 | inline spectrum::spectrum( ) |
---|
| 139 | { |
---|
| 140 | copy_zero( ); |
---|
| 141 | } |
---|
| 142 | |
---|
| 143 | // ---------------------------------------------------------------------------- |
---|
| 144 | // semic.h |
---|
| 145 | // end of file |
---|
| 146 | // ---------------------------------------------------------------------------- |
---|
| 147 | #endif |
---|