source: git/factory/cf_map.h @ cc3e5e

spielwiese
Last change on this file since cc3e5e was cc3e5e, checked in by Rüdiger Stobbe <stobbe@…>, 27 years ago
"New function compress( f, g, M, N ) that maps the common variables to be the ones with the lowest level. " git-svn-id: file:///usr/local/Singular/svn/trunk@37 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.7 KB
Line 
1// emacs edit mode for this file is -*- C++ -*-
2// $Id: cf_map.h,v 1.1 1996-07-08 08:17:22 stobbe Exp $
3
4#ifndef INCL_CF_MAP_H
5#define INCL_CF_MAP_H
6
7/*
8$Log: not supported by cvs2svn $
9Revision 1.0  1996/05/17 10:59:38  stobbe
10Initial revision
11
12*/
13
14#include <iostream.h>
15#include "variable.h"
16#include "templates/list.h"
17#include "canonicalform.h"
18
19/*BEGINPUBLIC*/
20
21class MapPair
22{
23private:
24    Variable V;
25    CanonicalForm S;
26public:
27    MapPair( const Variable & v, const CanonicalForm & s ) : V(v), S(s) {}
28    MapPair() : V(), S(1) {}
29    MapPair( const MapPair & p ) : V(p.V), S(p.S) {}
30    ~MapPair() {}
31    MapPair& operator=( const MapPair & p );
32    Variable var() const { return V; }
33    CanonicalForm subst() const { return S; }
34    friend ostream& operator << ( ostream& s, const MapPair & p );
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  friend ostream& operator<< ( ostream& s, const CFMap & m );
57};
58
59CanonicalForm compress ( const CanonicalForm & f, CFMap & m );
60void compress ( const CFArray & a, CFMap & M, CFMap & N );
61void compress ( const CanonicalForm & f, const CanonicalForm & g, CFMap & M, CFMap & N );
62
63/*ENDPUBLIC*/
64
65#endif /* INCL_CF_MAP_H */
66
Note: See TracBrowser for help on using the repository browser.