本文整理汇总了C++中Stat::print方法的典型用法代码示例。如果您正苦于以下问题:C++ Stat::print方法的具体用法?C++ Stat::print怎么用?C++ Stat::print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stat
的用法示例。
在下文中一共展示了Stat::print方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doAll
//.........这里部分代码省略.........
localResult[threadId][i] = Result{MAX_WEIGHT + 0.1, 0, 0};
#endif /* USE_COMPRESS */
for (vid_t i = vertexIds[threadId]; i < vertexIds[threadId + 1]; ++i) {
const eid_t startEdge = edgesIds[i];
const eid_t endEdge = edgesIds[i + 1];
vid_t minv = vertexCount, maxv = 0;
for (eid_t e = startEdge; e < endEdge; ++e) {
minv = std::min(minv, edges[e].dest);
maxv = std::max(maxv, edges[e].dest);
}
vertexBound[i] = pvv(minv, maxv);
maxWindowSize = std::max(maxWindowSize, maxv - minv);
sort(edges + startEdge, edges + endEdge, EdgeWeightCmp());
startEdgesIds[i] = edgesIds[i];
while (startEdgesIds[i] < edgesIds[i + 1] && edges[startEdgesIds[i]].dest == i) ++startEdgesIds[i];
}
}
}
void warmup() {
const int64_t iterationCount = 1e9;
#pragma omp parallel
{
volatile int64_t fpre = 0, fcur = 1;
stickThisThreadToCore(omp_get_thread_num());
for (int64_t i = iterationCount; i > 0; --i) {
int64_t fnext = fpre + fcur;
fpre = fcur;
fcur = fnext;
}
}
}
#ifndef ON_DISLAB
int main(int argc, char *argv[]) {
if (argc < 2) {
fprintf(stderr, "Usage: %s input\n", argv[0]);
return 1;
}
readAll(argv[1]);
warmup();
fprintf(stderr, "Done\n");
int64_t prepareTime = -currentNanoTime();
doPrepare();
prepareTime += currentNanoTime();
int64_t calcTime;
for (int i = 0; i < 1; ++i) {
memset(times, 0, sizeof(times));
calcTime = -currentNanoTime();
doReset();
if (doAll<0, 0>()) {
while (true) {
bool res = (2 <= iterationNumber && iterationNumber <= 4 && useMagicGlobal ? doAll<1, 1>() : doAll<1, 0>());
if (!res) break;
}
}
//while (doAll());
calcTime += currentNanoTime();
}
printf("%.10lf\n", double(taskResult));
fprintf(stderr, "%.3lf\n%.3lf\n", double(prepareTime) / 1e9, double(calcTime) / 1e9);
#if 1
for (int i = 0; i < iterationNumber; ++i) {
fprintf(stderr, "iteration %2d\n", i);
for (int j = 0; j < threadsCount; ++j) {
fprintf(stderr, "%02d: ", j);
for (int k = 0; k < 5; ++k)
fprintf(stderr, "%.6lf ", times[i][j][k]);
fputs("\n", stderr);
}
}
#endif
diedComps.print("Died comps:", "%8d ");
potentComps.print("Ptnt comps:", "%8d ");
catchComps.print("Cthd comps:", "%8d ");
return 0;
}
#else
void init_mst(graph_t *G) {
#ifndef USE_HYPERTHREADING
omp_set_num_threads(16);
#else
omp_set_num_threads(32);
#endif
convertAll(G);
warmup();
doPrepare();
doReset();
doAll<0, 0>();
doReset();
}