Commit 53074fc9 authored by Davis King's avatar Davis King

Added a compile time assert to hopefully simplify possible error messages.

parent b0cab391
......@@ -29,6 +29,14 @@ namespace dlib
const std::vector<std::vector<node_label> >& labels
)
{
typedef typename graph_type::type node_vector_type;
typedef typename graph_type::edge_type edge_vector_type;
// The graph must use all dense vectors or all sparse vectors. It can't mix the two types together.
COMPILE_TIME_ASSERT( (is_matrix<node_vector_type>::value && is_matrix<edge_vector_type>::value) ||
(!is_matrix<node_vector_type>::value && !is_matrix<edge_vector_type>::value));
if (!is_learning_problem(samples, labels))
return false;
......
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