spielwiese
Release-4-3-2p1
Last change
on this file was
fb1675,
checked in by Hans Schoenemann <hannes@…>, 6 years ago
|
use include ".." for singular related .h, p8
|
-
Property mode set to
100644
|
File size:
1.2 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 | |
---|
| 6 | #ifndef NOSTREAMIO |
---|
| 7 | #ifdef HAVE_IOSTREAM |
---|
| 8 | #include <iostream> |
---|
| 9 | #define OSTREAM std::ostream |
---|
| 10 | #elif defined(HAVE_IOSTREAM_H) |
---|
| 11 | #include <iostream.h> |
---|
| 12 | #define OSTREAM ostream |
---|
| 13 | #endif |
---|
| 14 | #endif /* NOSTREAMIO */ |
---|
| 15 | |
---|
| 16 | template <class T> |
---|
| 17 | class AFactor { |
---|
| 18 | private: |
---|
| 19 | T _factor; |
---|
| 20 | T _minpoly; |
---|
| 21 | int _exp; |
---|
| 22 | public: |
---|
| 23 | AFactor() : _factor(1), _minpoly (1), _exp(0) {} |
---|
| 24 | AFactor( const AFactor<T> & f ) : _factor(f._factor), _minpoly (f._minpoly), _exp(f._exp) {} |
---|
| 25 | AFactor( const T & f, const T & m, int e ) : _factor(f), _minpoly (m), _exp(e) {} |
---|
| 26 | AFactor( const T & f, const T & m ) : _factor(f), _minpoly (m), _exp(1) {} |
---|
| 27 | ~AFactor() {} |
---|
| 28 | AFactor<T>& operator= ( const AFactor<T>& ); |
---|
| 29 | T factor() const { return _factor; } |
---|
| 30 | T minpoly() const { return _minpoly; } |
---|
| 31 | int exp() const { return _exp; } |
---|
| 32 | T value() const { return power( _factor, _exp ); } |
---|
| 33 | #ifndef NOSTREAMIO |
---|
| 34 | void print ( OSTREAM& ) const; |
---|
| 35 | #endif /* NOSTREAMIO */ |
---|
| 36 | }; |
---|
| 37 | |
---|
[102a88e] | 38 | template <class T> int |
---|
| 39 | operator== ( const AFactor<T>&, const AFactor<T>& ); |
---|
| 40 | |
---|
[f224fda] | 41 | #ifndef NOSTREAMIO |
---|
| 42 | template <class T> |
---|
| 43 | OSTREAM& operator<< ( OSTREAM & os, const AFactor<T> & f ); |
---|
| 44 | #endif /* NOSTREAMIO */ |
---|
| 45 | |
---|
| 46 | #endif /* ! INCL_AFACTOR_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.