Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
53074fc9
Commit
53074fc9
authored
May 05, 2012
by
Davis King
Browse files
Added a compile time assert to hopefully simplify possible error messages.
parent
b0cab391
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
dlib/svm/structural_svm_graph_labeling_problem.h
dlib/svm/structural_svm_graph_labeling_problem.h
+8
-0
No files found.
dlib/svm/structural_svm_graph_labeling_problem.h
View file @
53074fc9
...
@@ -29,6 +29,14 @@ namespace dlib
...
@@ -29,6 +29,14 @@ namespace dlib
const
std
::
vector
<
std
::
vector
<
node_label
>
>&
labels
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
))
if
(
!
is_learning_problem
(
samples
,
labels
))
return
false
;
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment