source: git/Singular/claptmpl.cc @ 9c756f

spielwiese
Last change on this file since 9c756f was 41bcd7, checked in by Wilfred Pohl <pohl@…>, 26 years ago
substitute macintosh by __MWERKS__ git-svn-id: file:///usr/local/Singular/svn/trunk@1362 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.6 KB
Line 
1// emacs edit mode for this file is -*- C++ -*-
2/****************************************
3*  Computer Algebra System SINGULAR     *
4****************************************/
5// $Id: claptmpl.cc,v 1.14 1998-04-08 13:18:18 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    #endif
35
36    template class Factor<CanonicalForm>;
37    template class List<CFFactor>;
38    template class ListItem<CFFactor>;
39    template class ListItem<CanonicalForm>;
40    template class ListIterator<CFFactor>;
41    template class List<CanonicalForm>;
42    template class ListIterator<CanonicalForm>;
43    template class Array<CanonicalForm>;
44    template class List<MapPair>;
45    template class ListItem<MapPair>;
46    template class ListIterator<MapPair>;
47    template class Matrix<CanonicalForm>;
48    template class SubMatrix<CanonicalForm>;
49    template class Array<REvaluation>;
50
51    #ifndef __MWERKS__
52      template List<CFFactor> Union ( const List<CFFactor>&, const List<CFFactor>& );
53
54      template CanonicalForm tmax ( const CanonicalForm&, const CanonicalForm& );
55      template CanonicalForm tmin ( const CanonicalForm&, const CanonicalForm& );
56
57      template int tmax ( const int&, const int& );
58      template int tmin ( const int&, const int& );
59      template int tabs ( const int& );
60    #endif
61
62  #endif
63// place here your own template stuff, not instantiated by factory
64  #ifdef HAVE_LIBFAC_P
65    #include <factor.h>
66
67// class.h:
68template <class T>
69class Substitution {
70private:
71    T _factor;
72    T _exp;
73public:
74    Substitution() : _factor(1), _exp(0) {}
75    Substitution( const Substitution<T> & f ) : _factor(f._factor), _exp(f._exp) {}
76    Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {}
77    Substitution( const T & f ) : _factor(f), _exp(1) {}
78    ~Substitution() {}
79    Substitution<T>& operator= ( const Substitution<T>& );
80    Substitution<T>& operator= ( const T& );
81    T factor() const { return _factor; }
82    T exp() const { return _exp; }
83    friend int operator== ( const Substitution<T>&, const Substitution<T>& );
84};
85
86// class.cc
87template <class T>
88Substitution<T>& Substitution<T>::operator= ( const Substitution<T>& f )
89{
90    if ( this != &f ) {
91        _factor = f._factor;
92        _exp = f._exp;
93    }
94    return *this;
95}
96
97template <class T>
98Substitution<T>& Substitution<T>::operator= ( const T & f )
99{
100    _factor = f;
101    _exp = 1;
102    return *this;
103}
104
105template <class T>
106int operator== ( const Substitution<T> &f1, const Substitution<T> &f2 )
107{
108    return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor());
109}
110
111    template class List<int>;
112    template class ListIterator<int>;
113
114    template class List<IntList>;
115    template class ListIterator<IntList>;
116
117    template class Substitution<CanonicalForm>;
118    template class Array<Variable>;
119    template class Array<int>;
120    typedef Substitution<CanonicalForm> SForm ;
121    template class List<SForm>;
122    template class ListIterator<SForm>;
123    template class List<Variable>;
124    template class ListIterator<Variable> ;
125
126    #ifndef __MWERKS__
127      template List<Variable> Union ( const List<Variable>&, const List<Variable>& );
128      template List<Variable> Difference ( const List<Variable>&, const List<Variable>& );
129
130      template List<CanonicalForm> Union ( const List<CanonicalForm>&, const List<CanonicalForm>& );
131      template List<CanonicalForm> Difference ( const List<CanonicalForm>&, const List<CanonicalForm>& );
132    #endif
133
134// for charsets:
135    template class List<CFList>;
136    template class ListIterator<CFList>;
137
138  #endif
139#endif
140
141#ifdef HAVE_FGLM
142// templates for fglm:
143
144  template class List<fglmSelem>;
145  template class ListIterator<fglmSelem>;
146
147  template class List<fglmDelem>;
148  template class ListIterator<fglmDelem>;
149#endif
Note: See TracBrowser for help on using the repository browser.