source: git/Singular/claptmpl.cc @ 1d4180

spielwiese
Last change on this file since 1d4180 was 1d4180, checked in by Jens Schmidt <schmidt@…>, 25 years ago
* claptmpl.cc: instantiation for `tabs()' added git-svn-id: file:///usr/local/Singular/svn/trunk@1337 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.9 KB
Line 
1// emacs edit mode for this file is -*- C++ -*-
2/****************************************
3*  Computer Algebra System SINGULAR     *
4****************************************/
5// $Id: claptmpl.cc,v 1.13 1998-04-06 12:24:19 schmidt 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      template int tabs ( const int& );
70    #endif
71
72  #endif
73// place here your own template stuff, not instantiated by factory
74  #ifdef HAVE_LIBFAC_P
75    #include <factor.h>
76
77// class.h:
78template <class T>
79class Substitution {
80private:
81    T _factor;
82    T _exp;
83public:
84    Substitution() : _factor(1), _exp(0) {}
85    Substitution( const Substitution<T> & f ) : _factor(f._factor), _exp(f._exp) {}
86    Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {}
87    Substitution( const T & f ) : _factor(f), _exp(1) {}
88    ~Substitution() {}
89    Substitution<T>& operator= ( const Substitution<T>& );
90    Substitution<T>& operator= ( const T& );
91    T factor() const { return _factor; }
92    T exp() const { return _exp; }
93    friend int operator== ( const Substitution<T>&, const Substitution<T>& );
94};
95
96// class.cc
97template <class T>
98Substitution<T>& Substitution<T>::operator= ( const Substitution<T>& f )
99{
100    if ( this != &f ) {
101        _factor = f._factor;
102        _exp = f._exp;
103    }
104    return *this;
105}
106
107template <class T>
108Substitution<T>& Substitution<T>::operator= ( const T & f )
109{
110    _factor = f;
111    _exp = 1;
112    return *this;
113}
114
115template <class T>
116int operator== ( const Substitution<T> &f1, const Substitution<T> &f2 )
117{
118    return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor());
119}
120
121    template class List<int>;
122    template class ListIterator<int>;
123
124    template class List<IntList>;
125    template class ListIterator<IntList>;
126
127    template class Substitution<CanonicalForm>;
128    template class Array<Variable>;
129    template class Array<int>;
130    typedef Substitution<CanonicalForm> SForm ;
131    template class List<SForm>;
132    template class ListIterator<SForm>;
133    template class List<Variable>;
134    template class ListIterator<Variable> ;
135
136    #ifndef macintosh
137      template List<Variable> Union ( const List<Variable>&, const List<Variable>& );
138      template List<Variable> Difference ( const List<Variable>&, const List<Variable>& );
139
140      template List<CanonicalForm> Union ( const List<CanonicalForm>&, const List<CanonicalForm>& );
141      template List<CanonicalForm> Difference ( const List<CanonicalForm>&, const List<CanonicalForm>& );
142    #endif
143
144// for charsets:
145    template class List<CFList>;
146    template class ListIterator<CFList>;
147
148  #endif
149#endif
150
151#ifdef HAVE_FGLM
152// templates for fglm:
153
154  template class List<fglmSelem>;
155  template class ListIterator<fglmSelem>;
156
157  template class List<fglmDelem>;
158  template class ListIterator<fglmDelem>;
159#endif
Note: See TracBrowser for help on using the repository browser.