source: git/Singular/claptmpl.cc @ 63be42

spielwiese
Last change on this file since 63be42 was 5812c69, checked in by Hans Schönemann <hannes@…>, 26 years ago
cosmetic changes git-svn-id: file:///usr/local/Singular/svn/trunk@2517 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.18 1998-09-24 09:59:35 Singular 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  #include <templates/ftmpl_list.cc>
19  #ifdef HAVE_FGLM
20    #include "fglm.h"
21  #endif
22
23  #ifdef HAVE_FACTORY
24    #include <templates/ftmpl_array.cc>
25    #include <templates/ftmpl_factor.cc>
26    #include <templates/ftmpl_functions.h>
27    #include <templates/ftmpl_matrix.cc>
28    #ifdef __MWERKS__
29      template List<CanonicalForm> Difference<CanonicalForm>(const List<CanonicalForm>&,const List<CanonicalForm>&);
30      template List<CanonicalForm> Union<CanonicalForm>(const List<CanonicalForm>&,const List<CanonicalForm>&);
31      template List<CFFactor> Union<CFFactor>(const List<CFFactor>&,const List<CFFactor>&);
32      template List<Variable> Union<Variable> ( const List<Variable>&, const List<Variable>& );
33      template List<Variable> Difference<Variable> ( const List<Variable>&, const List<Variable>& );
34      template int operator==<CanonicalForm> ( const Factor<CanonicalForm>&, const Factor<CanonicalForm>& );
35    #endif
36
37    template class Factor<CanonicalForm>;
38    template class List<CFFactor>;
39    template class ListItem<CFFactor>;
40    template class ListItem<CanonicalForm>;
41    template class ListIterator<CFFactor>;
42    template class List<CanonicalForm>;
43    template class ListIterator<CanonicalForm>;
44    template class Array<CanonicalForm>;
45    template class List<MapPair>;
46    template class ListItem<MapPair>;
47    template class ListIterator<MapPair>;
48    template class Matrix<CanonicalForm>;
49    template class SubMatrix<CanonicalForm>;
50    template class Array<REvaluation>;
51
52    #ifndef __MWERKS__
53      template List<CFFactor> Union ( const List<CFFactor>&, const List<CFFactor>& );
54      template int operator == ( const Factor<CanonicalForm>&, const Factor<CanonicalForm>& );
55
56      template CanonicalForm tmax ( const CanonicalForm&, const CanonicalForm& );
57      template CanonicalForm tmin ( const CanonicalForm&, const CanonicalForm& );
58
59      template Variable tmax ( const Variable&, const Variable& );
60      template Variable tmin ( const Variable&, const Variable& );
61
62      template int tmax ( const int&, const int& );
63      template int tmin ( const int&, const int& );
64      template int tabs ( const int& );
65    #endif
66
67  #endif
68// place here your own template stuff, not instantiated by factory
69  #ifdef HAVE_LIBFAC_P
70    #include <factor.h>
71
72// class.h:
73template <class T>
74class Substitution {
75private:
76    T _factor;
77    T _exp;
78public:
79    Substitution() : _factor(1), _exp(0) {}
80    Substitution( const Substitution<T> & f ) : _factor(f._factor), _exp(f._exp) {}
81    Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {}
82    Substitution( const T & f ) : _factor(f), _exp(1) {}
83    ~Substitution() {}
84    Substitution<T>& operator= ( const Substitution<T>& );
85    Substitution<T>& operator= ( const T& );
86    T factor() const { return _factor; }
87    T exp() const { return _exp; }
88    friend int operator== ( const Substitution<T>&, const Substitution<T>& );
89};
90
91// class.cc
92template <class T>
93Substitution<T>& Substitution<T>::operator= ( const Substitution<T>& f )
94{
95    if ( this != &f ) {
96        _factor = f._factor;
97        _exp = f._exp;
98    }
99    return *this;
100}
101
102template <class T>
103Substitution<T>& Substitution<T>::operator= ( const T & f )
104{
105    _factor = f;
106    _exp = 1;
107    return *this;
108}
109
110template <class T>
111int operator== ( const Substitution<T> &f1, const Substitution<T> &f2 )
112{
113    return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor());
114}
115
116    template class List<int>;
117    template class ListIterator<int>;
118
119    template class List<IntList>;
120    template class ListIterator<IntList>;
121
122    template class Substitution<CanonicalForm>;
123    template class Array<Variable>;
124    template class Array<int>;
125    typedef Substitution<CanonicalForm> SForm ;
126    template class List<SForm>;
127    template class ListIterator<SForm>;
128    template class List<Variable>;
129    template class ListIterator<Variable> ;
130
131    #ifndef __MWERKS__
132      template List<Variable> Union ( const List<Variable>&, const List<Variable>& );
133      template List<Variable> Difference ( const List<Variable>&, const List<Variable>& );
134
135      template List<CanonicalForm> Union ( const List<CanonicalForm>&, const List<CanonicalForm>& );
136      template List<CanonicalForm> Difference ( const List<CanonicalForm>&, const List<CanonicalForm>& );
137    #endif
138
139// for charsets:
140    template class List<CFList>;
141    template class ListIterator<CFList>;
142
143  #endif
144#endif
145
146#ifdef HAVE_FGLM
147// templates for fglm:
148
149  template class List<fglmSelem>;
150  template class ListIterator<fglmSelem>;
151
152  template class List<fglmDelem>;
153  template class ListIterator<fglmDelem>;
154#endif
Note: See TracBrowser for help on using the repository browser.