本文整理汇总了C++中Arc::next方法的典型用法代码示例。如果您正苦于以下问题:C++ Arc::next方法的具体用法?C++ Arc::next怎么用?C++ Arc::next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Arc
的用法示例。
在下文中一共展示了Arc::next方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printArcProbs
void printArcProbs(std::ostream& resStream, int nSamples, int nStepsPerSample,
bool printSamples = false) {
//ParentsetMap<Real> transScores;
ArcMap<double> cumArcProbs(pof_.n);
ArcMap<Real> arcUnnormProbs(pof_.n);
cumArcProbs.setAll(0.0);
for (int i = 0; i < nSamples; ++i) {
for (int j = 0; j < nStepsPerSample; ++j) {
//nAccepts += po_.mcmcPOStep(scores_, marginUnnormProb_);
//nAccepts += po_.mcmcPOStep(marginProbComputer, marginUnnormProb_);
//nAccepts += mcmcStep();
//nAccepts += po_.mcmcPOStep(probComputer, marginUnnormProb_);
//++nSteps;
mcmcStep();
}
//translateParentsetMap(pof_, subsetDirectory_, po_, scores_, transScores);
calcUnnormArcProbs(pof_, scores_, po_, arcUnnormProbs);
//probComputer.calcUnnormArcProbs(po_, arcUnnormProbs);
//Arc arct;
//arct.head = po_.getIndex(arc.head);
//arct.tail = po_.getIndex(arc.tail);
//Real arcUnnormProb = calcUnnormProb(pof_, subsetDirectory_, transScores, po_, arct);
Arc arc; arc.setFirst();
do {
double p = to<double>(arcUnnormProbs[arc] / marginUnnormProb_);
if (printSamples)
resStream << " " << p;
cumArcProbs[arc] += p;
} while (arc.next(pof_.n));
if (printSamples) {
resStream << std::endl;
}
}
if (!printSamples) {
Arc arc; arc.setFirst();
do {
double p = cumArcProbs[arc] / nSamples;
resStream << arc << " " << p << std::endl;
} while (arc.next(pof_.n));
}
}
示例2: printAllProbs
void printAllProbs(std::ostream& resStream) {
Arc arc; arc.setFirst();
do {
double p = calcProb(arc);
resStream << arc << " " << p << std::endl;
} while (arc.next(pof_.n));
}