本文整理汇总了C++中Point::Randomize方法的典型用法代码示例。如果您正苦于以下问题:C++ Point::Randomize方法的具体用法?C++ Point::Randomize怎么用?C++ Point::Randomize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point::Randomize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}