本文整理汇总了C++中PWPath::AppendEdge方法的典型用法代码示例。如果您正苦于以下问题:C++ PWPath::AppendEdge方法的具体用法?C++ PWPath::AppendEdge怎么用?C++ PWPath::AppendEdge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PWPath
的用法示例。
在下文中一共展示了PWPath::AppendEdge方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AppendRegPath
static void AppendRegPath(PWPath &Path, const PWPath &RegPath)
{
const unsigned uRegEdgeCount = RegPath.GetEdgeCount();
for (unsigned uRegEdgeIndex = 0; uRegEdgeIndex < uRegEdgeCount; ++uRegEdgeIndex)
{
const PWEdge &RegEdge = RegPath.GetEdge(uRegEdgeIndex);
Path.AppendEdge(RegEdge);
}
}
示例2: AllDeletes
static void AllDeletes(PWPath &Path, unsigned uLengthA)
{
Path.Clear();
PWEdge Edge;
Edge.cType = 'D';
Edge.uPrefixLengthB = 0;
for (unsigned uPrefixLengthA = 1; uPrefixLengthA <= uLengthA; ++uPrefixLengthA)
{
Edge.uPrefixLengthA = uPrefixLengthA;
Path.AppendEdge(Edge);
}
}
示例3: AllInserts
static void AllInserts(PWPath &Path, unsigned uLengthB)
{
Path.Clear();
PWEdge Edge;
Edge.cType = 'I';
Edge.uPrefixLengthA = 0;
for (unsigned uPrefixLengthB = 1; uPrefixLengthB <= uLengthB; ++uPrefixLengthB)
{
Edge.uPrefixLengthB = uPrefixLengthB;
Path.AppendEdge(Edge);
}
}
示例4: DiagToPath
static void DiagToPath(const Diag &d, PWPath &Path)
{
Path.Clear();
const unsigned uLength = d.m_uLength;
for (unsigned i = 0; i < uLength; ++i)
{
PWEdge Edge;
Edge.cType = 'M';
Edge.uPrefixLengthA = d.m_uStartPosA + i + 1;
Edge.uPrefixLengthB = d.m_uStartPosB + i + 1;
Path.AppendEdge(Edge);
}
}
示例5: EstringsToPath
void EstringsToPath(const short esA[], const short esB[], PWPath &Path)
{
Path.Clear();
unsigned iA = 0;
unsigned iB = 0;
int nA = esA[iA++];
int nB = esB[iB++];
unsigned uPrefixLengthA = 0;
unsigned uPrefixLengthB = 0;
for (;;)
{
char cType;
if (nA > 0)
{
if (nB > 0)
{
cType = 'M';
--nA;
--nB;
}
else if (nB < 0)
{
cType = 'D';
--nA;
++nB;
}
else
assert(false);
}
else if (nA < 0)
{
if (nB > 0)
{
cType = 'I';
++nA;
--nB;
}
else
assert(false);
}
else
assert(false);
switch (cType)
{
case 'M':
++uPrefixLengthA;
++uPrefixLengthB;
break;
case 'D':
++uPrefixLengthA;
break;
case 'I':
++uPrefixLengthB;
break;
}
PWEdge Edge;
Edge.cType = cType;
Edge.uPrefixLengthA = uPrefixLengthA;
Edge.uPrefixLengthB = uPrefixLengthB;
Path.AppendEdge(Edge);
if (nA == 0)
{
if (0 == esA[iA])
{
assert(0 == esB[iB]);
break;
}
nA = esA[iA++];
}
if (nB == 0)
nB = esB[iB++];
}
}