source: git/Singular/claptmpl.cc @ a2dde00

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