spielwiese
Last change
on this file since eced154 was
974ce1,
checked in by Jens Schmidt <schmidt@…>, 27 years ago
|
* templates/: all files prefixed with ftmpl_. All #include
statements changed.
git-svn-id: file:///usr/local/Singular/svn/trunk@416 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
932 bytes
|
Line | |
---|
1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
2 | /* $Id: ftmpl_factor.cc,v 1.5 1997-06-20 10:45:21 schmidt Exp $ */ |
---|
3 | |
---|
4 | #include <factoryconf.h> |
---|
5 | |
---|
6 | #include <templates/ftmpl_factor.h> |
---|
7 | |
---|
8 | |
---|
9 | template <class T> |
---|
10 | Factor<T>& Factor<T>::operator= ( const Factor<T>& f ) |
---|
11 | { |
---|
12 | if ( this != &f ) { |
---|
13 | _factor = f._factor; |
---|
14 | _exp = f._exp; |
---|
15 | } |
---|
16 | return *this; |
---|
17 | } |
---|
18 | |
---|
19 | template <class T> |
---|
20 | Factor<T>& Factor<T>::operator= ( const T & f ) |
---|
21 | { |
---|
22 | _factor = f; |
---|
23 | _exp = 1; |
---|
24 | return *this; |
---|
25 | } |
---|
26 | |
---|
27 | template <class T> |
---|
28 | int operator== ( const Factor<T> &f1, const Factor<T> &f2 ) |
---|
29 | { |
---|
30 | return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor()); |
---|
31 | } |
---|
32 | |
---|
33 | #ifndef NOSTREAMIO |
---|
34 | template <class T> |
---|
35 | void Factor<T>::print ( ostream& s ) const |
---|
36 | { |
---|
37 | if ( exp() == 1 ) |
---|
38 | s << factor(); |
---|
39 | else |
---|
40 | s << "(" << factor() << ")^" << exp(); |
---|
41 | } |
---|
42 | |
---|
43 | template <class T> |
---|
44 | ostream& operator<< ( ostream & os, const Factor<T> & f ) |
---|
45 | { |
---|
46 | f.print( os ); |
---|
47 | return os; |
---|
48 | } |
---|
49 | #endif /* NOSTREAMIO */ |
---|
Note: See
TracBrowser
for help on using the repository browser.