Gromacs  2016.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::AnalysisDataPointSetRef Class Reference

#include <gromacs/analysisdata/dataframe.h>

Description

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 AnalysisDataFrameHeaderheader () 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 AnalysisDataValuesRefvalues () 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...
 

Constructor & Destructor Documentation

gmx::AnalysisDataPointSetRef::AnalysisDataPointSetRef ( const AnalysisDataFrameHeader header,
const AnalysisDataPointSetInfo &  pointSetInfo,
const AnalysisDataValuesRef values 
)

Constructs a point set reference from given values.

Parameters
[in]headerHeader for the frame.
[in]pointSetInfoInformation about the point set.
[in]valuesValues 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.

Parameters
[in]headerHeader for the frame.
[in]valuesValues 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.

Parameters
[in]pointsPoint set to use as source.
[in]firstColumnFirst column index to include.
[in]columnCountNumber 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.

Member Function Documentation

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.

real gmx::AnalysisDataPointSetRef::dx ( ) const
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.

real gmx::AnalysisDataPointSetRef::dy ( int  i) const
inline

Returns error estimate for a column in this set if applicable.

Parameters
[in]iZero-based column index relative to firstColumn(). Should be >= 0 and < columnCount().

Currently, this method returns zero if the source data does not specify errors.

int gmx::AnalysisDataPointSetRef::frameIndex ( ) const
inline

Returns zero-based index of the frame.

The return value is >= 0 for valid frames. Should not be called for invalid frames.

bool gmx::AnalysisDataPointSetRef::present ( int  i) const
inline

Returns whether a column is present in this set.

Parameters
[in]iZero-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.

const AnalysisDataValuesRef& gmx::AnalysisDataPointSetRef::values ( ) const
inline

Returns reference container for all values.

First value in the returned container corresponds to firstColumn().

real gmx::AnalysisDataPointSetRef::x ( ) const
inline

Returns the x coordinate for the frame.

Should not be called for invalid frames.

real gmx::AnalysisDataPointSetRef::y ( int  i) const
inline

Returns data value for a column in this set.

Parameters
[in]iZero-based column index relative to firstColumn(). Should be >= 0 and < columnCount().

The documentation for this class was generated from the following files: