本文整理汇总了C++中States::traces_num方法的典型用法代码示例。如果您正苦于以下问题:C++ States::traces_num方法的具体用法?C++ States::traces_num怎么用?C++ States::traces_num使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类States
的用法示例。
在下文中一共展示了States::traces_num方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check_question_set
int SVM::check_question_set(States& qset) {
if (main_equation == NULL) return -1;
std::cout << " [" << qset.traces_num() << "]";
for (int i = 0; i < qset.p_index; i++) {
int pre = -1, cur = 0;
std::cout << ".";
//std::cout << "\t\t" << i << ">";
//gsets[QUESTION].print_trace(i);
for (int j = qset.index[i]; j < qset.index[i + 1]; j++) {
cur = Equation::calc(main_equation, qset.values[j]);
//std::cout << ((cur >= 0) ? "+" : "-");
if ((pre >= 0) && (cur < 0)) {
// deal with wrong question trace.
// Trace back to print out the whole trace and the predicted labels.
std::cerr << "\t\t[FAIL]\n \t Predict wrongly on Question traces." << std::endl;
qset.print_trace(i);
for (int j = qset.index[i]; j < qset.index[i + 1]; j++) {
cur = Equation::calc(main_equation, qset.values[j]);
std::cout << ((cur >= 0) ? "+" : "-");
}
std::cout << std::endl;
return -1;
}
pre = cur;
}
//std::cout << "END" << std::endl;
}
std::cout << " [PASS]";
return 0;
}