本文整理汇总了C++中AnalysisDataPointSetRef::present方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisDataPointSetRef::present方法的具体用法?C++ AnalysisDataPointSetRef::present怎么用?C++ AnalysisDataPointSetRef::present使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisDataPointSetRef
的用法示例。
在下文中一共展示了AnalysisDataPointSetRef::present方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addPoints
void AnalysisDataFrameAverager::addPoints(const AnalysisDataPointSetRef &points)
{
const int firstColumn = points.firstColumn();
GMX_ASSERT(static_cast<size_t>(firstColumn + points.columnCount()) <= values_.size(),
"Initialized with too few columns");
for (int i = 0; i < points.columnCount(); ++i)
{
if (points.present(i))
{
addValue(firstColumn + i, points.y(i));
}
}
}
示例2: value
void
AnalysisDataAverageModule::pointsAdded(const AnalysisDataPointSetRef &points)
{
int firstcol = points.firstColumn();
for (int i = 0; i < points.columnCount(); ++i)
{
if (points.present(i))
{
real y = points.y(i);
value(firstcol + i, 0) += y;
value(firstcol + i, 1) += y * y;
nsamples_[firstcol + i] += 1;
}
}
}
示例3:
void
AnalysisDataFrameAverageModule::pointsAdded(const AnalysisDataPointSetRef &points)
{
AnalysisDataStorageFrame &frame =
impl_->storage_.currentFrame(points.frameIndex());
for (int i = 0; i < points.columnCount(); ++i)
{
if (points.present(i))
{
const real y = points.y(i);
frame.value(0) += y;
impl_->sampleCount_ += 1;
}
}
}
示例4:
void
AnalysisDataFrameAverageModule::pointsAdded(const AnalysisDataPointSetRef &points)
{
const int dataSet = points.dataSetIndex();
AnalysisDataStorageFrame &frame =
impl_->storage_.currentFrame(points.frameIndex());
for (int i = 0; i < points.columnCount(); ++i)
{
if (points.present(i))
{
// TODO: Consider using AnalysisDataFrameAverager
const real y = points.y(i);
const real delta = y - frame.value(dataSet);
impl_->sampleCount_[dataSet] += 1;
frame.value(dataSet) += delta / impl_->sampleCount_[dataSet];
}
}
}
示例5: if
void
AnalysisDataLifetimeModule::pointsAdded(const AnalysisDataPointSetRef &points)
{
const int dataSet = points.dataSetIndex();
// This assumption is strictly not necessary, but this is how the
// framework works currently, and makes the code below simpler.
GMX_ASSERT(points.firstColumn() == 0
&& points.lastColumn() == static_cast<int>(impl_->currentLifetimes_[dataSet].size()) - 1,
"Point set should cover all columns");
for (int i = 0; i < points.columnCount(); ++i)
{
// TODO: Perhaps add control over how this is determined?
const bool bPresent = points.present(i) && points.y(i) > 0.0;
if (bPresent)
{
++impl_->currentLifetimes_[dataSet][i];
}
else if (impl_->currentLifetimes_[dataSet][i] > 0)
{
impl_->addLifetime(dataSet, impl_->currentLifetimes_[dataSet][i]);
impl_->currentLifetimes_[dataSet][i] = 0;
}
}
}