source: git/factory/cf_map.h @ 2dd068

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