CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
CLHEP
GenericFunctions
CLHEP/GenericFunctions/ExtendedButcherTableau.hh
Go to the documentation of this file.
1
#ifndef _ExtendedButcherTableau_h_
2
#define _ExtendedButcherTableau_h_
3
// This class defines a ExtendedButcher Tableau, which completely specifies
4
// an *embedded* Runge-Kutte integration scheme. ExtendedButcher Tableau
5
// are described in Numerical Methods for Ordinary Differential Equations,
6
// John Wiley & sons, West Sussex England.
7
//
8
// General form is :
9
//
10
// c|A
11
// ---
12
// |b^T
13
// |bHat^T
14
//
15
// where A is a matrix and b, bHat, and c are column vectors.
16
//
17
// The ExtendedButcher Tableau Class presents itself as an empty structure
18
// that the user has to fill up. One can blithely fill write into
19
// any element of A, b, bHat or c. Space is automatically allocated.
20
21
#include <vector>
22
#include <string>
23
namespace
Genfun {
24
class
ExtendedButcherTableau
{
25
26
public
:
27
28
// Constructor:
29
inline
ExtendedButcherTableau
(
const
std::string &
name
,
unsigned
int
order
,
unsigned
int
orderHat
);
30
31
// Returns the name:
32
inline
const
std::string &
name
()
const
;
33
34
// Returns the order of the main formula
35
inline
unsigned
int
order
()
const
;
36
37
// Returns the order of the controlling formula
38
inline
unsigned
int
orderHat
()
const
;
39
40
// Returns the number of steps:
41
inline
unsigned
int
nSteps
()
const
;
42
43
// Write access to elements:
44
inline
double
&
A
(
unsigned
int
i,
unsigned
int
j);
45
inline
double
&
b
(
unsigned
int
i);
46
inline
double
&
bHat
(
unsigned
int
i);
47
inline
double
&
c
(
unsigned
int
i);
48
49
// Read access to elements (inline for speed)
50
inline
const
double
&
A
(
unsigned
int
i,
unsigned
int
j)
const
;
51
inline
const
double
&
b
(
unsigned
int
i)
const
;
52
inline
const
double
&
bHat
(
unsigned
int
i)
const
;
53
inline
const
double
&
c
(
unsigned
int
i)
const
;
54
55
56
private
:
57
58
std::vector< std::vector<double> > _A;
59
std::vector<double> _b;
60
std::vector<double> _bHat;
61
std::vector<double> _c;
62
std::string _name;
63
unsigned
int
_order;
64
unsigned
int
_orderHat;
65
66
};
67
68
69
class
HeunEulerXtTableau
:
public
ExtendedButcherTableau
{
70
// Constructor:
71
public
:
72
inline
HeunEulerXtTableau
();
73
};
74
75
class
BogackiShampineXtTableau
:
public
ExtendedButcherTableau
{
76
// Constructor:
77
public
:
78
inline
BogackiShampineXtTableau
();
79
};
80
81
class
FehlbergRK45F2XtTableau
:
public
ExtendedButcherTableau
{
82
// Constructor:
83
public
:
84
inline
FehlbergRK45F2XtTableau
();
85
};
86
87
class
CashKarpXtTableau
:
public
ExtendedButcherTableau
{
88
// Constructor:
89
public
:
90
inline
CashKarpXtTableau
();
91
};
92
93
}
94
95
inline
std::ostream &
operator <<
(std::ostream & o,
const
Genfun::ExtendedButcherTableau
&
b
);
96
97
98
#include "CLHEP/GenericFunctions/ExtendedButcherTableau.icc"
99
100
#endif
Generated on Mon May 6 2013 04:04:10 for CLHEP by
1.8.1.2