source: git/Singular/claptmpl.cc @ 666c90

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