本文整理汇总了C++中Point::GetScore方法的典型用法代码示例。如果您正苦于以下问题:C++ Point::GetScore方法的具体用法?C++ Point::GetScore怎么用?C++ Point::GetScore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point::GetScore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TrueRun
statscore_t RandomDirectionOptimizer::TrueRun(Point& P) const
{
statscore_t prevscore = P.GetScore();
// do specified number of random direction optimizations
unsigned int nrun = 0;
unsigned int nrun_no_change = 0;
for (; nrun_no_change < m_num_random_directions; nrun++, nrun_no_change++)
{
// choose a random direction in which to optimize
Point direction;
direction.Randomize();
//find the minimum on the line
statscore_t score = LineOptimize(P, direction, P);
if (verboselevel() > 4) {
cerr << "direction: " << direction << " => " << score;
cerr << " (" << (score-prevscore) << ")" << endl;
cerr << "\tending point: " << P << " => " << score << endl;
}
if (score-prevscore > kEPS)
nrun_no_change = 0;
prevscore = score;
}
if (verboselevel() > 2) {
cerr << "end Powell Algo, nrun=" << nrun << endl;
}
return prevscore;
}
示例2: Run
statscore_t Optimizer::Run(Point& P) const
{
if (!m_feature_data) {
cerr << "error trying to optimize without Features loaded" << endl;
exit(2);
}
if (!m_scorer) {
cerr << "error trying to optimize without a Scorer loaded" << endl;
exit(2);
}
if (m_scorer->getReferenceSize() != m_feature_data->size()) {
cerr << "error length mismatch between feature file and score file" << endl;
exit(2);
}
P.SetScore(GetStatScore(P));
if (verboselevel () > 2) {
cerr << "Starting point: " << P << " => " << P.GetScore() << endl;
}
statscore_t score = TrueRun(P);
// just in case its not done in TrueRun
P.SetScore(score);
if (verboselevel() > 2) {
cerr << "Ending point: " << P << " => " << score << endl;
}
return score;
}