本文整理汇总了C++中MatrixD::coeff方法的典型用法代码示例。如果您正苦于以下问题:C++ MatrixD::coeff方法的具体用法?C++ MatrixD::coeff怎么用?C++ MatrixD::coeff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatrixD
的用法示例。
在下文中一共展示了MatrixD::coeff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doBenchANNPriority
BenchResult doBenchANNPriority(const MatrixD& d, const MatrixD& q, const int K, const int itCount, const int searchCount)
{
BenchResult result;
boost::timer t;
const int ptCount(d.cols());
const double **pa = new const double *[d.cols()];
for (int i = 0; i < ptCount; ++i)
pa[i] = &d.coeff(0, i);
ANNkd_tree* ann_kdt = new ANNkd_tree(const_cast<double**>(pa), ptCount, d.rows(), 8);
result.creationDuration = t.elapsed();
for (int s = 0; s < searchCount; ++s)
{
t.restart();
ANNidx nnIdx[K];
ANNdist dists[K];
for (int i = 0; i < itCount; ++i)
{
const VectorD& tq(q.col(i));
ANNpoint queryPt(const_cast<double*>(&tq.coeff(0)));
ann_kdt->annkPriSearch( // search
queryPt, // query point
K, // number of near neighbours
nnIdx, // nearest neighbours (returned)
dists, // distance (returned)
0); // error bound
}
result.executionDuration += t.elapsed();
}
result.executionDuration /= double(searchCount);
return result;
}