28 template<
class IntegrandClass,
class T>
41 const static double OneSixth = 1.0 / 6.0;
42 const static double OneThird = 1.0 / 3.0;
44 for (
int i = startPoint; i < endPoint; i++)
56 result(i + 1) = y + (OneSixth * (k1 + k4) + OneThird * (k2 + k3));
57 if (scale &&
mag(result(i + 1)) > 1.0e10)
58 for (
int j = startPoint; j <= endPoint; j++)
69 const static double OneSixth = 1.0 / 6.0;
70 const static double OneThird = 1.0 / 3.0;
72 for (
int i = startPoint; i > endPoint; i--)
84 result(i - 1) = y + (OneSixth * (k1 + k4) + OneThird * (k2 + k3));
85 if (scale &&
mag(result(i - 1)) > 1.0e10)
86 for (
int j = startPoint; j >= endPoint; j--)
95 if (endPoint > startPoint)
108 template<
class IntegrandClass>
117 int numVars = result.
cols();
122 const static double OneSixth = 1.0 / 6.0;
123 const static double OneThird = 1.0 / 3.0;
125 for (
int i = startPoint; i < endPoint; i++)
131 yplus = y + 0.5 * k1;
133 yplus = y + 0.5 * k2;
137 result(i + 1,
Range::all()) = y + (OneSixth * (k1 + k4) + OneThird * (k2 + k3));
143 int numVars = result.
cols();
148 const static double OneSixth = 1.0 / 6.0;
149 const static double OneThird = 1.0 / 3.0;
151 for (
int i = startPoint; i > endPoint; i--)
157 yplus = y + 0.5 * k1;
159 yplus = y + 0.5 * k2;
163 result(i - 1) = y + (OneSixth * (k1 + k4) + OneThird * (k2 + k3));
171 if (endPoint > startPoint)
RungeKutta(IntegrandClass &integrand)
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
Parent class for all grids.
void IntegrateForw(const Grid &grid, int startPoint, int endPoint, Array< T, 1 > &result, bool scale=true)
void IntegrateForw(const Grid &grid, int startPoint, int endPoint, Array< double, 2 > &result)
RungeKutta2(IntegrandClass &integrand)
IntegrandClass & Integrand
void IntegrateRev(const Grid &grid, int startPoint, int endPoint, Array< double, 2 > &result)
void Integrate(const Grid &grid, int startPoint, int endPoint, Array< T, 1 > &result, bool scale=true)
IntegrandClass & Integrand
void IntegrateRev(const Grid &grid, int startPoint, int endPoint, Array< T, 1 > &result, bool scale=true)
void Integrate(const Grid &grid, int startPoint, int endPoint, Array< double, 2 > &result)