Commit 37d17745 authored by Davis King's avatar Davis King

Added missing dlib namespace

parent d93a02e8
......@@ -7,9 +7,11 @@
// ----------------------------------------------------------------------------------------
template <typename T, typename funct>
T impl_adapt_simp_stop(const funct& f, T a, T b, T fa, T fm, T fb, T is, int cnt)
namespace dlib
{
template <typename T, typename funct>
T impl_adapt_simp_stop(const funct& f, T a, T b, T fa, T fm, T fb, T is, int cnt)
{
const int MAXINT = 500;
T m = (a + b)/2.0;
......@@ -37,18 +39,18 @@ T impl_adapt_simp_stop(const funct& f, T a, T b, T fa, T fm, T fb, T is, int cnt
}
return Q;
}
}
// ----------------------------------------------------------------------------------------
template <typename T, typename funct>
T integrate_function_adapt_simp(
template <typename T, typename funct>
T integrate_function_adapt_simp(
const funct& f,
T a,
T b,
T tol = 1e-10
)
{
)
{
T eps = std::numeric_limits<T>::epsilon();
if(tol < eps)
{
......@@ -73,6 +75,7 @@ T integrate_function_adapt_simp(
int cnt = 0;
return impl_adapt_simp_stop(f, a, b, fa, fm, fb, is, cnt);
}
}
// ----------------------------------------------------------------------------------------
......
......@@ -3,14 +3,17 @@
#undef DLIB_INTEGRATE_FUNCTION_ADAPT_SIMPSON_ABSTRACT__
#ifdef DLIB_INTEGRATE_FUNCTION_ADAPT_SIMPSON_ABSTRACT__
template <typename T, typename funct>
T integrate_function_adapt_simp(
namespace dlib
{
template <typename T, typename funct>
T integrate_function_adapt_simp(
const funct& f,
T a,
T b,
T tol = 1e-10
);
/*!
);
/*!
requires
- b > a
- tol > 0
......@@ -21,9 +24,11 @@ T integrate_function_adapt_simp(
- returns an approximation of the integral of f over the domain [a,b] using the
adaptive Simpson method outlined in Gander, W. and W. Gautshi, "Adaptive
Quadrature -- Revisited" BIT, Vol. 40, (2000), pp.84-101
- tol is a tolerance parameter that determines the overall accuracy of approximated
integral. We suggest a default value of 1e-10 for tol.
!*/
- tol is a tolerance parameter that determines the overall accuracy of
approximated integral. We suggest a default value of 1e-10 for tol.
!*/
}
#endif // DLIB_INTEGRATE_FUNCTION_ADAPT_SIMPSON__
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment