source: git/libfac/factor/class.h @ d9edaf

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