本文整理汇总了C++中ColPartition::ColumnWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ ColPartition::ColumnWidth方法的具体用法?C++ ColPartition::ColumnWidth怎么用?C++ ColPartition::ColumnWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ColPartition
的用法示例。
在下文中一共展示了ColPartition::ColumnWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddPartitionCoverageAndBox
// Adds the coverage, column count and box for a single partition,
// without adding it to the list. (Helper factored from ComputeCoverage.)
void ColPartitionSet::AddPartitionCoverageAndBox(const ColPartition& part) {
bounding_box_ += part.bounding_box();
int coverage = part.ColumnWidth();
if (part.good_width()) {
good_coverage_ += coverage;
good_column_count_ += 2;
} else {
if (part.blob_type() < BRT_UNKNOWN)
coverage /= 2;
if (part.good_column())
++good_column_count_;
bad_coverage_ += coverage;
}
}
示例2: AccumulateColumnWidthsAndGaps
// Accumulate the widths and gaps into the given variables.
void ColPartitionSet::AccumulateColumnWidthsAndGaps(int* total_width,
int* width_samples,
int* total_gap,
int* gap_samples) {
ColPartition_IT it(&parts_);
for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
ColPartition* part = it.data();
*total_width += part->ColumnWidth();
++*width_samples;
if (!it.at_last()) {
ColPartition* next_part = it.data_relative(1);
int gap = part->KeyWidth(part->right_key(), next_part->left_key());
*total_gap += gap;
++*gap_samples;
}
}
}