source: git/Singular/claptmpl.cc @ 111cfe

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