source: git/libfac/factor/class.h @ 91b36d

spielwiese
Last change on this file since 91b36d was 91b36d, checked in by Hans Schönemann <hannes@…>, 16 years ago
*hannes: licence stuff git-svn-id: file:///usr/local/Singular/svn/trunk@10750 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.1 KB
Line 
1///////////////////////////////////////////////////////////////////////////////
2// emacs edit mode for this file is -*- C++ -*-
3// $Id: class.h,v 1.7 2008-06-10 14:49:16 Singular Exp $
4///////////////////////////////////////////////////////////////////////////////
5#ifndef INCL_CLASS_H
6#define INCL_CLASS_H
7
8// #pragma interface
9
10#ifndef NOSTREAMIO
11#ifdef HAVE_IOSTREAM
12#include <iostream>
13#define OSTREAM std::ostream
14#define ISTREAM std::istream
15#elif defined(HAVE_IOSTREAM_H)
16#include <iostream.h>
17#define OSTREAM ostream
18#define ISTREAM istream
19#endif
20#endif
21
22template <class T>
23class Substitution {
24private:
25    T _factor;
26    T _exp;
27public:
28    Substitution() : _factor(1), _exp(0) {}
29    Substitution( const Substitution<T> & f ) : _factor(f._factor), _exp(f._exp) {}
30    Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {}
31    Substitution( const T & f ) : _factor(f), _exp(1) {}
32    ~Substitution() {}
33    Substitution<T>& operator= ( const Substitution<T>& );
34    Substitution<T>& operator= ( const T& );
35    T factor() const { return _factor; }
36    T exp() const { return _exp; }
37//     T value() const { return power( _factor, _exp ); }
38//     Factor<T>& operator+= ( int i ) { _exp += i; return *this; }
39//     Factor<T>& operator*= ( int i ) { _exp *= i; return *this; }
40//     Substitution<T>& operator*= ( const T & f ) { _factor *= f; _exp *= f; return *this; }
41#ifndef NOSTREAMIO
42    void print ( OSTREAM& ) const;
43    friend OSTREAM& operator<< ( OSTREAM & os, const Substitution<T> & f )
44    {
45        f.print( os );
46        return os;
47    }
48#endif
49};
50template <class T>
51int operator== ( const Substitution<T>&, const Substitution<T>& );
52
53// #ifdef IMPL_CLASS_H
54// #include "class.cc"
55// #endif
56
57#endif /* INCL_CLASS_H */
58
59////////////////////////////////////////////////////////////
60/*
61$Log: not supported by cvs2svn $
62Revision 1.6  2006/05/16 14:46:50  Singular
63*hannes: gcc 4.1 fixes
64
65Revision 1.5  2000/05/29 08:06:47  pohl
66no artificial friend
67
68Revision 1.4  1997/09/12 07:19:54  Singular
69* hannes/michael: libfac-0.3.0
70
71Revision 1.2  1997/04/25 22:21:26  michael
72Version for libfac-0.2.1
73
74*/
Note: See TracBrowser for help on using the repository browser.