My Project
Loading...
Searching...
No Matches
ftmpl_afactor.cc
Go to the documentation of this file.
1/* emacs edit mode for this file is -*- C++ -*- */
2
4
5template <class T>
7{
8 if ( this != &f )
9 {
10 _minpoly = f._minpoly;
11 _factor = f._factor;
12 _exp = f._exp;
13 }
14 return *this;
15}
16
17template <class T>
18int operator== ( const AFactor<T> &f1, const AFactor<T> &f2 )
19{
20 return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor()) && (f1.minpoly() == f2.minpoly()); //minpoly comparision may not be enough but checking the fields they define are equal
21}
22
23#ifndef NOSTREAMIO
24template <class T>
26{
27 if ( exp() == 1 )
28 s << "(" << factor() << ", " << minpoly() << ")";
29 else
30 s << "((" << factor() << ")^" << exp() << ", " << minpoly() << ")";
31}
32
33template <class T>
35{
36 f.print( os );
37 return os;
38}
39#endif /* NOSTREAMIO */
#define OSTREAM
Definition: canonicalform.h:16
FILE * f
Definition: checklibs.c:9
T minpoly() const
Definition: ftmpl_afactor.h:30
int exp() const
Definition: ftmpl_afactor.h:31
T factor() const
Definition: ftmpl_afactor.h:29
void print(OSTREAM &) const
AFactor< T > & operator=(const AFactor< T > &)
Definition: ftmpl_afactor.cc:6
const CanonicalForm int s
Definition: facAbsFact.cc:51
CanonicalForm factor
Definition: facAbsFact.cc:97
OSTREAM & operator<<(OSTREAM &os, const AFactor< T > &f)
int operator==(const AFactor< T > &f1, const AFactor< T > &f2)
gmp_float exp(const gmp_float &a)
Definition: mpr_complex.cc:357