当前位置: 首页>>代码示例>>C++>>正文


C++ AnalysisDataPointSetRef::firstColumn方法代码示例

本文整理汇总了C++中AnalysisDataPointSetRef::firstColumn方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisDataPointSetRef::firstColumn方法的具体用法?C++ AnalysisDataPointSetRef::firstColumn怎么用?C++ AnalysisDataPointSetRef::firstColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AnalysisDataPointSetRef的用法示例。


在下文中一共展示了AnalysisDataPointSetRef::firstColumn方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
开发者ID:gromacs,项目名称:gromacs,代码行数:34,代码来源:dataframe.cpp

示例2: checker

void
MockAnalysisDataModule::Impl::checkReferencePoints(
        const AnalysisDataPointSetRef &points)
{
    EXPECT_TRUE(frameChecker_.get() != NULL);
    if (frameChecker_.get() != NULL)
    {
        TestReferenceChecker checker(
                frameChecker_->checkCompound("DataValues", NULL));
        checker.checkInteger(points.columnCount(), "Count");
        if (checker.checkPresent(source_->dataSetCount() > 1, "DataSet"))
        {
            checker.checkInteger(points.dataSetIndex(), "DataSet");
        }
        const int  sourceColumnCount = source_->columnCount(points.dataSetIndex());
        const bool bAllColumns       = (points.firstColumn() == 0
                                        && points.columnCount() == sourceColumnCount);
        if (checker.checkPresent(!bAllColumns, "FirstColumn"))
        {
            checker.checkInteger(points.firstColumn(), "FirstColumn");
            checker.checkInteger(points.lastColumn(),  "LastColumn");
        }

        AnalysisDataValuesRef::const_iterator value;
        for (value = points.values().begin(); value != points.values().end(); ++value)
        {
            checkReferenceDataPoint(&checker, *value);
        }
    }
}
开发者ID:exianshine,项目名称:gromacs,代码行数:30,代码来源:mock_datamodule.cpp

示例3:

void
AnalysisDataDisplacementModule::pointsAdded(const AnalysisDataPointSetRef &points)
{
    if (points.firstColumn() % _impl->ndim != 0
        || points.columnCount() % _impl->ndim != 0)
    {
        GMX_THROW(APIError("Partial data points"));
    }
    for (int i = 0; i < points.columnCount(); ++i)
    {
        _impl->oldval[_impl->ci + points.firstColumn() + i] = points.y(i);
    }
}
开发者ID:alwanderer,项目名称:gromacs,代码行数:13,代码来源:displacement.cpp

示例4: value

void
AnalysisDataVectorPlotModule::pointsAdded(const AnalysisDataPointSetRef &points)
{
    if (points.firstColumn() % DIM != 0 || points.columnCount() % DIM != 0)
    {
        GMX_THROW(APIError("Partial data points"));
    }
    if (!isFileOpen())
    {
        return;
    }
    for (int i = 0; i < points.columnCount(); i += 3)
    {
        for (int d = 0; d < DIM; ++d)
        {
            if (bWrite_[i])
            {
                writeValue(points.values()[i + d]);
            }
        }
        if (bWrite_[DIM])
        {
            const rvec        y = { points.y(i), points.y(i + 1), points.y(i + 2) };
            AnalysisDataValue value(norm(y));
            writeValue(value);
        }
    }
}
开发者ID:aalhossary,项目名称:gromacs-HREMD,代码行数:28,代码来源:plot.cpp

示例5: 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));
        }
    }

}
开发者ID:alwanderer,项目名称:gromacs,代码行数:14,代码来源:frameaverager.cpp

示例6: 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;
        }
    }
}
开发者ID:hasagar,项目名称:gromacs,代码行数:15,代码来源:average.cpp

示例7: 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;
        }
    }
}
开发者ID:FoldingAtHome,项目名称:gromacs,代码行数:24,代码来源:lifetime.cpp


注:本文中的AnalysisDataPointSetRef::firstColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。