Skip to content

Commit

Permalink
Fixed get subkernel weights in CombinedKernel
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Jun 3, 2012
1 parent f91331a commit 71ddf75
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/shogun/kernel/CombinedKernel.cpp
Expand Up @@ -690,7 +690,11 @@ SGVector<float64_t> CCombinedKernel::get_subkernel_weights()
int32_t num=0;
const float64_t* w=get_subkernel_weights(num);

return SGVector<float64_t>((float64_t*) w, num);
float64_t* weights = SG_MALLOC(float64_t, num);
for (int32_t i=0; i<num; i++)
weights[i] = w[i];

return SGVector<float64_t>(weights, num);
}

void CCombinedKernel::set_subkernel_weights(SGVector<float64_t> weights)
Expand Down

0 comments on commit 71ddf75

Please sign in to comment.