source: git/Singular/claptmpl.cc @ 2fcbd2

spielwiese
Last change on this file since 2fcbd2 was 2fcbd2, checked in by Frank Seelisch <seelisch@…>, 14 years ago
templates are needed for cache git-svn-id: file:///usr/local/Singular/svn/trunk@12164 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 9.0 KB
Line 
1// emacs edit mode for this file is -*- C++ -*-
2/****************************************
3*  Computer Algebra System SINGULAR     *
4****************************************/
5// $Id: claptmpl.cc,v 1.51 2009-10-07 09:05:27 seelisch Exp $
6/*
7* ABSTRACT - instantiation of all templates
8*/
9
10#include "mod2.h"
11//#include <vector>
12//using namespace std;
13#ifdef HAVE_FACTORY
14  #define SINGULAR 1
15  #include <factory.h>
16#endif
17
18#if defined(HAVE_FACTORY) || defined(HAVE_FGLM)
19  #include <templates/ftmpl_list.cc>
20  #ifdef HAVE_FGLM
21    #include "fglm.h"
22  #endif
23
24  #ifdef HAVE_FACTORY
25    #include <templates/ftmpl_array.cc>
26    #include <templates/ftmpl_factor.cc>
27    #include <templates/ftmpl_functions.h>
28    #include <templates/ftmpl_matrix.cc>
29
30    template class Factor<CanonicalForm>;
31    template class List<CFFactor>;
32    template class ListItem<CFFactor>;
33    template class ListItem<CanonicalForm>;
34    template class ListIterator<CFFactor>;
35    template class List<CanonicalForm>;
36    template class List<List<CanonicalForm> >;
37    template class ListIterator<CanonicalForm>;
38    template class Array<CanonicalForm>;
39    template class List<MapPair>;
40    template class ListItem<MapPair>;
41    template class ListIterator<MapPair>;
42    template class Matrix<CanonicalForm>;
43    template class SubMatrix<CanonicalForm>;
44    template class Array<REvaluation>;
45    //template class vector<poly>;
46    #ifndef NOSTREAMIO
47    template ostream & operator<<(ostream &, const List<Factor<CanonicalForm> > &);
48    template ostream & operator<<(ostream &, const List<List<CanonicalForm> > &);
49    template ostream & operator<<(ostream &, const List<Variable> &);
50    template ostream & operator<<(ostream &, const Matrix<Variable> &);
51    #endif
52
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
66  #endif
67// place here your own template stuff, not instantiated by factory
68  // libfac:
69    #include <factor.h>
70
71// class.h:
72template <class T>
73class Substitution {
74private:
75    T _factor;
76    T _exp;
77public:
78    Substitution() : _factor(1), _exp(0) {}
79    Substitution( const Substitution<T> & f ) : _factor(f._factor), _exp(f._exp) {}
80    Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {}
81    Substitution( const T & f ) : _factor(f), _exp(1) {}
82    ~Substitution() {}
83    Substitution<T>& operator= ( const Substitution<T>& );
84    Substitution<T>& operator= ( const T& );
85    T factor() const { return _factor; }
86    T exp() const { return _exp; }
87#ifndef NOSTREAMIO
88    //friend ostream & operator <<<>(ostream &, Substitution<T> &);
89    void print ( ostream& s ) const
90    {
91      s << "("  << factor() << ")^" << exp();
92    }
93#endif
94};
95template <class T>
96int operator== ( const Substitution<T>&, const Substitution<T>& );
97
98// class.cc
99template <class T>
100Substitution<T>& Substitution<T>::operator= ( const Substitution<T>& f )
101{
102    if ( this != &f ) {
103        _factor = f._factor;
104        _exp = f._exp;
105    }
106    return *this;
107}
108
109template <class T>
110Substitution<T>& Substitution<T>::operator= ( const T & f )
111{
112    _factor = f;
113    _exp = 1;
114    return *this;
115}
116
117#ifndef NOSTREAMIO
118template <class T>
119ostream & operator <<(ostream & os, Substitution<T> &a)
120{
121  a.print(os);
122  return os;
123}
124template ostream & operator <<(ostream &, Substitution<CanonicalForm> &);
125template ostream & operator <<(ostream &, const List<CanonicalForm> &);
126template ostream & operator <<(ostream &, const Array<CanonicalForm> &);
127template ostream & operator<<(ostream &, const List<Substitution<CanonicalForm> > &);
128#endif
129
130template <class T>
131int operator== ( const Substitution<T> &f1, const Substitution<T> &f2 )
132{
133    return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor());
134}
135
136    template class List<int>;
137    template class ListIterator<int>;
138
139    template class List<IntList>;
140    template class ListIterator<IntList>;
141
142    template class Substitution<CanonicalForm>;
143    template class Array<Variable>;
144    template class Array<int>;
145    typedef Substitution<CanonicalForm> SForm ;
146    template class List<SForm>;
147    template class ListIterator<SForm>;
148    template class List<Variable>;
149    template class ListIterator<Variable> ;
150
151    template List<Variable> Union ( const List<Variable>&, const List<Variable>& );
152    template List<Variable> Difference ( const List<Variable>&, const List<Variable>& );
153
154    template List<CanonicalForm> Union ( const List<CanonicalForm>&, const List<CanonicalForm>& );
155    template List<CanonicalForm> Difference ( const List<CanonicalForm>&, const List<CanonicalForm>& );
156
157// for charsets:
158    template class ListIterator<CFList>;
159
160#endif
161
162#ifdef HAVE_FGLM
163// templates for fglm:
164
165  template class List<fglmSelem>;
166  template class ListIterator<fglmSelem>;
167
168  template class List<fglmDelem>;
169  template class ListIterator<fglmDelem>;
170#endif
171
172// ----------------------------------------------------------------------------
173//  kmatrix.cc
174//  begin of file
175//  Stephan Endrass, endrass@mathematik.uni-mainz.de
176//  23.7.99
177// ----------------------------------------------------------------------------
178
179#ifdef HAVE_SPECTRUM
180
181#ifdef   KMATRIX_PRINT
182#include <iostream.h>
183#ifndef   KMATRIX_IOSTREAM
184#include <stdio.h>
185#endif
186#endif
187
188#include "GMPrat.h"
189#include "kmatrix.h"
190
191template    class   KMatrix<Rational>;
192
193#ifdef   KMATRIX_PRINT
194template    ostream &   operator << ( ostream&,const KMatrix<Rational>& );
195template    static  void    print_rational( ostream&,int,const Rational& );
196#endif
197
198#endif /* HAVE_SPECTRUM */
199// ----------------------------------------------------------------------------
200//  kmatrix.cc
201//  end of file
202// ----------------------------------------------------------------------------
203
204#ifdef HAVE_PLURAL
205
206#include <ncSACache.h> // for CCacheHash etc classes
207#include <ncSAMult.h> // for CMultiplier etc classes
208
209template class CMultiplier<int>;
210template class CMultiplier<poly>;
211template class CMultiplier<CPower>;
212
213template class CCacheHash<poly>;
214template class CCacheHash<int>;
215
216#endif
217
218#include "tgb_internal.h"
219#ifdef HAVE_BOOST
220#include <boost/dynamic_bitset.hpp>
221#include <vector>
222using std::vector;
223using boost::dynamic_bitset;
224template class dynamic_bitset<>;
225template class vector<dynamic_bitset<> >;
226#elif defined(USE_STDVECBOOL)
227#include <vector>
228using std::vector;
229template class vector<bool>;
230template class vector<vector<bool> >;
231#endif
232
233template int pos_helper(kStrategy strat, poly p, int len, intset  setL, polyset set);
234template int pos_helper(kStrategy strat, poly p, wlen_type len, wlen_set setL, polyset set);
235#ifdef NORO_CACHE
236//template class std::map<PolySimple,std::pair<PolySimple,int> >;
237//#include <queue>
238template class std::vector<PolySimple>;
239//template class std::priority_queue<MonRedRes>;
240//template class std::vector<NoroPlaceHolder>;
241//template class std::vector<std::vector<NoroPlaceHolder> >;
242//template class std::vector<DataNoroCacheNode<tgb_uint16>* >;
243//template class std::vector<DataNoroCacheNode<tgb_uint8>* >;
244template class std::vector<DataNoroCacheNode<tgb_uint32>* >;
245//template SparseRow<tgb_uint16> * noro_red_to_non_poly_t<tgb_uint16>(poly p, int &len, NoroCache<tgb_uint16>* cache,slimgb_alg* c);
246template SparseRow<tgb_uint32>* noro_red_to_non_poly_t<tgb_uint32>(poly p, int &len, NoroCache<tgb_uint32>* cache,slimgb_alg* c);
247//template SparseRow<tgb_uint8>* noro_red_to_non_poly_t<tgb_uint8>(poly p, int &len, NoroCache<tgb_uint8>* cache,slimgb_alg* c);
248//template void simplest_gauss_modp<tgb_uint16> (tgb_uint16* a, int nrows,int ncols);
249template void simplest_gauss_modp<tgb_uint32> (tgb_uint32* a, int nrows,int ncols);
250//template void simplest_gauss_modp<tgb_uint8> (tgb_uint8* a, int nrows,int ncols);
251//template poly row_to_poly<tgb_uint8>(tgb_uint8* row, poly* terms, int tn, ring r);
252template poly row_to_poly<tgb_uint32>(tgb_uint32* row, poly* terms, int tn, ring r);
253//template poly row_to_poly<tgb_uint16>(tgb_uint16* row, poly* terms, int tn, ring r);
254template void noro_step<tgb_uint8>(poly*p,int &pn,slimgb_alg* c);
255template void noro_step<tgb_uint16>(poly*p,int &pn,slimgb_alg* c);
256template void noro_step<tgb_uint32>(poly*p,int &pn,slimgb_alg* c);
257//std::priority_queue<MonRedRes>
258//
259#ifdef HAVE_MINOR // new minor code
260#include <list>
261#include "Minor.h"
262#include "Cache.h"
263template class std::list<int>;
264template class std::list<long>;
265template class std::list<MinorKey>;
266template class std::list<LongMinorValue>;
267template class std::list<PolyMinorValue>;
268template class Cache<MinorKey, LongMinorValue>;
269template class Cache<MinorKey, PolyMinorValue>;
270#endif // HAVE_MINOR
271#endif
272//template int pos_helper(kStrategy strat, poly p, int len, intset setL, polyset set);
Note: See TracBrowser for help on using the repository browser.