source: git/factory/cf_map.h @ 974ce1

spielwiese
Last change on this file since 974ce1 was 974ce1, checked in by Jens Schmidt <schmidt@…>, 27 years ago
* templates/: all files prefixed with ftmpl_. All #include statements changed. git-svn-id: file:///usr/local/Singular/svn/trunk@416 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.8 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: cf_map.h,v 1.5 1997-06-20 10:45:15 schmidt Exp $ */
3
4#ifndef INCL_CF_MAP_H
5#define INCL_CF_MAP_H
6
7#include <config.h>
8
9#ifndef NOSTREAMIO
10#include <iostream.h>
11#endif /* NOSTREAMIO */
12
13#include "variable.h"
14#include "templates/ftmpl_list.h"
15#include "canonicalform.h"
16
17/*BEGINPUBLIC*/
18
19class MapPair
20{
21private:
22    Variable V;
23    CanonicalForm S;
24public:
25    MapPair( const Variable & v, const CanonicalForm & s ) : V(v), S(s) {}
26    MapPair() : V(), S(1) {}
27    MapPair( const MapPair & p ) : V(p.V), S(p.S) {}
28    ~MapPair() {}
29    MapPair& operator=( const MapPair & p );
30    Variable var() const { return V; }
31    CanonicalForm subst() const { return S; }
32#ifndef NOSTREAMIO
33    friend ostream& operator << ( ostream& s, const MapPair & p );
34#endif /* NOSTREAMIO */
35};
36
37typedef List<MapPair> MPList;
38typedef ListIterator<MapPair> MPListIterator;
39
40
41class CFMap
42{
43private:
44  MPList P;
45public:
46  CFMap() {}
47  CFMap( const CanonicalForm & s ) : P( MapPair( Variable(), s ) ) {}
48  CFMap( const Variable & v ) : P( MapPair( v, 1 ) ) {}
49  CFMap( const Variable & v, const CanonicalForm & s ) : P( MapPair(v,s) ) {}
50  ~CFMap() {}
51  CFMap( const List<CanonicalForm> & L );
52  CFMap( const CFMap & m ) : P( m.P ) {}
53  CFMap& operator=( const CFMap & m );
54  void newpair( const Variable & v, const CanonicalForm & s );
55  CanonicalForm operator() ( const CanonicalForm & f ) const;
56#ifndef NOSTREAMIO
57  friend ostream& operator<< ( ostream& s, const CFMap & m );
58#endif /* NOSTREAMIO */
59};
60
61CanonicalForm compress ( const CanonicalForm & f, CFMap & m );
62void compress ( const CFArray & a, CFMap & M, CFMap & N );
63void compress ( const CanonicalForm & f, const CanonicalForm & g, CFMap & M, CFMap & N );
64
65/*ENDPUBLIC*/
66
67#endif /* ! INCL_CF_MAP_H */
Note: See TracBrowser for help on using the repository browser.