Loading...
Searching...
No Matches
ftmpl_afactor.cc
Go to the documentation of this file.
/* emacs edit mode for this file is -*- C++ -*- */
#include "factory/templates/ftmpl_afactor.h"
template <class T>
AFactor<T>& AFactor<T>::operator= ( const AFactor<T>& f )
{
if ( this != &f )
{
_minpoly = f._minpoly;
_factor = f._factor;
_exp = f._exp;
}
return *this;
}
template <class T>
int operator== ( const AFactor<T> &f1, const AFactor<T> &f2 )
{
return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor()) && (f1.minpoly() == f2.minpoly()); //minpoly comparison may not be enough but checking the fields they define are equal
}
#ifndef NOSTREAMIO
template <class T>
void AFactor<T>::print ( OSTREAM& s ) const
{
if ( exp() == 1 )
s << "(" << factor() << ", " << minpoly() << ")";
else
s << "((" << factor() << ")^" << exp() << ", " << minpoly() << ")";
}
template <class T>
OSTREAM& operator<< ( OSTREAM & os, const AFactor<T> & f )
{
f.print( os );
return os;
}
#endif /* NOSTREAMIO */
OSTREAM
#define OSTREAM
Definition canonicalform.h:16
f
FILE * f
Definition checklibs.c:9
AFactor
Definition ftmpl_afactor.h:17
AFactor::minpoly
T minpoly() const
Definition ftmpl_afactor.h:30
AFactor::exp
int exp() const
Definition ftmpl_afactor.h:31
AFactor::factor
T factor() const
Definition ftmpl_afactor.h:29
AFactor::_minpoly
T _minpoly
Definition ftmpl_afactor.h:20
AFactor::_exp
int _exp
Definition ftmpl_afactor.h:21
AFactor::AFactor
AFactor()
Definition ftmpl_afactor.h:23
AFactor::_factor
T _factor
Definition ftmpl_afactor.h:19
AFactor::print
void print(OSTREAM &) const
Definition ftmpl_afactor.cc:25
AFactor::operator=
AFactor< T > & operator=(const AFactor< T > &)
Definition ftmpl_afactor.cc:6
s
const CanonicalForm int s
Definition facAbsFact.cc:51
factor
CanonicalForm factor
Definition facAbsFact.cc:97
operator<<
OSTREAM & operator<<(OSTREAM &os, const AFactor< T > &f)
Definition ftmpl_afactor.cc:34
operator==
int operator==(const AFactor< T > &f1, const AFactor< T > &f2)
Definition ftmpl_afactor.cc:18
ftmpl_afactor.h
OSTREAM
#define OSTREAM
Definition ftmpl_afactor.h:9
exp
gmp_float exp(const gmp_float &a)
Definition mpr_complex.cc:349