CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

ExtendedButcherTableau.hh

Go to the documentation of this file.
00001 #ifndef _ExtendedButcherTableau_h_
00002 #define _ExtendedButcherTableau_h_
00003 // This class defines a ExtendedButcher Tableau, which completely specifies
00004 // an *embedded* Runge-Kutte integration scheme. ExtendedButcher Tableau 
00005 // are described in Numerical Methods for Ordinary Differential Equations, 
00006 // John Wiley & sons, West Sussex England.
00007 //
00008 // General form is :
00009 // 
00010 //      c|A
00011 //      ---
00012 //       |b^T
00013 //       |bHat^T
00014 //
00015 // where A is a matrix and b, bHat, and c are column vectors. 
00016 // 
00017 // The ExtendedButcher Tableau Class presents itself as an empty structure
00018 // that the user has to fill up.  One can blithely fill write into
00019 // any element of A, b, bHat or c. Space is automatically allocated.
00020 
00021 #include <vector>
00022 #include <string>
00023 namespace Genfun {
00024   class ExtendedButcherTableau {
00025     
00026   public:
00027     
00028     // Constructor:
00029     inline ExtendedButcherTableau(const std::string &name, unsigned int order, unsigned int orderHat);
00030     
00031     // Returns the name:
00032     inline const std::string & name() const;
00033     
00034     // Returns the order of the main formula
00035     inline unsigned int order() const;
00036 
00037     // Returns the order of the controlling formula
00038     inline unsigned int orderHat() const;
00039     
00040     // Returns the number of steps:
00041     inline unsigned int nSteps() const;
00042     
00043     // Write access to elements:
00044     inline double & A(unsigned int i, unsigned int j);
00045     inline double & b(unsigned int i);
00046     inline double & bHat(unsigned int i);
00047     inline double & c(unsigned int i);
00048     
00049     // Read access to elements (inline for speed)
00050     inline const double & A(unsigned int i, unsigned int j) const;
00051     inline const double & b(unsigned int i) const;
00052     inline const double & bHat(unsigned int i) const;
00053     inline const double & c(unsigned int i) const;
00054     
00055     
00056   private:
00057     
00058     std::vector< std::vector<double> > _A;
00059     std::vector<double>                _b;
00060     std::vector<double>                _bHat;
00061     std::vector<double>                _c;
00062     std::string                        _name;
00063     unsigned int                       _order;
00064     unsigned int                       _orderHat;
00065 
00066   };
00067 
00068 
00069   class HeunEulerXtTableau: public ExtendedButcherTableau {
00070     // Constructor:
00071   public:
00072     inline HeunEulerXtTableau();
00073   };
00074 
00075   class BogackiShampineXtTableau: public ExtendedButcherTableau {
00076     // Constructor:
00077   public:
00078     inline BogackiShampineXtTableau();
00079   };
00080 
00081   class FehlbergRK45F2XtTableau: public ExtendedButcherTableau {
00082     // Constructor:
00083   public:
00084     inline FehlbergRK45F2XtTableau();
00085   };
00086 
00087   class CashKarpXtTableau: public ExtendedButcherTableau {
00088     // Constructor:
00089   public:
00090     inline CashKarpXtTableau();
00091   };
00092 
00093 }
00094 
00095 inline std::ostream & operator << (std::ostream & o, const Genfun::ExtendedButcherTableau & b);
00096 
00097 
00098 #include "CLHEP/GenericFunctions/ExtendedButcherTableau.icc"
00099 
00100 #endif

Generated on 15 Nov 2012 for CLHEP by  doxygen 1.4.7