本文整理汇总了C++中CKernel::has_property方法的典型用法代码示例。如果您正苦于以下问题:C++ CKernel::has_property方法的具体用法?C++ CKernel::has_property怎么用?C++ CKernel::has_property使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKernel
的用法示例。
在下文中一共展示了CKernel::has_property方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compute_batch
void CCombinedKernel::compute_batch(
int32_t num_vec, int32_t* vec_idx, float64_t* result, int32_t num_suppvec,
int32_t* IDX, float64_t* weights, float64_t factor)
{
ASSERT(num_vec<=get_num_vec_rhs())
ASSERT(num_vec>0);
ASSERT(vec_idx);
ASSERT(result);
//we have to do the optimization business ourselves but lets
//make sure we start cleanly
delete_optimization();
CListElement* current = NULL ;
CKernel * k = get_first_kernel(current) ;
while(k)
{
if (k && k->has_property(KP_BATCHEVALUATION))
{
if (k->get_combined_kernel_weight()!=0)
k->compute_batch(num_vec, vec_idx, result, num_suppvec, IDX, weights, k->get_combined_kernel_weight());
}
else
emulate_compute_batch(k, num_vec, vec_idx, result, num_suppvec, IDX, weights);
SG_UNREF(k);
k = get_next_kernel(current);
}
//clean up
delete_optimization();
}
示例2: delete_optimization
bool CCombinedKernel::delete_optimization()
{
CListElement* current = NULL ;
CKernel* k = get_first_kernel(current);
while(k)
{
if (k->has_property(KP_LINADD))
k->delete_optimization();
SG_UNREF(k);
k = get_next_kernel(current);
}
SG_FREE(sv_idx);
sv_idx = NULL;
SG_FREE(sv_weight);
sv_weight = NULL;
sv_count = 0;
set_is_initialized(false);
return true;
}