Commit db07f07d authored by Davis King's avatar Davis King

Made the asserts that checks if the inputs to the optimization functions are

column vectors always enabled since violating this is a common user error.
parent 382c3d97
......@@ -184,7 +184,7 @@ namespace dlib
// The starting point (i.e. x) must be a column vector.
COMPILE_TIME_ASSERT(T::NC <= 1);
DLIB_ASSERT (
DLIB_CASSERT (
is_col_vector(x),
"\tdouble find_min()"
<< "\n\tYou have to supply column vectors to this function"
......@@ -244,7 +244,7 @@ namespace dlib
// The starting point (i.e. x) must be a column vector.
COMPILE_TIME_ASSERT(T::NC <= 1);
DLIB_ASSERT (
DLIB_CASSERT (
is_col_vector(x),
"\tdouble find_max()"
<< "\n\tYou have to supply column vectors to this function"
......@@ -311,7 +311,7 @@ namespace dlib
// The starting point (i.e. x) must be a column vector.
COMPILE_TIME_ASSERT(T::NC <= 1);
DLIB_ASSERT (
DLIB_CASSERT (
is_col_vector(x) && derivative_eps > 0,
"\tdouble find_min_using_approximate_derivatives()"
<< "\n\tYou have to supply column vectors to this function"
......@@ -374,7 +374,7 @@ namespace dlib
// The starting point (i.e. x) must be a column vector.
COMPILE_TIME_ASSERT(T::NC <= 1);
DLIB_ASSERT (
DLIB_CASSERT (
is_col_vector(x) && derivative_eps > 0,
"\tdouble find_max_using_approximate_derivatives()"
<< "\n\tYou have to supply column vectors to this function"
......@@ -478,7 +478,7 @@ namespace dlib
// The starting point (i.e. x) must be a column vector.
COMPILE_TIME_ASSERT(T::NC <= 1);
DLIB_ASSERT (
DLIB_CASSERT (
is_col_vector(x) && is_col_vector(x_lower) && is_col_vector(x_upper) &&
x.size() == x_lower.size() && x.size() == x_upper.size(),
"\tdouble find_min_box_constrained()"
......@@ -602,7 +602,7 @@ namespace dlib
// The starting point (i.e. x) must be a column vector.
COMPILE_TIME_ASSERT(T::NC <= 1);
DLIB_ASSERT (
DLIB_CASSERT (
is_col_vector(x) && is_col_vector(x_lower) && is_col_vector(x_upper) &&
x.size() == x_lower.size() && x.size() == x_upper.size(),
"\tdouble find_max_box_constrained()"
......
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