本文整理汇总了C++中PWPath::Validate方法的典型用法代码示例。如果您正苦于以下问题:C++ PWPath::Validate方法的具体用法?C++ PWPath::Validate怎么用?C++ PWPath::Validate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PWPath
的用法示例。
在下文中一共展示了PWPath::Validate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NWDASimple
//.........这里部分代码省略.........
#if TRACE
Log("DA Simple: MAB=%.4g DAB=%.4g EAB=%.4g IAB=%.4g JAB=%.4g best=%c\n",
M, D, E, I, J, cEdgeType);
#endif
unsigned PLA = uLengthA;
unsigned PLB = uLengthB;
for (;;)
{
PWEdge Edge;
Edge.cType = XlatEdgeType(cEdgeType);
Edge.uPrefixLengthA = PLA;
Edge.uPrefixLengthB = PLB;
#if TRACE
Log("Prepend %c%d.%d\n", Edge.cType, PLA, PLB);
#endif
Path.PrependEdge(Edge);
switch (cEdgeType)
{
case 'M':
assert(PLA > 0);
assert(PLB > 0);
cEdgeType = TBM(PLA, PLB);
--PLA;
--PLB;
break;
case 'D':
assert(PLA > 0);
cEdgeType = TBD(PLA, PLB);
--PLA;
break;
case 'E':
assert(PLA > 0);
cEdgeType = TBE(PLA, PLB);
--PLA;
break;
case 'I':
assert(PLB > 0);
cEdgeType = TBI(PLA, PLB);
--PLB;
break;
case 'J':
assert(PLB > 0);
cEdgeType = TBJ(PLA, PLB);
--PLB;
break;
default:
Quit("Invalid edge %c", cEdgeType);
}
if (0 == PLA && 0 == PLB)
break;
}
Path.Validate();
// SCORE Score = TraceBack(PA, uLengthA, PB, uLengthB, DPM_, DPD_, DPI_, Path);
#if TRACE
SCORE scorePath = FastScorePath2(PA, uLengthA, PB, uLengthB, Path);
Path.LogMe();
Log("Score = %s Path = %s\n", LocalScoreToStr(BestScore), LocalScoreToStr(scorePath));
#endif
if (g_bKeepSimpleDP.get())
{
g_DPM.get() = DPM_;
g_DPD.get() = DPD_;
g_DPE.get() = DPE_;
g_DPI.get() = DPI_;
g_DPJ.get() = DPJ_;
g_TBM.get() = TBM_;
g_TBD.get() = TBD_;
g_TBE.get() = TBE_;
g_TBI.get() = TBI_;
g_TBJ.get() = TBJ_;
}
else
{
delete[] DPM_;
delete[] DPD_;
delete[] DPE_;
delete[] DPI_;
delete[] DPJ_;
delete[] TBM_;
delete[] TBD_;
delete[] TBE_;
delete[] TBI_;
delete[] TBJ_;
}
return BestScore;
}