Skip to content

Commit

Permalink
fix wrong assertion in alphabet causing some model selection examples…
Browse files Browse the repository at this point in the history
… to fail
  • Loading branch information
Soeren Sonnenburg committed Sep 20, 2011
1 parent ff5f545 commit 8e32b0d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/shogun/features/Alphabet.cpp
Expand Up @@ -639,7 +639,13 @@ bool CAlphabet::check_alphabet_size(bool print_error)
void CAlphabet::copy_histogram(CAlphabet* a)
{
SGVector<int64_t> h=a->get_histogram();
ASSERT(h.vlen == sizeof(histogram));

if (h.vlen != sizeof(histogram)/sizeof(histogram[0]))
{
SG_ERROR("Histogram has %d elements, but %d elements where expected\n",
h.vlen, sizeof(histogram)/sizeof(histogram[0]));
}

memcpy(histogram, h.vector, sizeof(histogram));
}

Expand Down

0 comments on commit 8e32b0d

Please sign in to comment.