/////////////////////////////////////////////////////////////////////////////// // emacs edit mode for this file is -*- C++ -*- /////////////////////////////////////////////////////////////////////////////// #ifndef INCL_CLASS_H #define INCL_CLASS_H // #pragma interface #ifndef NOSTREAMIO #ifdef HAVE_IOSTREAM #include #define OSTREAM std::ostream #define ISTREAM std::istream #elif defined(HAVE_IOSTREAM_H) #include #define OSTREAM ostream #define ISTREAM istream #endif #endif template class Substitution { private: T _factor; T _exp; public: Substitution() : _factor(1), _exp(0) {} Substitution( const Substitution & f ) : _factor(f._factor), _exp(f._exp) {} Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {} Substitution( const T & f ) : _factor(f), _exp(1) {} ~Substitution() {} Substitution& operator= ( const Substitution& ); Substitution& operator= ( const T& ); T factor() const { return _factor; } T exp() const { return _exp; } // T value() const { return power( _factor, _exp ); } // Factor& operator+= ( int i ) { _exp += i; return *this; } // Factor& operator*= ( int i ) { _exp *= i; return *this; } // Substitution& operator*= ( const T & f ) { _factor *= f; _exp *= f; return *this; } #ifndef NOSTREAMIO void print ( OSTREAM& ) const; friend OSTREAM& operator<< ( OSTREAM & os, const Substitution & f ) { f.print( os ); return os; } #endif }; template int operator== ( const Substitution&, const Substitution& ); // #ifdef IMPL_CLASS_H // #include "class.cc" // #endif #endif /* INCL_CLASS_H */