source: git/libfac/factor/class.h @ 4a81ec

spielwiese
Last change on this file since 4a81ec was 4a81ec, checked in by Hans Schönemann <hannes@…>, 26 years ago
* hannes/michael: libfac-0.3.0 git-svn-id: file:///usr/local/Singular/svn/trunk@708 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.7 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.4 1997-09-12 07:19:54 Singular Exp $
5///////////////////////////////////////////////////////////////////////////////
6#ifndef INCL_CLASS_H
7#define INCL_CLASS_H
8
9// #pragma interface
10
11#ifndef NOSTREAMIO
12#include <iostream.h>
13#endif
14
15template <class T>
16class Substitution {
17private:
18    T _factor;
19    T _exp;
20public:
21    Substitution() : _factor(1), _exp(0) {}
22    Substitution( const Substitution<T> & f ) : _factor(f._factor), _exp(f._exp) {}
23    Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {}
24    Substitution( const T & f ) : _factor(f), _exp(1) {}
25    ~Substitution() {}
26    Substitution<T>& operator= ( const Substitution<T>& );
27    Substitution<T>& operator= ( const T& );
28    T factor() const { return _factor; }
29    T exp() const { return _exp; }
30//     T value() const { return power( _factor, _exp ); }
31//     Factor<T>& operator+= ( int i ) { _exp += i; return *this; }
32//     Factor<T>& operator*= ( int i ) { _exp *= i; return *this; }
33//     Substitution<T>& operator*= ( const T & f ) { _factor *= f; _exp *= f; return *this; }
34    friend int operator== ( const Substitution<T>&, const Substitution<T>& );
35#ifndef NOSTREAMIO
36    void print ( ostream& ) const;
37    friend ostream& operator<< ( ostream & os, const Substitution<T> & f )
38    {
39        f.print( os );
40        return os;
41    }
42#endif
43};
44
45// #ifdef IMPL_CLASS_H
46// #include "class.cc"
47// #endif
48
49#endif /* INCL_CLASS_H */
50
51////////////////////////////////////////////////////////////
52/*
53$Log: not supported by cvs2svn $
54Revision 1.2  1997/04/25 22:21:26  michael
55Version for libfac-0.2.1
56
57*/
Note: See TracBrowser for help on using the repository browser.