00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef DJC_COROPA_LIBALGEBRA_POLYLIEH_SEEN
00015 #define DJC_COROPA_LIBALGEBRA_POLYLIEH_SEEN
00016
00017
00018
00020
00024
00025 template<typename SCA, typename RAT, DEG n_letters, DEG max_degree>
00026 class poly_lie : public algebra<poly_lie_basis<SCA, RAT, n_letters, max_degree> >
00027 {
00028 public:
00030 typedef typename poly_basis<SCA, RAT>::KEY POLYBASISKEY;
00032 typedef poly_lie_basis<SCA, RAT, n_letters, max_degree> BASIS;
00034 typedef typename BASIS::KEY KEY;
00036 typedef sparse_vector<BASIS> VECT;
00038 typedef algebra<BASIS> ALG;
00040 typedef typename ALG::iterator iterator;
00042 typedef typename ALG::const_iterator const_iterator;
00043 public:
00045 poly_lie(void) {}
00047 poly_lie(const poly_lie& l)
00048 : ALG(l) {}
00050 poly_lie(const ALG& a)
00051 : ALG(a) {}
00053 poly_lie(const VECT& v)
00054 : ALG(v) {}
00056 explicit poly_lie(LET x, LET y, DEG z)
00057 : ALG ()
00058 {
00059 POLYBASISKEY tempkey;
00060 tempkey[ y ] = z;
00061 ALG tempalg(KEY (x, tempkey));
00062 ALG:: swap(tempalg);
00063 }
00065 explicit poly_lie(const KEY& k)
00066 : ALG(k) {}
00068 explicit poly_lie(LET letter, const SCA& s)
00069 : ALG(VECT::basis.keyofletter(letter), s) {}
00070 public:
00072 inline friend poly_lie replace(const poly_lie& src, const std::vector<LET>& s, const std::vector<poly_lie*>& v)
00073 {
00074 poly_lie result;
00075 std::map<KEY, poly_lie> table;
00076 const_iterator i;
00077 for (i = src.begin(); i != src.end(); ++i)
00078 result.add_scal_prod(VECT::basis.replace(i->first, s, v, table), i->second);
00079 return result;
00080 }
00081 };
00082 #endif