本文整理汇总了C++中AnalysisDataPointSetRef::header方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisDataPointSetRef::header方法的具体用法?C++ AnalysisDataPointSetRef::header怎么用?C++ AnalysisDataPointSetRef::header使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisDataPointSetRef
的用法示例。
在下文中一共展示了AnalysisDataPointSetRef::header方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AnalysisDataValuesRef
AnalysisDataPointSetRef::AnalysisDataPointSetRef(
const AnalysisDataPointSetRef &points, int firstColumn, int columnCount)
: header_(points.header()), dataSetIndex_(points.dataSetIndex()),
firstColumn_(0)
{
GMX_ASSERT(firstColumn >= 0, "Invalid first column");
GMX_ASSERT(columnCount >= 0, "Invalid column count");
if (points.lastColumn() < firstColumn
|| points.firstColumn() >= firstColumn + columnCount
|| columnCount == 0)
{
return;
}
AnalysisDataValuesRef::const_iterator begin = points.values().begin();
int pointsOffset = firstColumn - points.firstColumn();
if (pointsOffset > 0)
{
// Offset pointer if the first column is not the first in points.
begin += pointsOffset;
}
else
{
// Take into account if first column is before the first in points.
firstColumn_ = -pointsOffset;
columnCount -= -pointsOffset;
}
// Decrease column count if there are not enough columns in points.
AnalysisDataValuesRef::const_iterator end = begin + columnCount;
if (pointsOffset + columnCount > points.columnCount())
{
end = points.values().end();
}
values_ = AnalysisDataValuesRef(begin, end);
}