本文整理汇总了C++中Trail::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Trail::size方法的具体用法?C++ Trail::size怎么用?C++ Trail::size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Trail
的用法示例。
在下文中一共展示了Trail::size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: borderDetailedAlignMatrix
// Fills the complement of the radius of the trail with minus infties.
// The return value true means success. Failure means that during the fill,
// we intersected the outside of the quasidiagonal area.
// In this case, the operation is not finished.
bool borderDetailedAlignMatrix( AlignMatrix& alignMatrix, const Trail& trail, int radius )
{
int huBookSize = alignMatrix.size();
int enBookSize = alignMatrix.otherSize();
int huPos, enPos;
for ( huPos=0; huPos<huBookSize; ++huPos )
{
int rowStart = alignMatrix.rowStart(huPos);
int rowEnd = alignMatrix.rowEnd(huPos);
for ( enPos=rowStart; enPos<rowEnd; ++enPos )
{
alignMatrix.cell(huPos,enPos) = outsideOfRadiusValue;
}
}
// We seriously use the fact that many-to-zero segments are subdivided into one-to-zero segments.
// Inside setBox, an exception is thrown if we try to write outside the quasidiagonal.
// If we catch such an exception, it means that the quasidiagonal is not thick enough.
// In this case, we abandon the whole align, just to be sure.
try
{
for ( int i=0; i<trail.size(); ++i )
{
setBox( alignMatrix, trail[i].first, trail[i].second, radius, insideOfRadiusValue );
}
}
catch ( const char* errorType )
{
massert( std::string(errorType) == "out of quasidiagonal" )
return false;
}
bool verify = true;
if (verify)
{
int numberOfEvaluatedItems(0);
for ( huPos=0; huPos<huBookSize; ++huPos )
{
int rowStart = alignMatrix.rowStart(huPos);
int rowEnd = alignMatrix.rowEnd(huPos);
for ( enPos=rowStart; enPos<rowEnd; ++enPos )
{
if (alignMatrix[huPos][enPos]==insideOfRadiusValue)
{
++numberOfEvaluatedItems;
}
}
}
std::cerr << numberOfEvaluatedItems << " items inside the border." << std::endl;
}
return true;
}
示例2: scoreTrailOrBisentenceList
// A bit of an abuse of the fact that Trail and BisentenceList are typedef'd to the same structure.
double scoreTrailOrBisentenceList( const Trail& trailAuto, const Trail& trailHand )
{
int score = countIntersectionOfTrails( trailAuto, trailHand );
std::cerr << trailAuto.size()-score << " misaligned out of " << trailHand.size() << " correct items, "
<< trailAuto.size() << " bets." << std::endl;
std::cerr << "Precision: " << 1.0*score/trailAuto.size()
<< ", Recall: " << 1.0*score/trailHand.size() << std::endl;
double ratio = 1.0*(trailAuto.size()-score)/trailAuto.size();
return ratio;
}
示例3: trailToBisentenceList
void trailToBisentenceList( const Trail& bestTrail,
BisentenceList& bisentenceList )
{
bisentenceList.clear();
int trailSize = bestTrail.size();
for ( int pos=0; pos<trailSize-1; ++pos )
{
if ( oneToOne(bestTrail,pos) )
{
bisentenceList.push_back(bestTrail [pos]);
}
}
}
示例4: DrawTrail
void DrawTrail(const Trail& tr, const Graph& g)
{
if (tr.empty())
{
return;
}
int prev = tr[0];
for (unsigned int i = 1; i < tr.size(); i++)
{
const GraphEdge& edge = g.GetEdge(tr[i], prev);
prev = tr[i];
DrawEdge(edge, g);
}
}