My Project  UNKNOWN_GIT_VERSION
ftmpl_afactor.cc
Go to the documentation of this file.
1 /* emacs edit mode for this file is -*- C++ -*- */
2 
4 
5 template <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 
17 template <class T>
18 int 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
24 template <class T>
25 void AFactor<T>::print ( OSTREAM& s ) const
26 {
27  if ( exp() == 1 )
28  s << "(" << factor() << ", " << minpoly() << ")";
29  else
30  s << "((" << factor() << ")^" << exp() << ", " << minpoly() << ")";
31 }
32 
33 template <class T>
35 {
36  f.print( os );
37  return os;
38 }
39 #endif /* NOSTREAMIO */
const CanonicalForm int s
Definition: facAbsFact.cc:55
gmp_float exp(const gmp_float &a)
Definition: mpr_complex.cc:358
T factor() const
Definition: ftmpl_afactor.h:29
int exp() const
Definition: ftmpl_afactor.h:31
int operator==(const AFactor< T > &f1, const AFactor< T > &f2)
T minpoly() const
Definition: ftmpl_afactor.h:30
FILE * f
Definition: checklibs.c:9
CanonicalForm factor
Definition: facAbsFact.cc:101
#define OSTREAM
Definition: canonicalform.h:16
void print(OSTREAM &) const
AFactor< T > & operator=(const AFactor< T > &)
Definition: ftmpl_afactor.cc:6
OSTREAM & operator<<(OSTREAM &os, const AFactor< T > &f)