Skip to content

Commit

Permalink
Added an error message for add_subtask
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Aug 11, 2012
1 parent c561e46 commit dbc76e8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/shogun/transfer/multitask/Task.cpp
Expand Up @@ -75,6 +75,21 @@ bool CTask::is_contiguous()

void CTask::add_subtask(CTask* subtask)
{
SGVector<index_t> subtask_indices = subtask->get_indices();
for (int32_t i=0; i<subtask_indices.vlen; i++)
{
bool found = false;
for (int32_t j=0; j<m_indices.vlen; j++)
{
if (subtask_indices[i] == m_indices[j])
{
found = true;
break;
}
}
if (!found)
SG_ERROR("Subtask contains indices that are not contained in this task\n");
}
m_subtasks->append_element(subtask);
}

Expand Down

0 comments on commit dbc76e8

Please sign in to comment.