source: git/factory/templates/ftmpl_afactor.cc @ ffae30

fieker-DuValspielwiese
Last change on this file since ffae30 was c6fd6a, checked in by Martin Lee <martinlee84@…>, 11 years ago
fix: typo
  • Property mode set to 100644
File size: 960 bytes
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2
3#include <factory/templates/ftmpl_afactor.h>
4
5template <class T>
6AFactor<T>& AFactor<T>::operator= ( const AFactor<T>& f )
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>
25void AFactor<T>::print ( OSTREAM& s ) const
26{
27    if ( exp() == 1 )
28        s << "(" << factor() << ", " << minpoly() << ")";
29    else
30        s << "((" << factor() << ")^" << exp() << ", " << minpoly() << ")";
31}
32
33template <class T>
34OSTREAM& operator<< ( OSTREAM & os, const AFactor<T> & f )
35{
36    f.print( os );
37    return os;
38}
39#endif /* NOSTREAMIO */
Note: See TracBrowser for help on using the repository browser.