Commit 67ae00b4 authored by Davis King's avatar Davis King

Added missing assert

parent 37d17745
......@@ -4,6 +4,7 @@
#define DLIB_INTEGRATE_FUNCTION_ADAPT_SIMPSON__
#include "integrate_function_adapt_simpson_abstract.h"
#include "../assert.h"
// ----------------------------------------------------------------------------------------
......@@ -51,6 +52,15 @@ namespace dlib
T tol = 1e-10
)
{
// make sure requires clause is not broken
DLIB_ASSERT(b > a && tol > 0,
"\t T integrate_function_adapt_simp()"
<< "\n\t Invalid arguments were given to this function."
<< "\n\t a: " << a
<< "\n\t b: " << b
<< "\n\t tol: " << tol
);
T eps = std::numeric_limits<T>::epsilon();
if(tol < eps)
{
......
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