source: git/Singular/claptmpl.cc @ fdc537

spielwiese
Last change on this file since fdc537 was 6f640e, checked in by Hans Schönemann <hannes@…>, 24 years ago
*hannes: more c++-debug git-svn-id: file:///usr/local/Singular/svn/trunk@4411 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.23 2000-05-29 15:59:58 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 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    friend int operator== ( const Substitution<T>&, const Substitution<T>& );
94#ifndef NOSTREAMIO
95    friend ostream & operator <<(ostream &, const Substitution<T> &);
96#endif
97};
98
99// class.cc
100template <class T>
101Substitution<T>& Substitution<T>::operator= ( const Substitution<T>& f )
102{
103    if ( this != &f ) {
104        _factor = f._factor;
105        _exp = f._exp;
106    }
107    return *this;
108}
109
110template <class T>
111Substitution<T>& Substitution<T>::operator= ( const T & f )
112{
113    _factor = f;
114    _exp = 1;
115    return *this;
116}
117
118#ifndef NOSTREAMIO
119template <class T>
120ostream& operator<< ( ostream & os, const Substitution<T> & a ) { return os; }
121#endif
122
123template <class T>
124int operator== ( const Substitution<T> &f1, const Substitution<T> &f2 )
125{
126    return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor());
127}
128
129    template class List<int>;
130    template class ListIterator<int>;
131
132    template class List<IntList>;
133    template class ListIterator<IntList>;
134
135    template class Substitution<CanonicalForm>;
136    template class Array<Variable>;
137    template class Array<int>;
138    typedef Substitution<CanonicalForm> SForm ;
139    template class List<SForm>;
140    template class ListIterator<SForm>;
141    template class List<Variable>;
142    template class ListIterator<Variable> ;
143
144    #ifndef __MWERKS__
145      template List<Variable> Union ( const List<Variable>&, const List<Variable>& );
146      template List<Variable> Difference ( const List<Variable>&, const List<Variable>& );
147
148      template List<CanonicalForm> Union ( const List<CanonicalForm>&, const List<CanonicalForm>& );
149      template List<CanonicalForm> Difference ( const List<CanonicalForm>&, const List<CanonicalForm>& );
150    #endif
151
152// for charsets:
153    template class List<CFList>;
154    template class ListIterator<CFList>;
155
156  #endif
157#endif
158
159#ifdef HAVE_FGLM
160// templates for fglm:
161
162  template class List<fglmSelem>;
163  template class ListIterator<fglmSelem>;
164
165  template class List<fglmDelem>;
166  template class ListIterator<fglmDelem>;
167#endif
168
169// ----------------------------------------------------------------------------
170//  kmatrix.cc
171//  begin of file
172//  Stephan Endrass, endrass@mathematik.uni-mainz.de
173//  23.7.99
174// ----------------------------------------------------------------------------
175
176#ifdef HAVE_SPECTRUM
177
178#ifdef   KMATRIX_PRINT
179#include <iostream.h>
180#ifndef   KMATRIX_IOSTREAM
181#include <stdio.h>
182#endif
183#endif
184
185#include "GMPrat.h"
186#include "kmatrix.h"
187
188template    class   KMatrix<Rational>;
189
190#ifdef   KMATRIX_PRINT
191template    ostream &   operator << ( ostream&,const KMatrix<Rational>& );
192template    static  void    print_rational( ostream&,int,const Rational& );
193#endif
194
195#endif /* HAVE_SPECTRUM */
196// ----------------------------------------------------------------------------
197//  kmatrix.cc
198//  end of file
199// ----------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.