ftmpl_afactor.h
Go to the documentation of this file.
1 /* emacs edit mode for this file is -*- C++ -*- */
2 
3 #ifndef INCL_AFACTOR_H
4 #define INCL_AFACTOR_H
5 
6 // #include <factory/factoryconf.h>
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:
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 
40 template <class T> int
41 operator== ( const AFactor<T>&, const AFactor<T>& );
42 
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 */
T value() const
Definition: ftmpl_afactor.h:34
CanonicalForm power(const CanonicalForm &f, int n)
exponentiation
AFactor(const T &f, const T &m, int e)
Definition: ftmpl_afactor.h:27
int exp() const
Definition: ftmpl_afactor.h:33
AFactor(const AFactor< T > &f)
Definition: ftmpl_afactor.h:26
f
Definition: cfModGcd.cc:4022
int operator==(const AFactor< T > &, const AFactor< T > &)
#define OSTREAM
Definition: ftmpl_afactor.h:11
AFactor(const T &f, const T &m)
Definition: ftmpl_afactor.h:28
int m
Definition: cfEzgcd.cc:119
T factor() const
Definition: ftmpl_afactor.h:31
void print(OSTREAM &) const
T minpoly() const
Definition: ftmpl_afactor.h:32
static jList * T
Definition: janet.cc:37
AFactor< T > & operator=(const AFactor< T > &)
Definition: ftmpl_afactor.cc:6