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

spielwiese
Last change on this file since f224fda was f224fda, checked in by Martin Lee <martinlee84@…>, 11 years ago
chg: added new templates to hold absolute factors Conflicts: factory/canonicalform.h factory/ftmpl_inst.cc
  • Property mode set to 100644
File size: 685 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
17#ifndef NOSTREAMIO
18template <class T>
19void AFactor<T>::print ( OSTREAM& s ) const
20{
21    if ( exp() == 1 )
22        s << "(" << factor(), ", " << minpoly() << ")";
23    else
24        s << "((" << factor() << ")^" << exp() << ", " << minpoly() << ")";
25}
26
27template <class T>
28OSTREAM& operator<< ( OSTREAM & os, const AFactor<T> & f )
29{
30    f.print( os );
31    return os;
32}
33#endif /* NOSTREAMIO */
Note: See TracBrowser for help on using the repository browser.