Changeset e3198f in git


Ignore:
Timestamp:
Feb 17, 2012, 6:56:06 PM (12 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
Children:
db349803eb432fe57368fae5b8e4ab74d05fb613
Parents:
26acab557e4ad73e2c8ba02fa1ad998773365fff
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2012-02-17 18:56:06+01:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2012-02-17 18:56:56+01:00
Message:
chg: use template instatiation from factory/libfac
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/claptmpl.cc

    r26acab5 re3198f  
    1616  #include <factory/templates/ftmpl_list.cc>
    1717  #include <kernel/fglm.h>
    18 
    19   #include <factory/templates/ftmpl_array.cc>
    20   #include <factory/templates/ftmpl_factor.cc>
    21   #include <factory/templates/ftmpl_functions.h>
    22   #include <factory/templates/ftmpl_matrix.cc>
    23 
    24   template class Factor<CanonicalForm>;
    25   template class List<CFFactor>;
    26   template class ListItem<CFFactor>;
    27   template class ListItem<CanonicalForm>;
    28   template class ListIterator<CFFactor>;
    29   template class List<CanonicalForm>;
    30   template class List<List<CanonicalForm> >;
    31   template class ListIterator<CanonicalForm>;
    32   template class Array<CanonicalForm>;
    33   template class List<MapPair>;
    34   template class ListItem<MapPair>;
    35   template class ListIterator<MapPair>;
    36   template class Matrix<CanonicalForm>;
    37   template class SubMatrix<CanonicalForm>;
    38   template class Array<REvaluation>;
    39   template bool find ( const List<CanonicalForm> &, const CanonicalForm&);
    40 
    41   //template class vector<poly>;
    42   #ifndef NOSTREAMIO
    43   template OSTREAM & operator<<(OSTREAM &, const List<Factor<CanonicalForm> > &);
    44   template OSTREAM & operator<<(OSTREAM &, const List<List<CanonicalForm> > &);
    45   template OSTREAM & operator<<(OSTREAM &, const List<Variable> &);
    46   template OSTREAM & operator<<(OSTREAM &, const Matrix<Variable> &);
    47   #endif
    48 
    49   template List<CFFactor> Union ( const List<CFFactor>&, const List<CFFactor>& );
    50   template int operator == ( const Factor<CanonicalForm>&, const Factor<CanonicalForm>& );
    51 
    52   template CanonicalForm tmax ( const CanonicalForm&, const CanonicalForm& );
    53   template CanonicalForm tmin ( const CanonicalForm&, const CanonicalForm& );
    54 
    55   template Variable tmax ( const Variable&, const Variable& );
    56   template Variable tmin ( const Variable&, const Variable& );
    57 
    58   template int tmax ( const int&, const int& );
    59   template int tmin ( const int&, const int& );
    60   template int tabs ( const int& );
    61 
    62   template CanonicalForm prod ( const List<CanonicalForm> & );
    63 
    64 // place here your own template stuff, not instantiated by factory
    65   // libfac:
    66 #ifdef HAVE_LIBFAC
    67 # include <factory/libfac/libfac.h>
    68 #endif
    69 
    70 // class.h:
    71 template <class T>
    72 class Substitution
    73 {
    74 private:
    75     T _factor;
    76     T _exp;
    77 public:
    78     Substitution() : _factor(1), _exp(0) {}
    79     Substitution( const Substitution<T> & f ) : _factor(f._factor), _exp(f._exp) {}
    80     Substitution( const T & f, const T & e ) : _factor(f), _exp(e) {}
    81     Substitution( const T & f ) : _factor(f), _exp(1) {}
    82     ~Substitution() {}
    83     Substitution<T>& operator= ( const Substitution<T>& );
    84     Substitution<T>& operator= ( const T& );
    85     T factor() const { return _factor; }
    86     T exp() const { return _exp; }
    87 #ifndef NOSTREAMIO
    88     //friend OSTREAM & operator <<<>(OSTREAM &, Substitution<T> &);
    89     void print ( OSTREAM& s ) const
    90     {
    91       s << "("  << factor() << ")^" << exp();
    92     }
    93 #endif
    94 };
    95 template <class T>
    96 int operator== ( const Substitution<T>&, const Substitution<T>& );
    97 
    98 // class.cc
    99 template <class T>
    100 Substitution<T>& Substitution<T>::operator= ( const Substitution<T>& f )
    101 {
    102     if ( this != &f ) {
    103         _factor = f._factor;
    104         _exp = f._exp;
    105     }
    106     return *this;
    107 }
    108 
    109 template <class T>
    110 Substitution<T>& Substitution<T>::operator= ( const T & f )
    111 {
    112     _factor = f;
    113     _exp = 1;
    114     return *this;
    115 }
    116 
    117 #ifndef NOSTREAMIO
    118 template <class T>
    119 OSTREAM & operator <<(OSTREAM & os, Substitution<T> &a)
    120 {
    121   a.print(os);
    122   return os;
    123 }
    124 template OSTREAM & operator <<(OSTREAM &, Substitution<CanonicalForm> &);
    125 template OSTREAM & operator <<(OSTREAM &, const List<CanonicalForm> &);
    126 template OSTREAM & operator <<(OSTREAM &, const Array<CanonicalForm> &);
    127 template OSTREAM & operator<<(OSTREAM &, const List<Substitution<CanonicalForm> > &);
    128 #endif
    129 
    130 template <class T>
    131 int operator== ( const Substitution<T> &f1, const Substitution<T> &f2 )
    132 {
    133     return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor());
    134 }
    135 
    136     template class List<int>;
    137     template class ListIterator<int>;
    138 
    139 #ifdef HAVE_LIBFAC
    140     template class List<IntList>;
    141     template class ListIterator<IntList>;
    142 #endif
    143 
    144     template class Substitution<CanonicalForm>;
    145     template class Array<Variable>;
    146     template class Array<int>;
    147     typedef Substitution<CanonicalForm> SForm ;
    148     template class List<SForm>;
    149     template class ListIterator<SForm>;
    150     template class List<Variable>;
    151     template class ListIterator<Variable> ;
    152 
    153     template List<Variable> Union ( const List<Variable>&, const List<Variable>& );
    154     template List<Variable> Difference ( const List<Variable>&, const List<Variable>& );
    155 
    156     template List<CanonicalForm> Union ( const List<CanonicalForm>&, const List<CanonicalForm>& );
    157     template List<CanonicalForm> Difference ( const List<CanonicalForm>&, const List<CanonicalForm>& );
    158 
    159 // for charsets:
    160     template class ListIterator<CFList>;
    16118
    16219// templates for fglm:
  • factory/libfac/factor/tmpl_inst.cc

    r26acab5 re3198f  
    11////////////////////////////////////////////////////////////
    22// emacs edit mode for this file is -*- C++ -*-
    3 // $Id$
    43////////////////////////////////////////////////////////////
    54
Note: See TracChangeset for help on using the changeset viewer.