#include <semic.h>
Definition at line 63 of file semic.h.
◆ spectrum() [1/2]
Zero constructor.
Definition at line 77 of file semic.h.
78 {
80 }
void copy_zero(void)
Initialize with zero.
◆ spectrum() [2/2]
Definition at line 36 of file semic.cc.
37{
39}
void copy_deep(const spectrum &)
◆ ~spectrum()
Definition at line 45 of file semic.cc.
46{
48}
void copy_delete(void)
Delete the memory of a spectrum.
◆ add_subspectrum()
int spectrum::add_subspectrum |
( |
spectrum & |
a, |
|
|
int |
k |
|
) |
| |
Definition at line 279 of file semic.cc.
280{
282 for(
i=0,
j=0;
i<
n;
i++ )
283 {
285 {
288 }
289 }
290
292}
◆ copy_deep()
Definition at line 103 of file semic.cc.
104{
108
110
111 for(
int i=0;
i<
n;
i++ )
112 {
115 }
116}
◆ copy_delete()
void spectrum::copy_delete |
( |
void |
| ) |
|
|
inline |
Delete the memory of a spectrum.
Definition at line 100 of file semic.h.
101{
103 if(
w != (
int*)
NULL &&
n > 0 )
delete []
w;
105}
◆ copy_new()
void spectrum::copy_new |
( |
int |
k | ) |
|
Definition at line 54 of file semic.cc.
55{
57 {
60
61 #ifndef SING_NDEBUG
63 {
64 #ifdef SEMIC_PRINT
65 #ifdef SEMIC_IOSTREAM
66 cerr <<
"spectrum::copy_new(" <<
k <<
")" << endl;
67 cerr << " returned ZERO!!!" << endl;
68 cerr << " exit..." << endl;
69 #else
70 fprintf( stderr,
"spectrum::copy_new( %d )\n",
k );
71 fprintf( stderr," returned ZERO!!!\n" );
72 fprintf( stderr," exit...\n" );
73 #endif
74 #endif
75 }
76 #endif
77 }
79 {
82 }
84 {
85 #ifdef SEMIC_PRINT
86 #ifdef SEMIC_IOSTREAM
87 cerr <<
"spectrum::copy_new(" <<
k <<
")";
88 cerr << ": k < 0 ..." << endl;
89 #else
90 fprintf( stderr,
"spectrum::copy_new( %d )",
k );
91 fprintf( stderr,": k < 0 ...\n" );
92 #endif
93 #endif
94
95 exit( 1 );
96 }
97}
◆ copy_shallow()
void spectrum::copy_shallow |
( |
spectrum & |
spec | ) |
|
|
inline |
Initialize shallow from another spectrum.
Definition at line 118 of file semic.h.
◆ copy_zero()
void spectrum::copy_zero |
( |
void |
| ) |
|
|
inline |
Initialize with zero.
Definition at line 108 of file semic.h.
◆ mult_spectrum()
int spectrum::mult_spectrum |
( |
spectrum & |
t | ) |
|
Definition at line 396 of file semic.cc.
397{
399
402
404
406 {
409
410 if( nt != 0 )
411 {
413 }
414
415 }
416
418}
int next_interval(Rational *, Rational *)
int numbers_in_interval(Rational &, Rational &, interval_status)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
◆ mult_spectrumh()
int spectrum::mult_spectrumh |
( |
spectrum & |
t | ) |
|
Definition at line 425 of file semic.cc.
426{
428
431
433
435 {
438
439 if( nt != 0 )
440 {
442 }
443
446
447 if( nt != 0 )
448 {
450 }
451 }
452
454}
◆ next_interval()
Definition at line 325 of file semic.cc.
326{
331
334
335 if( e1 || e2 )
336 {
339
340 if( d1 < d2 || d2 == zero )
341 {
342 *alpha1 = a1;
343 *alpha2 = a1 + d;
344 }
345 else
346 {
347 *alpha1 = a2 - d;
348 *alpha2 = a2;
349 }
351 }
352 else
353 {
355 }
356}
int next_number(Rational *)
◆ next_number()
int spectrum::next_number |
( |
Rational * |
alpha | ) |
|
Definition at line 300 of file semic.cc.
301{
303
304 while( i < n && *alpha >=
s[
i] )
305 {
307 }
308
310 {
313 }
314 else
315 {
317 }
318}
◆ numbers_in_interval()
Definition at line 362 of file semic.cc.
364{
366
367 for(
int i=0;
i<
n;
i++ )
368 {
373 {
378 {
380 }
381 else
382 {
383 break;
384 }
385 }
386 }
387
389}
int status int void size_t count
◆ operator=()
Definition at line 122 of file semic.cc.
123{
126
127 return *this;
128}
◆ operator*
Definition at line 219 of file semic.cc.
220{
222 {
224
226 }
227 else
228 {
230
233
235 {
237 }
238
240 }
241}
◆ operator+
Definition at line 134 of file semic.cc.
135{
136 int i1=0, i2=0, i3=0;
137
139
140 do
141 {
143 {
144 i2++;
145 }
146 else if( i2 >= s2.
n )
147 {
148 i1++;
149 }
150 else if( s1.
s[i1] < s2.
s[i2] )
151 {
152 i1++;
153 }
154 else if( s1.
s[i1] == s2.
s[i2] )
155 {
156 i1++;
157 i2++;
158 }
159 else
160 {
161 i2++;
162 }
163 i3++;
164 }
165 while( i1 < s1.
n || i2 < s2.
n );
166
169
170 i1 = i2 = i3 = 0;
171
172 do
173 {
175 {
178 i2++;
179 }
180 else if( i2 >= s2.
n )
181 {
184 i1++;
185 }
186 else if( s1.
s[i1] < s2.
s[i2] )
187 {
190 i1++;
191 }
192 else if( s1.
s[i1] == s2.
s[i2] )
193 {
196 i1++;
197 i2++;
198 }
199 else
200 {
203 i2++;
204 }
205 i3++;
206 }
207 while( i1 < s1.
n || i2 < s2.
n );
208
211
213}
◆ operator<<
Definition at line 249 of file semic.cc.
250{
251 for(
int i=0;
i<spec.
n;
i++ )
252 {
254 {
255 #ifdef SEMIC_STDOUT
257 #else
258 fprintf( stdout,"+" );
259 #endif
260 }
261
262 #ifdef SEMIC_STDOUT
263 s << spec.
w[
i] <<
"*t^";
264 #else
265 fprintf( stdout,
"%d*t^",spec.
w[
i] );
266 #endif
267
269 }
270
272}
◆ mu
◆ pg
The documentation for this class was generated from the following files: