source: git/Singular/claptmpl.cc @ 3de58c

spielwiese
Last change on this file since 3de58c was 638c809, checked in by Wilfred Pohl <pohl@…>, 24 years ago
avoid friend in operator with 2 args git-svn-id: file:///usr/local/Singular/svn/trunk@4480 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 6.2 KB
Line 
1// emacs edit mode for this file is -*- C++ -*-
2/****************************************
3*  Computer Algebra System SINGULAR     *
4****************************************/
5// $Id: claptmpl.cc,v 1.24 2000-07-06 13:26:22 pohl 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 NOSTREAMIO
53    template ostream & operator<<(ostream &, const List<Factor<CanonicalForm> > &);
54    template ostream & operator<<(ostream &, const List<Variable> &);
55    #endif
56
57    #ifndef __MWERKS__
58      template List<CFFactor> Union ( const List<CFFactor>&, const List<CFFactor>& );
59      template int operator == ( const Factor<CanonicalForm>&, const Factor<CanonicalForm>& );
60
61      template CanonicalForm tmax ( const CanonicalForm&, const CanonicalForm& );
62      template CanonicalForm tmin ( const CanonicalForm&, const CanonicalForm& );
63
64      template Variable tmax ( const Variable&, const Variable& );
65      template Variable tmin ( const Variable&, const Variable& );
66
67      template int tmax ( const int&, const int& );
68      template int tmin ( const int&, const int& );
69      template int tabs ( const int& );
70    #endif
71
72  #endif
73// place here your own template stuff, not instantiated by factory
74  #ifdef HAVE_LIBFAC_P
75    #include <factor.h>
76
77// class.h:
78template <class T>
79class Substitution {
80private:
81    T _factor;
82    T _exp;
83public:
84    Substitution() : _factor(1), _exp(0) {}
85    Substitution( const Substitution<T> & f ) : _factor(f._factor), _exp(f._exp) {}
86    Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {}
87    Substitution( const T & f ) : _factor(f), _exp(1) {}
88    ~Substitution() {}
89    Substitution<T>& operator= ( const Substitution<T>& );
90    Substitution<T>& operator= ( const T& );
91    T factor() const { return _factor; }
92    T exp() const { return _exp; }
93#ifndef NOSTREAMIO
94    friend ostream & operator <<(ostream &, const Substitution<T> &);
95#endif
96};
97template <class T>
98int operator== ( const Substitution<T>&, const Substitution<T>& );
99
100// class.cc
101template <class T>
102Substitution<T>& Substitution<T>::operator= ( const Substitution<T>& f )
103{
104    if ( this != &f ) {
105        _factor = f._factor;
106        _exp = f._exp;
107    }
108    return *this;
109}
110
111template <class T>
112Substitution<T>& Substitution<T>::operator= ( const T & f )
113{
114    _factor = f;
115    _exp = 1;
116    return *this;
117}
118
119#ifndef NOSTREAMIO
120template <class T>
121ostream& operator<< ( ostream & os, const Substitution<T> & a ) { return os; }
122#endif
123
124template <class T>
125int operator== ( const Substitution<T> &f1, const Substitution<T> &f2 )
126{
127    return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor());
128}
129
130    template class List<int>;
131    template class ListIterator<int>;
132
133    template class List<IntList>;
134    template class ListIterator<IntList>;
135
136    template class Substitution<CanonicalForm>;
137    template class Array<Variable>;
138    template class Array<int>;
139    typedef Substitution<CanonicalForm> SForm ;
140    template class List<SForm>;
141    template class ListIterator<SForm>;
142    template class List<Variable>;
143    template class ListIterator<Variable> ;
144
145    #ifndef __MWERKS__
146      template List<Variable> Union ( const List<Variable>&, const List<Variable>& );
147      template List<Variable> Difference ( const List<Variable>&, const List<Variable>& );
148
149      template List<CanonicalForm> Union ( const List<CanonicalForm>&, const List<CanonicalForm>& );
150      template List<CanonicalForm> Difference ( const List<CanonicalForm>&, const List<CanonicalForm>& );
151    #endif
152
153// for charsets:
154    template class List<CFList>;
155    template class ListIterator<CFList>;
156
157  #endif
158#endif
159
160#ifdef HAVE_FGLM
161// templates for fglm:
162
163  template class List<fglmSelem>;
164  template class ListIterator<fglmSelem>;
165
166  template class List<fglmDelem>;
167  template class ListIterator<fglmDelem>;
168#endif
169
170// ----------------------------------------------------------------------------
171//  kmatrix.cc
172//  begin of file
173//  Stephan Endrass, endrass@mathematik.uni-mainz.de
174//  23.7.99
175// ----------------------------------------------------------------------------
176
177#ifdef HAVE_SPECTRUM
178
179#ifdef   KMATRIX_PRINT
180#include <iostream.h>
181#ifndef   KMATRIX_IOSTREAM
182#include <stdio.h>
183#endif
184#endif
185
186#include "GMPrat.h"
187#include "kmatrix.h"
188
189template    class   KMatrix<Rational>;
190
191#ifdef   KMATRIX_PRINT
192template    ostream &   operator << ( ostream&,const KMatrix<Rational>& );
193template    static  void    print_rational( ostream&,int,const Rational& );
194#endif
195
196#endif /* HAVE_SPECTRUM */
197// ----------------------------------------------------------------------------
198//  kmatrix.cc
199//  end of file
200// ----------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.