Skip to content

Commit

Permalink
* fix seg fault when trying to do CV with no kernel initialized, * fi…
Browse files Browse the repository at this point in the history
…x indent
  • Loading branch information
iglesias committed Apr 3, 2012
1 parent efd2da9 commit ce07314
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions src/shogun/machine/KernelMachine.cpp
Expand Up @@ -586,6 +586,9 @@ CLabels* CKernelMachine::apply_locked(SGVector<index_t> indices)

void CKernelMachine::data_lock(CLabels* labs, CFeatures* features)
{
if ( !kernel )
SG_ERROR("The kernel is not initialized\n");

/* init kernel with data */
kernel->init(features, features);

Expand Down
18 changes: 9 additions & 9 deletions src/shogun/machine/KernelMachine.h
Expand Up @@ -50,15 +50,15 @@ class CKernelMachine : public CMachine
/** default constructor */
CKernelMachine();

/** Convenience constructor to initialize a trained kernel
* machine
*
* @param k kernel
* @param alphas vector of alpha weights
* @param svs indices of examples, i.e. i's for x_i
* @param b bias term
*/
CKernelMachine(CKernel* k, SGVector<float64_t> alphas, SGVector<int32_t> svs, float64_t b);
/** Convenience constructor to initialize a trained kernel
* machine
*
* @param k kernel
* @param alphas vector of alpha weights
* @param svs indices of examples, i.e. i's for x_i
* @param b bias term
*/
CKernelMachine(CKernel* k, SGVector<float64_t> alphas, SGVector<int32_t> svs, float64_t b);

/** copy constructor
* @param machine machine having parameters to copy
Expand Down

0 comments on commit ce07314

Please sign in to comment.