Gromacs
2024.3
|
#include <gromacs/analysisdata/dataframe.h>
Value type wrapper for non-mutable access to a set of data column values.
Default copy constructor and assignment operator are used and work as intended. Typically new objects of this type are only constructed internally by the library and in classes that are derived from AbstractAnalysisData.
Methods in this class do not throw, but may contain asserts for incorrect usage.
The design of the interfaces is such that all objects of this type should be valid, i.e., header().isValid() should always return true.
Note that it is not possible to change the contents of an initialized object, except by assigning a new object to replace it completely.
Public Member Functions | |
AnalysisDataPointSetRef (const AnalysisDataFrameHeader &header, const AnalysisDataPointSetInfo &pointSetInfo, const AnalysisDataValuesRef &values) | |
Constructs a point set reference from given values. More... | |
AnalysisDataPointSetRef (const AnalysisDataFrameHeader &header, const std::vector< AnalysisDataValue > &values) | |
Constructs a point set reference from given values. More... | |
AnalysisDataPointSetRef (const AnalysisDataPointSetRef &points, int firstColumn, int columnCount) | |
Constructs a point set reference to a subset of columns. More... | |
const AnalysisDataFrameHeader & | header () const |
Returns the frame header for the frame of this point set. | |
int | frameIndex () const |
Returns zero-based index of the frame. More... | |
real | x () const |
Returns the x coordinate for the frame. More... | |
real | dx () const |
Returns error in the x coordinate for the frame (if applicable). More... | |
int | dataSetIndex () const |
Returns zero-based index of the dataset that this set is part of. | |
int | firstColumn () const |
Returns zero-based index of the first column included in this set. | |
int | columnCount () const |
Returns the number of columns included in this set. | |
int | lastColumn () const |
Returns zero-based index of the last column included in this set (inclusive). | |
const AnalysisDataValuesRef & | values () const |
Returns reference container for all values. More... | |
real | y (int i) const |
Returns data value for a column in this set. More... | |
real | dy (int i) const |
Returns error estimate for a column in this set if applicable. More... | |
bool | present (int i) const |
Returns whether a column is present in this set. More... | |
bool | allPresent () const |
Returns true if all points in this point set are present. More... | |
gmx::AnalysisDataPointSetRef::AnalysisDataPointSetRef | ( | const AnalysisDataFrameHeader & | header, |
const AnalysisDataPointSetInfo & | pointSetInfo, | ||
const AnalysisDataValuesRef & | values | ||
) |
Constructs a point set reference from given values.
[in] | header | Header for the frame. |
[in] | pointSetInfo | Information about the point set. |
[in] | values | Values for each column. |
The first element of the point set should be found from values
using the offset in pointSetInfo
.
gmx::AnalysisDataPointSetRef::AnalysisDataPointSetRef | ( | const AnalysisDataFrameHeader & | header, |
const std::vector< AnalysisDataValue > & | values | ||
) |
Constructs a point set reference from given values.
[in] | header | Header for the frame. |
[in] | values | Values for each column. |
The first element in values
should correspond to the first column.
gmx::AnalysisDataPointSetRef::AnalysisDataPointSetRef | ( | const AnalysisDataPointSetRef & | points, |
int | firstColumn, | ||
int | columnCount | ||
) |
Constructs a point set reference to a subset of columns.
[in] | points | Point set to use as source. |
[in] | firstColumn | First column index to include. |
[in] | columnCount | Number of columns to include. |
Creates a point set that contains columnCount
columns starting from firstColumn
from points
, or a subset if all requested columns are not present in points
. If the requested column range and the range in points
do not intersect, the result has columnCount() == 0.
firstColumn
is relative to the whole data set, i.e., not relative to points.firstColumn().
Mainly intended for internal use.
bool gmx::AnalysisDataPointSetRef::allPresent | ( | ) | const |
Returns true if all points in this point set are present.
That is, if present() would return true for all points.
|
inline |
Returns error in the x coordinate for the frame (if applicable).
All data do not provide error estimates. Typically returns zero in those cases.
Should not be called for invalid frames.
|
inline |
Returns error estimate for a column in this set if applicable.
[in] | i | Zero-based column index relative to firstColumn(). Should be >= 0 and < columnCount(). |
Currently, this method returns zero if the source data does not specify errors.
|
inline |
Returns zero-based index of the frame.
The return value is >= 0 for valid frames. Should not be called for invalid frames.
|
inline |
Returns whether a column is present in this set.
[in] | i | Zero-based column index relative to firstColumn(). Should be >= 0 and < columnCount(). |
If present(i) returns false, it is depends on the source data whether y(i) and/or dy(i) are defined.
|
inline |
Returns reference container for all values.
First value in the returned container corresponds to firstColumn().
|
inline |
Returns the x coordinate for the frame.
Should not be called for invalid frames.
|
inline |
Returns data value for a column in this set.
[in] | i | Zero-based column index relative to firstColumn(). Should be >= 0 and < columnCount(). |