本文整理汇总了C++中PointView::dims方法的典型用法代码示例。如果您正苦于以下问题:C++ PointView::dims方法的具体用法?C++ PointView::dims怎么用?C++ PointView::dims使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointView
的用法示例。
在下文中一共展示了PointView::dims方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkPoints
void DiffKernel::checkPoints(const PointView& source_data,
const PointView& candidate_data, MetadataNode errors)
{
uint32_t MAX_BADBYTES(20);
uint32_t badbytes(0);
// Both schemas have already been determined to be equal, so are the
// same size and in the same order.
Dimension::IdList const& sourceDims = source_data.dims();
Dimension::IdList const& candidateDims = candidate_data.dims();
char sbuf[8];
char cbuf[8];
for (PointId idx = 0; idx < source_data.size(); ++idx)
{
for (size_t d = 0; d < sourceDims.size(); ++d)
{
Dimension::Id sd = sourceDims[d];
Dimension::Id cd = candidateDims[d];
source_data.getRawField(sd, idx, (void *)sbuf);
candidate_data.getRawField(cd, idx, (void *)cbuf);
Dimension::Type t = Dimension::defaultType(cd);
size_t size = Dimension::size(t);
if (memcmp(sbuf, cbuf, size))
{
std::ostringstream oss;
oss << "Point " << idx << " differs for dimension \"" <<
Dimension::name(sd) << "\" for source and candidate";
errors.add("data.error", oss.str());
badbytes++;
}
}
if (badbytes > MAX_BADBYTES )
break;
}
}