jengelh-datetimespielwiese
Last change
on this file since 18ca94 was
18ca94,
checked in by Martin Lee <martinlee84@…>, 10 years ago
|
chg: more include issue
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[f224fda] | 1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
| 2 | |
---|
| 3 | #ifndef INCL_AFACTOR_H |
---|
| 4 | #define INCL_AFACTOR_H |
---|
| 5 | |
---|
[18ca94] | 6 | // #include <factory/factoryconf.h> |
---|
[f224fda] | 7 | |
---|
| 8 | #ifndef NOSTREAMIO |
---|
| 9 | #ifdef HAVE_IOSTREAM |
---|
| 10 | #include <iostream> |
---|
| 11 | #define OSTREAM std::ostream |
---|
| 12 | #elif defined(HAVE_IOSTREAM_H) |
---|
| 13 | #include <iostream.h> |
---|
| 14 | #define OSTREAM ostream |
---|
| 15 | #endif |
---|
| 16 | #endif /* NOSTREAMIO */ |
---|
| 17 | |
---|
| 18 | template <class T> |
---|
| 19 | class AFactor { |
---|
| 20 | private: |
---|
| 21 | T _factor; |
---|
| 22 | T _minpoly; |
---|
| 23 | int _exp; |
---|
| 24 | public: |
---|
| 25 | AFactor() : _factor(1), _minpoly (1), _exp(0) {} |
---|
| 26 | AFactor( const AFactor<T> & f ) : _factor(f._factor), _minpoly (f._minpoly), _exp(f._exp) {} |
---|
| 27 | AFactor( const T & f, const T & m, int e ) : _factor(f), _minpoly (m), _exp(e) {} |
---|
| 28 | AFactor( const T & f, const T & m ) : _factor(f), _minpoly (m), _exp(1) {} |
---|
| 29 | ~AFactor() {} |
---|
| 30 | AFactor<T>& operator= ( const AFactor<T>& ); |
---|
| 31 | T factor() const { return _factor; } |
---|
| 32 | T minpoly() const { return _minpoly; } |
---|
| 33 | int exp() const { return _exp; } |
---|
| 34 | T value() const { return power( _factor, _exp ); } |
---|
| 35 | #ifndef NOSTREAMIO |
---|
| 36 | void print ( OSTREAM& ) const; |
---|
| 37 | #endif /* NOSTREAMIO */ |
---|
| 38 | }; |
---|
| 39 | |
---|
[102a88e] | 40 | template <class T> int |
---|
| 41 | operator== ( const AFactor<T>&, const AFactor<T>& ); |
---|
| 42 | |
---|
[f224fda] | 43 | #ifndef NOSTREAMIO |
---|
| 44 | template <class T> |
---|
| 45 | OSTREAM& operator<< ( OSTREAM & os, const AFactor<T> & f ); |
---|
| 46 | #endif /* NOSTREAMIO */ |
---|
| 47 | |
---|
| 48 | #endif /* ! INCL_AFACTOR_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.