コード例 #1
0
ファイル: dataframe.cpp プロジェクト: gromacs/gromacs
AnalysisDataPointSetRef::AnalysisDataPointSetRef(
        const AnalysisDataFrameHeader  &header,
        const AnalysisDataPointSetInfo &pointSetInfo,
        const AnalysisDataValuesRef    &values)
    : header_(header),
      dataSetIndex_(pointSetInfo.dataSetIndex()),
      firstColumn_(pointSetInfo.firstColumn()),
      values_(constArrayRefFromArray(&*values.begin() + pointSetInfo.valueOffset(),
                                     pointSetInfo.valueCount()))
{
    GMX_ASSERT(header_.isValid(),
               "Invalid point set reference should not be constructed");
}
コード例 #2
0
ファイル: arraydata.cpp プロジェクト: MelroLeandro/gromacs
AnalysisDataFrameRef
AbstractAnalysisArrayData::tryGetDataFrameInternal(int index) const
{
    if (!isAllocated())
    {
        return AnalysisDataFrameRef();
    }
    std::vector<AnalysisDataValue>::const_iterator begin
        = value_.begin() + index * columnCount();
    return AnalysisDataFrameRef(
            AnalysisDataFrameHeader(index, xvalue(index), 0.0),
            constArrayRefFromVector<AnalysisDataValue>(begin, begin + columnCount()),
            constArrayRefFromArray(&pointSetInfo_, 1));
}
コード例 #3
0
ファイル: dataframe.cpp プロジェクト: gromacs/gromacs
AnalysisDataFrameRef::AnalysisDataFrameRef(
        const AnalysisDataFrameRef &frame, int firstColumn, int columnCount)
    : header_(frame.header()),
      values_(constArrayRefFromArray(&frame.values_[firstColumn], columnCount)),
      pointSets_(frame.pointSets_)
{
    // FIXME: This doesn't produce a valid internal state, although it does
    // work in some cases. The point sets cannot be correctly managed here, but
    // need to be handles by the data proxy class.
    GMX_ASSERT(firstColumn >= 0, "Invalid first column");
    GMX_ASSERT(columnCount >= 0, "Invalid column count");
    GMX_ASSERT(pointSets_.size() == 1U,
               "Subsets of frames only supported with simple data");
    GMX_ASSERT(firstColumn + columnCount <= ssize(values_),
               "Invalid last column");
}