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

RDE_lib2/DataTree.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 #pragma once
00014 
00015 #ifndef DataTree_h__
00016 #define DataTree_h__
00017 
00018 
00019 #include <dyadic_interval.h>
00020 #include <map>
00021 
00022 template <typename my_alg_type>
00023 class Increment;
00024 
00026 
00029 template <typename my_alg_type>
00030 class FamilyConnections
00031 {
00032         typedef std::map < dyadic_interval, Increment<my_alg_type> > DataTree;
00033 
00034 public:         
00035         typename DataTree::iterator 
00036                 mitParent, 
00037                 mitSibling;
00038 
00041         FamilyConnections(
00042                 const typename DataTree::iterator itParent , 
00043                 const typename DataTree::iterator itSibling 
00044                 ): mitParent( itParent ), mitSibling( itSibling )
00045         {
00046         }
00047 };
00048 
00050 
00056 template <typename my_alg_type>
00057 class Increment : public FamilyConnections<my_alg_type>
00058 {
00059         typedef typename my_alg_type::TENSOR TENSOR;
00060         typedef typename my_alg_type::LIE LIE;
00061         typedef typename my_alg_type::MAPS MAPS;
00062         typedef typename my_alg_type::CBH CBH;
00063         typedef typename my_alg_type::SCA SCA;
00064         typedef typename my_alg_type::RAT RAT;
00065         typedef typename my_alg_type::S S;
00066         typedef typename my_alg_type::Q Q;
00067         typedef typename my_alg_type::DEG DEG;
00068         typedef typename my_alg_type::LET LET;
00069 
00070         static const unsigned DEPTH = my_alg_type::DEPTH;
00071         static const unsigned myDIM = my_alg_type::myDIM;
00072         static const unsigned ALPHABET_SIZE = my_alg_type::ALPHABET_SIZE;
00073 
00074 protected:
00076         LIE _LieValue;
00077         
00079         int _iAccuracy;
00080         
00081 
00082 public:
00084         Increment(
00085                 const dyadic_interval inc = dyadic_interval(), 
00086                 typename DataTree::iterator itParent = DataTree::iterator(), 
00087                 typename DataTree::iterator itSibling = DataTree::iterator() 
00088                 ) 
00089                 : FamilyConnections<my_alg_type>( itParent , itSibling ),_LieValue(),_iAccuracy(inc.n)          
00090         {
00091         }
00092 
00094         const LIE& LieValue() const { return _LieValue; } // needed to preserve external const-ness
00095         LIE& LieValue() { return _LieValue; } // needed because CBH is not const 
00096         
00098         void LieValue(LIE val) { _LieValue = val; }
00099         
00101         int Accuracy() const { return _iAccuracy; }
00102         
00104         void Accuracy(int val) { _iAccuracy = val; }
00105         
00109 
00110         static bool IsLeaf(const typename DataTree::const_iterator & itIncDescriptor)
00111         {
00112                 const dyadic_interval & 
00113                         diIncDescriptor = (itIncDescriptor->first);
00114                 const Increment<my_alg_type> & 
00115                         nvIncDescriptor = (itIncDescriptor->second);
00116                 return nvIncDescriptor.Accuracy()==diIncDescriptor.n;
00117         }
00118 };
00119 
00120 #endif // DataTree_h__

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