source: git/factory/libfac/factor/class.h @ 6ce030f

jengelh-datetimespielwiese
Last change on this file since 6ce030f was 6ce030f, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
removal of the $Id$ svn tag from everywhere NOTE: the git SHA1 may be used instead (only on special places) NOTE: the libraries Singular/LIB/*.lib still contain the marker due to our current use of svn
  • Property mode set to 100644
File size: 1.6 KB
Line 
1///////////////////////////////////////////////////////////////////////////////
2// emacs edit mode for this file is -*- C++ -*-
3///////////////////////////////////////////////////////////////////////////////
4#ifndef INCL_CLASS_H
5#define INCL_CLASS_H
6
7// #pragma interface
8
9#ifndef NOSTREAMIO
10#ifdef HAVE_IOSTREAM
11#include <iostream>
12#define OSTREAM std::ostream
13#define ISTREAM std::istream
14#elif defined(HAVE_IOSTREAM_H)
15#include <iostream.h>
16#define OSTREAM ostream
17#define ISTREAM istream
18#endif
19#endif
20
21template <class T>
22class Substitution {
23private:
24    T _factor;
25    T _exp;
26public:
27    Substitution() : _factor(1), _exp(0) {}
28    Substitution( const Substitution<T> & f ) : _factor(f._factor), _exp(f._exp) {}
29    Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {}
30    Substitution( const T & f ) : _factor(f), _exp(1) {}
31    ~Substitution() {}
32    Substitution<T>& operator= ( const Substitution<T>& );
33    Substitution<T>& operator= ( const T& );
34    T factor() const { return _factor; }
35    T exp() const { return _exp; }
36//     T value() const { return power( _factor, _exp ); }
37//     Factor<T>& operator+= ( int i ) { _exp += i; return *this; }
38//     Factor<T>& operator*= ( int i ) { _exp *= i; return *this; }
39//     Substitution<T>& operator*= ( const T & f ) { _factor *= f; _exp *= f; return *this; }
40#ifndef NOSTREAMIO
41    void print ( OSTREAM& ) const;
42    friend OSTREAM& operator<< ( OSTREAM & os, const Substitution<T> & f )
43    {
44        f.print( os );
45        return os;
46    }
47#endif
48};
49template <class T>
50int operator== ( const Substitution<T>&, const Substitution<T>& );
51
52// #ifdef IMPL_CLASS_H
53// #include "class.cc"
54// #endif
55
56#endif /* INCL_CLASS_H */
57
Note: See TracBrowser for help on using the repository browser.