source: git/Singular/claptmpl.cc @ 634dab0

spielwiese
Last change on this file since 634dab0 was a8d026, checked in by Hans Schönemann <hannes@…>, 19 years ago
*hannes: C++/debug stuff git-svn-id: file:///usr/local/Singular/svn/trunk@8354 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 6.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.27 2005-06-13 16:24:43 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 List<List<CanonicalForm> >;
44    template class ListIterator<CanonicalForm>;
45    template class Array<CanonicalForm>;
46    template class List<MapPair>;
47    template class ListItem<MapPair>;
48    template class ListIterator<MapPair>;
49    template class Matrix<CanonicalForm>;
50    template class SubMatrix<CanonicalForm>;
51    template class Array<REvaluation>;
52
53    #ifndef NOSTREAMIO
54    template ostream & operator<<(ostream &, const List<Factor<CanonicalForm> > &);
55    template ostream & operator<<(ostream &, const List<List<CanonicalForm> > &);
56    template ostream & operator<<(ostream &, const List<Variable> &);
57    template ostream & operator<<(ostream &, const Matrix<Variable> &);
58    #endif
59
60    #ifndef __MWERKS__
61      template List<CFFactor> Union ( const List<CFFactor>&, const List<CFFactor>& );
62      template int operator == ( const Factor<CanonicalForm>&, const Factor<CanonicalForm>& );
63
64      template CanonicalForm tmax ( const CanonicalForm&, const CanonicalForm& );
65      template CanonicalForm tmin ( const CanonicalForm&, const CanonicalForm& );
66
67      template Variable tmax ( const Variable&, const Variable& );
68      template Variable tmin ( const Variable&, const Variable& );
69
70      template int tmax ( const int&, const int& );
71      template int tmin ( const int&, const int& );
72      template int tabs ( const int& );
73    #endif
74
75  #endif
76// place here your own template stuff, not instantiated by factory
77  #ifdef HAVE_LIBFAC_P
78    #include <factor.h>
79
80// class.h:
81template <class T>
82class Substitution {
83private:
84    T _factor;
85    T _exp;
86public:
87    Substitution() : _factor(1), _exp(0) {}
88    Substitution( const Substitution<T> & f ) : _factor(f._factor), _exp(f._exp) {}
89    Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {}
90    Substitution( const T & f ) : _factor(f), _exp(1) {}
91    ~Substitution() {}
92    Substitution<T>& operator= ( const Substitution<T>& );
93    Substitution<T>& operator= ( const T& );
94    T factor() const { return _factor; }
95    T exp() const { return _exp; }
96#ifndef NOSTREAMIO
97    //friend ostream & operator <<<>(ostream &, Substitution<T> &);
98    void Substitution<T>::print ( ostream& s ) const
99    {
100      s << "("  << factor() << ")^" << exp();
101    }
102#endif
103};
104template <class T>
105int operator== ( const Substitution<T>&, const Substitution<T>& );
106
107// class.cc
108template <class T>
109Substitution<T>& Substitution<T>::operator= ( const Substitution<T>& f )
110{
111    if ( this != &f ) {
112        _factor = f._factor;
113        _exp = f._exp;
114    }
115    return *this;
116}
117
118template <class T>
119Substitution<T>& Substitution<T>::operator= ( const T & f )
120{
121    _factor = f;
122    _exp = 1;
123    return *this;
124}
125
126#ifndef NOSTREAMIO
127template <class T>
128ostream & operator <<(ostream & os, Substitution<T> &a)
129{
130  a.print(os);
131  return os;
132}
133template ostream & operator <<(ostream &, Substitution<CanonicalForm> &);
134template ostream & operator <<(ostream &, const List<CanonicalForm> &);
135template ostream & operator <<(ostream &, const Array<CanonicalForm> &);
136template ostream & operator<<(ostream &, const List<Substitution<CanonicalForm> > &);
137#endif
138
139template <class T>
140int operator== ( const Substitution<T> &f1, const Substitution<T> &f2 )
141{
142    return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor());
143}
144
145    template class List<int>;
146    template class ListIterator<int>;
147
148    template class List<IntList>;
149    template class ListIterator<IntList>;
150
151    template class Substitution<CanonicalForm>;
152    template class Array<Variable>;
153    template class Array<int>;
154    typedef Substitution<CanonicalForm> SForm ;
155    template class List<SForm>;
156    template class ListIterator<SForm>;
157    template class List<Variable>;
158    template class ListIterator<Variable> ;
159
160    #ifndef __MWERKS__
161      template List<Variable> Union ( const List<Variable>&, const List<Variable>& );
162      template List<Variable> Difference ( const List<Variable>&, const List<Variable>& );
163
164      template List<CanonicalForm> Union ( const List<CanonicalForm>&, const List<CanonicalForm>& );
165      template List<CanonicalForm> Difference ( const List<CanonicalForm>&, const List<CanonicalForm>& );
166    #endif
167
168// for charsets:
169    template class ListIterator<CFList>;
170
171  #endif
172#endif
173
174#ifdef HAVE_FGLM
175// templates for fglm:
176
177  template class List<fglmSelem>;
178  template class ListIterator<fglmSelem>;
179
180  template class List<fglmDelem>;
181  template class ListIterator<fglmDelem>;
182#endif
183
184// ----------------------------------------------------------------------------
185//  kmatrix.cc
186//  begin of file
187//  Stephan Endrass, endrass@mathematik.uni-mainz.de
188//  23.7.99
189// ----------------------------------------------------------------------------
190
191#ifdef HAVE_SPECTRUM
192
193#ifdef   KMATRIX_PRINT
194#include <iostream.h>
195#ifndef   KMATRIX_IOSTREAM
196#include <stdio.h>
197#endif
198#endif
199
200#include "GMPrat.h"
201#include "kmatrix.h"
202
203template    class   KMatrix<Rational>;
204
205#ifdef   KMATRIX_PRINT
206template    ostream &   operator << ( ostream&,const KMatrix<Rational>& );
207template    static  void    print_rational( ostream&,int,const Rational& );
208#endif
209
210#endif /* HAVE_SPECTRUM */
211// ----------------------------------------------------------------------------
212//  kmatrix.cc
213//  end of file
214// ----------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.