source: git/Singular/claptmpl.cc @ 10b3a7

spielwiese
Last change on this file since 10b3a7 was 10b3a7, checked in by Wilfred Pohl <pohl@…>, 26 years ago
include for macintosh git-svn-id: file:///usr/local/Singular/svn/trunk@1082 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.8 KB
Line 
1// emacs edit mode for this file is -*- C++ -*-
2/****************************************
3*  Computer Algebra System SINGULAR     *
4****************************************/
5// $Id: claptmpl.cc,v 1.12 1998-01-27 14:05:56 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:ftmpl_list.cc>
20  #else
21    #include <templates/ftmpl_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:ftmpl_array.cc>
31      #include <:templates:ftmpl_factor.cc>
32      #include <:templates:ftmpl_functions.h>
33      #include <:templates:ftmpl_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/ftmpl_array.cc>
41      #include <templates/ftmpl_factor.cc>
42      #include <templates/ftmpl_functions.h>
43      #include <templates/ftmpl_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    template class Array<REvaluation>;
60
61    #ifndef macintosh
62      template List<CFFactor> Union ( const List<CFFactor>&, const List<CFFactor>& );
63
64      template CanonicalForm tmax ( const CanonicalForm&, const CanonicalForm& );
65      template CanonicalForm tmin ( const CanonicalForm&, const CanonicalForm& );
66
67      template int tmax ( const int&, const int& );
68      template int tmin ( const int&, const int& );
69    #endif
70
71  #endif
72// place here your own template stuff, not instantiated by factory
73  #ifdef HAVE_LIBFAC_P
74    #include <factor.h>
75
76// class.h:
77template <class T>
78class Substitution {
79private:
80    T _factor;
81    T _exp;
82public:
83    Substitution() : _factor(1), _exp(0) {}
84    Substitution( const Substitution<T> & f ) : _factor(f._factor), _exp(f._exp) {}
85    Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {}
86    Substitution( const T & f ) : _factor(f), _exp(1) {}
87    ~Substitution() {}
88    Substitution<T>& operator= ( const Substitution<T>& );
89    Substitution<T>& operator= ( const T& );
90    T factor() const { return _factor; }
91    T exp() const { return _exp; }
92    friend int operator== ( const Substitution<T>&, const Substitution<T>& );
93};
94
95// class.cc
96template <class T>
97Substitution<T>& Substitution<T>::operator= ( const Substitution<T>& f )
98{
99    if ( this != &f ) {
100        _factor = f._factor;
101        _exp = f._exp;
102    }
103    return *this;
104}
105
106template <class T>
107Substitution<T>& Substitution<T>::operator= ( const T & f )
108{
109    _factor = f;
110    _exp = 1;
111    return *this;
112}
113
114template <class T>
115int operator== ( const Substitution<T> &f1, const Substitution<T> &f2 )
116{
117    return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor());
118}
119
120    template class List<int>;
121    template class ListIterator<int>;
122
123    template class List<IntList>;
124    template class ListIterator<IntList>;
125
126    template class Substitution<CanonicalForm>;
127    template class Array<Variable>;
128    template class Array<int>;
129    typedef Substitution<CanonicalForm> SForm ;
130    template class List<SForm>;
131    template class ListIterator<SForm>;
132    template class List<Variable>;
133    template class ListIterator<Variable> ;
134
135    #ifndef macintosh
136      template List<Variable> Union ( const List<Variable>&, const List<Variable>& );
137      template List<Variable> Difference ( const List<Variable>&, const List<Variable>& );
138
139      template List<CanonicalForm> Union ( const List<CanonicalForm>&, const List<CanonicalForm>& );
140      template List<CanonicalForm> Difference ( const List<CanonicalForm>&, const List<CanonicalForm>& );
141    #endif
142
143// for charsets:
144    template class List<CFList>;
145    template class ListIterator<CFList>;
146
147  #endif
148#endif
149
150#ifdef HAVE_FGLM
151// templates for fglm:
152
153  template class List<fglmSelem>;
154  template class ListIterator<fglmSelem>;
155
156  template class List<fglmDelem>;
157  template class ListIterator<fglmDelem>;
158#endif
Note: See TracBrowser for help on using the repository browser.