source: git/factory/templates/ftmpl_factor.cc @ b1dfaf

spielwiese
Last change on this file since b1dfaf was b1dfaf, checked in by Frank Seelisch <seelisch@…>, 14 years ago
patch from Kai (checked for problems under Windows OS: no problems) git-svn-id: file:///usr/local/Singular/svn/trunk@13210 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 857 bytes
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id$ */
3
4#include <factory/templates/ftmpl_factor.h>
5
6template <class T>
7Factor<T>& Factor<T>::operator= ( const Factor<T>& f )
8{
9    if ( this != &f ) {
10        _factor = f._factor;
11        _exp = f._exp;
12    }
13    return *this;
14}
15
16template <class T>
17Factor<T>& Factor<T>::operator= ( const T & f )
18{
19    _factor = f;
20    _exp = 1;
21    return *this;
22}
23
24template <class T>
25int operator== ( const Factor<T> &f1, const Factor<T> &f2 )
26{
27    return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor());
28}
29
30#ifndef NOSTREAMIO
31template <class T>
32void Factor<T>::print ( OSTREAM& s ) const
33{
34    if ( exp() == 1 )
35        s << factor();
36    else
37        s << "(" << factor() << ")^" << exp();
38}
39
40template <class T>
41OSTREAM& operator<< ( OSTREAM & os, const Factor<T> & f )
42{
43    f.print( os );
44    return os;
45}
46#endif /* NOSTREAMIO */
Note: See TracBrowser for help on using the repository browser.