• Main Page
  • Namespaces
  • Classes
  • Files
  • File List

libalgebra-demo/libalgebra/lie.h

00001 /* *************************************************************
00002 
00003 Copyright 2010 Terry Lyons, Stephen Buckley, Djalil Chafai, 
00004 Greg Gyurkó and Arend Janssen. 
00005 
00006 Distributed under the terms of the GNU General Public License, 
00007 Version 3. (See accompanying file License.txt)
00008 
00009 ************************************************************* */
00010 
00011 
00012 
00013 
00014 //  lie.h
00015 
00016 
00017 // Include once wrapper
00018 #ifndef DJC_COROPA_LIBALGEBRA_LIEH_SEEN
00019 #define DJC_COROPA_LIBALGEBRA_LIEH_SEEN
00020 
00022 
00034 template<typename SCA, typename RAT, DEG n_letters, DEG max_degree>
00035 class lie : public algebra<lie_basis<SCA, RAT, n_letters, max_degree> >
00036 {
00037 public:
00039         typedef lie_basis<SCA, RAT, n_letters, max_degree> BASIS;
00041         typedef typename BASIS::KEY KEY;
00043         typedef sparse_vector<BASIS> VECT;
00045         typedef algebra<BASIS> ALG;
00047         typedef typename ALG::iterator iterator;
00049         typedef typename ALG::const_iterator const_iterator;
00050 public:
00052         lie(void) {}
00054         lie(const lie& l)
00055                 : ALG(l) {}
00057         lie(const ALG& a)
00058                 : ALG(a) {}
00060         lie(const VECT& v)
00061                 : ALG(v) {}
00063         explicit lie(const KEY& k)
00064                 : ALG(k) {}
00066         explicit lie(LET letter, const SCA& s)
00067                 : ALG(VECT::basis.keyofletter(letter), s) {}
00068 public:
00070         inline friend lie replace(const lie& src, const std::vector<LET>& s, const std::vector<lie*>& v)        
00071         {
00072                 lie result;
00073                 std::map<KEY, lie> table;
00074                 const_iterator i;
00075                 for (i = src.begin(); i != src.end(); ++i)
00076                         result.add_scal_prod(VECT::basis.replace(i->first, s, v, table), i->second);
00077                 return result;
00078         }
00079 };
00080 
00081 // Include once wrapper
00082 #endif // DJC_COROPA_LIBALGEBRA_LIEH_SEEN
00083 
00084 //EOF.

Generated on Fri Jan 14 2011 17:50:33 for Rough Differential Equation Solver by  doxygen 1.7.1