18 #ifndef SEMIC_IOSTREAM 66 cerr <<
"spectrum::copy_new(" << k <<
")" << endl;
67 cerr <<
" returned ZERO!!!" << endl;
68 cerr <<
" exit..." << endl;
70 fprintf( stderr,
"spectrum::copy_new( %d )\n",k );
71 fprintf( stderr,
" returned ZERO!!!\n" );
72 fprintf( stderr,
" exit...\n" );
87 cerr <<
"spectrum::copy_new(" << k <<
")";
88 cerr <<
": k < 0 ..." << endl;
90 fprintf( stderr,
"spectrum::copy_new( %d )",k );
91 fprintf( stderr,
": k < 0 ...\n" );
111 for(
int i=0;
i<
n;
i++ )
136 int i1=0, i2=0, i3=0;
146 else if( i2 >= s2.
n )
150 else if( s1.
s[i1] < s2.
s[i2] )
154 else if( s1.
s[i1] == s2.
s[i2] )
165 while( i1 < s1.
n || i2 < s2.
n );
176 result.
s[i3] = s2.
s[i2];
177 result.
w[i3] = s2.
w[i2];
180 else if( i2 >= s2.
n )
182 result.
s[i3] = s1.
s[i1];
183 result.
w[i3] = s1.
w[i1];
186 else if( s1.
s[i1] < s2.
s[i2] )
188 result.
s[i3] = s1.
s[i1];
189 result.
w[i3] = s1.
w[i1];
192 else if( s1.
s[i1] == s2.
s[i2] )
194 result.
s[i3] = s1.
s[i1];
195 result.
w[i3] = s1.
w[i1] + s2.
w[i2];
201 result.
s[i3] = s2.
s[i2];
202 result.
w[i3] = s2.
w[i2];
207 while( i1 < s1.
n || i2 < s2.
n );
209 result.
mu = s1.
mu + s2.
mu;
210 result.
pg = s1.
pg + s2.
pg;
234 for(
int i=0;
i<result.
n;
i++ )
251 for(
int i=0;
i<spec.
n;
i++ )
258 fprintf( stdout,
"+" );
263 s << spec.
w[
i] <<
"*t^";
265 fprintf( stdout,
"%d*t^",spec.
w[
i] );
282 for( i=0, j=0; i<
n; i++ )
304 while( i < n && *alpha >=
s[i] )
340 if( d1 < d2 || d2 == zero )
367 for(
int i=0;
i<
n;
i++ )
412 mult = (nthis/nt < mult ? nthis/nt:
mult );
441 mult = (nthis/nt < mult ? nthis/nt:
mult );
449 mult = (nthis/nt < mult ? nthis/nt:
mult );
int status int void size_t count
spectrum operator=(const spectrum &)
int add_subspectrum(spectrum &, int)
friend ostream & operator<<(ostream &, const spectrum &)
int next_number(Rational *)
void copy_delete(void)
Delete the memory of a spectrum.
spectrum()
Zero constructor.
int mult_spectrumh(spectrum &)
friend spectrum operator*(int, const spectrum &)
friend spectrum operator+(const spectrum &, const spectrum &)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
int numbers_in_interval(Rational &, Rational &, interval_status)
int next_interval(Rational *, Rational *)
int mult_spectrum(spectrum &)
void copy_deep(const spectrum &)