source: git/Singular/claptmpl.cc @ 400884

spielwiese
Last change on this file since 400884 was 623e7c, checked in by Wilfred Pohl <pohl@…>, 27 years ago
+ added some ifdef macintosh for correct instantiation of classes on the mac git-svn-id: file:///usr/local/Singular/svn/trunk@390 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.7 KB
Line 
1// emacs edit mode for this file is -*- C++ -*-
2/****************************************
3*  Computer Algebra System SINGULAR     *
4****************************************/
5// $Id: claptmpl.cc,v 1.9 1997-06-17 09:52:48 pohl Exp $
6/*
7* ABSTRACT - instantiation of all templates
8*/
9
10#include "mod2.h"
11
12#ifdef HAVE_FACTORY
13  #define SINGULAR 1
14  #include <factory.h>
15#endif
16
17#if defined(HAVE_FACTORY) || defined(HAVE_FGLM)
18  #ifdef macintosh
19    #include <::templates:list.cc>
20  #else
21    #include <templates/list.cc>
22  #endif
23
24  #ifdef HAVE_FGLM
25    #include "fglm.h"
26  #endif
27
28  #ifdef HAVE_FACTORY
29    #ifdef macintosh
30      #include <::templates:array.cc>
31      #include <::templates:factor.cc>
32      #include <::templates:functions.h>
33      #include <::templates:matrix.cc>
34      template List<CanonicalForm> Difference<CanonicalForm>(const List<CanonicalForm>&,const List<CanonicalForm>&);
35      template List<CanonicalForm> Union<CanonicalForm>(const List<CanonicalForm>&,const List<CanonicalForm>&);
36      template List<CFFactor> Union<CFFactor>(const List<CFFactor>&,const List<CFFactor>&);
37      template List<Variable> Union<Variable> ( const List<Variable>&, const List<Variable>& );
38      template List<Variable> Difference<Variable> ( const List<Variable>&, const List<Variable>& );
39    #else
40      #include <templates/array.cc>
41      #include <templates/factor.cc>
42      #include <templates/functions.h>
43      #include <templates/matrix.cc>
44    #endif
45
46    template class Factor<CanonicalForm>;
47    template class List<CFFactor>;
48    template class ListItem<CFFactor>;
49    template class ListItem<CanonicalForm>;
50    template class ListIterator<CFFactor>;
51    template class List<CanonicalForm>;
52    template class ListIterator<CanonicalForm>;
53    template class Array<CanonicalForm>;
54    template class List<MapPair>;
55    template class ListItem<MapPair>;
56    template class ListIterator<MapPair>;
57    template class Matrix<CanonicalForm>;
58    template class SubMatrix<CanonicalForm>;
59
60    #ifndef macintosh
61      template List<CFFactor> Union ( const List<CFFactor>&, const List<CFFactor>& );
62
63      template CanonicalForm tmax ( const CanonicalForm&, const CanonicalForm& );
64      template CanonicalForm tmin ( const CanonicalForm&, const CanonicalForm& );
65
66      template int tmax ( const int&, const int& );
67      template int tmin ( const int&, const int& );
68    #endif
69
70  #endif
71// place here your own template stuff, not instantiated by factory
72  #ifdef HAVE_LIBFAC_P
73    #include <factor.h>
74
75// class.h:
76template <class T>
77class Substitution {
78private:
79    T _factor;
80    T _exp;
81public:
82    Substitution() : _factor(1), _exp(0) {}
83    Substitution( const Substitution<T> & f ) : _factor(f._factor), _exp(f._exp) {}
84    Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {}
85    Substitution( const T & f ) : _factor(f), _exp(1) {}
86    ~Substitution() {}
87    Substitution<T>& operator= ( const Substitution<T>& );
88    Substitution<T>& operator= ( const T& );
89    T factor() const { return _factor; }
90    T exp() const { return _exp; }
91    friend int operator== ( const Substitution<T>&, const Substitution<T>& );
92};
93
94// class.cc
95template <class T>
96Substitution<T>& Substitution<T>::operator= ( const Substitution<T>& f )
97{
98    if ( this != &f ) {
99        _factor = f._factor;
100        _exp = f._exp;
101    }
102    return *this;
103}
104
105template <class T>
106Substitution<T>& Substitution<T>::operator= ( const T & f )
107{
108    _factor = f;
109    _exp = 1;
110    return *this;
111}
112
113template <class T>
114int operator== ( const Substitution<T> &f1, const Substitution<T> &f2 )
115{
116    return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor());
117}
118
119    template class List<int>;
120    template class ListIterator<int>;
121
122    template class List<IntList>;
123    template class ListIterator<IntList>;
124
125    template class Substitution<CanonicalForm>;
126    template class Array<Variable>;
127    template class Array<int>;
128    typedef Substitution<CanonicalForm> SForm ;
129    template class List<SForm>;
130    template class ListIterator<SForm>;
131    template class List<Variable>;
132    template class ListIterator<Variable> ;
133
134    #ifndef macintosh
135      template List<Variable> Union ( const List<Variable>&, const List<Variable>& );
136      template List<Variable> Difference ( const List<Variable>&, const List<Variable>& );
137
138      template List<CanonicalForm> Union ( const List<CanonicalForm>&, const List<CanonicalForm>& );
139      template List<CanonicalForm> Difference ( const List<CanonicalForm>&, const List<CanonicalForm>& );
140    #endif
141
142// for charsets:
143    template class List<CFList>;
144    template class ListIterator<CFList>;
145
146  #endif
147#endif
148
149#ifdef HAVE_FGLM
150// templates for fglm:
151
152  template class List<fglmSelem>;
153  template class ListIterator<fglmSelem>;
154
155  template class List<fglmDelem>;
156  template class ListIterator<fglmDelem>;
157#endif
Note: See TracBrowser for help on using the repository browser.