Makes handling of analysis data values simpler and more uniform.
Mainly changed internal representation of the data values in the
analysisdata module, and added extra methods to access those directly
from the public interface in dataframe.h. It should be considered
whether old access methods (y(), dy(), present()) are needed any longer,
but this may wait.
Related to issue #827.
Change-Id: I4b12b4cd12de9a874e0ff4d3267ff779360a0f7a
AnalysisDataFrameRef
AbstractAnalysisArrayData::tryGetDataFrameInternal(int index) const
{
- return AnalysisDataFrameRef(index, xvalue(index), 0.0, columnCount(),
- &_value[index * columnCount()], NULL, NULL);
+ if (!isAllocated())
+ {
+ return AnalysisDataFrameRef();
+ }
+ std::vector<AnalysisDataValue>::const_iterator begin
+ = _value.begin() + index * columnCount();
+ return AnalysisDataFrameRef(
+ AnalysisDataFrameHeader(index, xvalue(index), 0.0),
+ AnalysisDataValuesRef(begin, begin + columnCount()));
}
GMX_RELEASE_ASSERT(rowCount() > 0 && columnCount() > 0,
"Row and column counts must be set before allocating values");
_value.resize(rowCount() * columnCount());
+ std::vector<AnalysisDataValue>::iterator i;
+ for (i = _value.begin(); i != _value.end(); ++i)
+ {
+ i->setValue(0.0);
+ }
}
}
_bReady = true;
+ std::vector<AnalysisDataValue>::const_iterator valueIter = _value.begin();
notifyDataStart();
- for (int i = 0; i < rowCount(); ++i)
+ for (int i = 0; i < rowCount(); ++i, valueIter += columnCount())
{
AnalysisDataFrameHeader header(i, xvalue(i), 0);
notifyFrameStart(header);
- notifyPointsAdd(AnalysisDataPointSetRef(header, 0, columnCount(),
- &_value[i * columnCount()],
- NULL, NULL));
+ notifyPointsAdd(AnalysisDataPointSetRef(header, 0,
+ AnalysisDataValuesRef(valueIter,
+ valueIter + columnCount())));
notifyFrameFinish(header);
}
notifyDataFinish();
#ifndef GMX_ANALYSISDATA_ARRAYDATA_H
#define GMX_ANALYSISDATA_ARRAYDATA_H
-#include <cstddef>
-
#include <vector>
#include "../fatalerror/gmxassert.h"
#include "abstractdata.h"
+#include "dataframe.h"
namespace gmx
{
* should initialize the in-memory array through the provided protected member
* functions.
*
+ * \todo
+ * Add methods to take full advantage of AnalysisDataValue features.
+ *
* \inlibraryapi
* \ingroup module_analysisdata
*/
GMX_ASSERT(row >= 0 && row < rowCount(), "Row index out of range");
GMX_ASSERT(col >= 0 && col < columnCount(), "Column index out of range");
GMX_ASSERT(isAllocated(), "Data array not allocated");
- return _value[row * columnCount() + col];
+ return _value[row * columnCount() + col].value();
}
protected:
GMX_ASSERT(row >= 0 && row < rowCount(), "Row index out of range");
GMX_ASSERT(col >= 0 && col < columnCount(), "Column index out of range");
GMX_ASSERT(isAllocated(), "Data array not allocated");
- return _value[row * columnCount() + col];
+ return _value[row * columnCount() + col].value();
}
/*! \brief
* Sets the value of an element in the array.
virtual bool requestStorageInternal(int nframes);
int _nrows;
- std::vector<real> _value;
+ std::vector<AnalysisDataValue> _value;
real _xstart;
real _xstep;
bool _bReady;
*/
AnalysisDataPointSetRef::AnalysisDataPointSetRef(
- int index, real x, real dx, int firstColumn, int columnCount,
- const real *y, const real *dy, const bool *present)
- : header_(index, x, dx), firstColumn_(firstColumn), columnCount_(columnCount),
- y_(y), dy_(dy), present_(present)
+ const AnalysisDataFrameHeader &header, int firstColumn,
+ const AnalysisDataValuesRef &values)
+ : header_(header), firstColumn_(firstColumn), values_(values)
{
+ GMX_ASSERT(header_.isValid(),
+ "Invalid point set reference should not be constructed");
GMX_ASSERT(firstColumn >= 0, "Invalid first column");
- GMX_ASSERT(columnCount >= 0, "Invalid column count");
- GMX_ASSERT(columnCount == 0 || y_ != NULL,
- "Values must be provided if there are columns");
}
AnalysisDataPointSetRef::AnalysisDataPointSetRef(
- const AnalysisDataFrameHeader &header, int firstColumn, int columnCount,
- const real *y, const real *dy, const bool *present)
- : header_(header), firstColumn_(firstColumn), columnCount_(columnCount),
- y_(y), dy_(dy), present_(present)
+ const AnalysisDataFrameHeader &header,
+ const std::vector<AnalysisDataValue> &values)
+ : header_(header), firstColumn_(0), values_(values.begin(), values.end())
{
- GMX_ASSERT(firstColumn >= 0, "Invalid first column");
- GMX_ASSERT(columnCount >= 0, "Invalid column count");
- GMX_ASSERT(columnCount == 0 || y_ != NULL,
- "Values must be provided if there are columns");
+ GMX_ASSERT(header_.isValid(),
+ "Invalid point set reference should not be constructed");
}
AnalysisDataPointSetRef::AnalysisDataPointSetRef(
const AnalysisDataPointSetRef &points, int firstColumn, int columnCount)
- : header_(points.header()), firstColumn_(0), columnCount_(columnCount),
- y_(points.y_), dy_(points.dy_), present_(points.present_)
+ : header_(points.header()), firstColumn_(0)
{
GMX_ASSERT(firstColumn >= 0, "Invalid first column");
GMX_ASSERT(columnCount >= 0, "Invalid column count");
|| points.firstColumn() >= firstColumn + columnCount
|| columnCount == 0)
{
- columnCount_ = 0;
return;
}
+ AnalysisDataValuesRef::const_iterator begin = points.values().begin();
int newFirstColumn = firstColumn - points.firstColumn();
if (newFirstColumn > 0)
{
- // Offset pointers if the first column is not the first in points.
- y_ += newFirstColumn;
- if (dy_ != NULL)
- {
- dy_ += newFirstColumn;
- }
- if (present_ != NULL)
- {
- present_ += newFirstColumn;
- }
+ // Offset pointer if the first column is not the first in points.
+ begin += newFirstColumn;
newFirstColumn = 0;
}
else
{
// Take into account if first column is before the first in points.
- columnCount_ -= -newFirstColumn;
+ columnCount -= -newFirstColumn;
}
// Decrease column count if there are not enough columns in points.
- if (newFirstColumn + columnCount_ > points.columnCount())
+ AnalysisDataValuesRef::const_iterator end = begin + columnCount;
+ if (newFirstColumn + columnCount > points.columnCount())
{
- columnCount_ = points.columnCount() - newFirstColumn;
+ end = points.values().end();
}
+ values_ = AnalysisDataValuesRef(begin, end);
}
bool AnalysisDataPointSetRef::allPresent() const
{
- if (present_ != NULL)
+ AnalysisDataValuesRef::const_iterator i;
+ for (i = values_.begin(); i != values_.end(); ++i)
{
- for (int i = 0; i < columnCount(); ++i)
+ if (!i->isPresent())
{
- if (!present_[i])
- {
- return false;
- }
+ return false;
}
}
return true;
*/
AnalysisDataFrameRef::AnalysisDataFrameRef()
- : points_(AnalysisDataFrameHeader(), 0, 0, NULL, NULL, NULL)
{
}
AnalysisDataFrameRef::AnalysisDataFrameRef(
- int index, real x, real dx, int columnCount,
- const real *y, const real *dy, const bool *present)
- : points_(index, x, dx, 0, columnCount, y, dy, present)
+ const AnalysisDataFrameHeader &header,
+ const AnalysisDataValuesRef &values)
+ : header_(header), values_(values)
{
}
AnalysisDataFrameRef::AnalysisDataFrameRef(
- const AnalysisDataFrameHeader &header, int columnCount,
- const real *y, const real *dy, const bool *present)
- : points_(header, 0, columnCount, y, dy, present)
+ const AnalysisDataFrameHeader &header,
+ const std::vector<AnalysisDataValue> &values)
+ : header_(header), values_(values.begin(), values.end())
{
}
AnalysisDataFrameRef::AnalysisDataFrameRef(
const AnalysisDataFrameRef &frame, int firstColumn, int columnCount)
- : points_(frame.points(), firstColumn, columnCount)
+ : header_(frame.header()), values_(columnCount, &frame.values_[firstColumn])
+{
+ GMX_ASSERT(firstColumn >= 0, "Invalid first column");
+ GMX_ASSERT(columnCount >= 0, "Invalid column count");
+ GMX_ASSERT(firstColumn + columnCount <= frame.columnCount(),
+ "Invalid last column");
+}
+
+
+bool AnalysisDataFrameRef::allPresent() const
{
+ GMX_ASSERT(isValid(), "Invalid data frame accessed");
+ AnalysisDataValuesRef::const_iterator i;
+ for (i = values_.begin(); i != values_.end(); ++i)
+ {
+ if (!i->isPresent())
+ {
+ return false;
+ }
+ }
+ return true;
}
} // namespace gmx
#ifndef GMX_ANALYSISDATA_DATAFRAME_H
#define GMX_ANALYSISDATA_DATAFRAME_H
-#include <cstddef>
+#include <vector>
#include "../legacyheaders/types/simple.h"
#include "../fatalerror/gmxassert.h"
+#include "../utility/arrayref.h"
+#include "../utility/flags.h"
namespace gmx
{
+/*! \brief
+ * Value type for representing a single value in analysis data objects.
+ *
+ * Default copy constructor and assignment operator are used and work as
+ * intended.
+ *
+ * Methods in this class do not throw.
+ *
+ * \inpublicapi
+ * \ingroup module_analysisdata
+ */
+class AnalysisDataValue
+{
+ public:
+ /*! \brief
+ * Constructs an unset value.
+ */
+ AnalysisDataValue() : value_(0.0), error_(0.0) {}
+ /*! \brief
+ * Constructs a value object with the given value.
+ *
+ * The constructed object is marked as set and present.
+ */
+ explicit AnalysisDataValue(real value)
+ : value_(value), error_(0.0)
+ {
+ flags_.set(efSet);
+ flags_.set(efPresent);
+ }
+
+ /*! \brief
+ * Direct access to the value.
+ *
+ * Assigning a value to this does not mark the value as set; setValue()
+ * must be used for this.
+ */
+ real &value() { return value_; }
+ /*! \brief
+ * Direct access to the error estimate.
+ *
+ * Assigning a value to this does not mark the error estimate as set;
+ * setValue() must be used for this.
+ */
+ real &error() { return error_; }
+ //! Returns the value for this value.
+ real value() const { return value_; }
+ //! Returns the error estimate for this value, or zero if not set.
+ real error() const { return error_; }
+ /*! \brief
+ * Returns whether this value has been set.
+ *
+ * If this method returns false, the return value of value() and
+ * error() are undefined.
+ */
+ bool isSet() const { return flags_.test(efSet); }
+ /*! \brief
+ * Returns whether the error estimate for this value has been set.
+ *
+ * If this method returns false, but isSet() returns true, error()
+ * returns zero.
+ */
+ bool hasError() const { return flags_.test(efErrorSet); }
+ /*! \brief
+ * Returns whether this value has been marked as present.
+ *
+ * If this method returns false, it is up to the source data to define
+ * whether isSet() may return true.
+ */
+ bool isPresent() const { return flags_.test(efPresent); }
+
+ //! Clears and unsets this value.
+ void clear()
+ {
+ *this = AnalysisDataValue();
+ }
+ //! Sets this value.
+ void setValue(real value, bool bPresent = true)
+ {
+ value_ = value;
+ flags_.set(efSet);
+ flags_.set(efPresent, bPresent);
+ }
+ //! Sets this value and its error estimate.
+ void setValue(real value, real error, bool bPresent = true)
+ {
+ value_ = value;
+ error_ = error;
+ flags_.set(efSet);
+ flags_.set(efErrorSet);
+ flags_.set(efPresent, bPresent);
+ }
+ //! Set only error estimate for this value.
+ void setError(real error)
+ {
+ error_ = error;
+ flags_.set(efErrorSet);
+ }
+
+ private:
+ //! Possible flags for \a flags_.
+ enum Flag
+ {
+ efSet = 1<<0, //!< Value has been set.
+ efErrorSet = 1<<1, //!< Error estimate has been set.
+ efPresent = 1<<2 //!< Value is set as present.
+ };
+
+ //! Value for this value.
+ real value_;
+ //! Error estimate for this value, zero if not set.
+ real error_;
+ //! Status flags for thise value.
+ FlagsTemplate<Flag> flags_;
+};
+
+//! Shorthand for reference to an array of data values.
+typedef ConstArrayRef<AnalysisDataValue> AnalysisDataValuesRef;
+
+
/*! \brief
* Value type for storing frame-level information for analysis data.
*
* 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. This is
- * currently not strictly enforced in the constructors because of an
- * implementation detail of AnalysisDataFrameRef, but this is subject to
- * change.
+ * valid, i.e., header().isValid() should always return true.
*
* \inpublicapi
* \ingroup module_analysisdata
/*! \brief
* Constructs a point set reference from given values.
*
- * \param[in] index Index of the frame. Must be >= 0.
- * \param[in] x x coordinate for the frame.
- * \param[in] dx Error estimate for x.
+ * \param[in] header Header for the frame.
* \param[in] firstColumn Zero-based index of the first column.
* Must be >= 0.
- * \param[in] columnCount Number of columns to include.
- * \param[in] y Array of values for each column.
- * Must not be NULL if columnCount > 0.
- * \param[in] dy Array of error estimates for corresponding y.
- * Can be NULL, in which case errors cannot be accessed.
- * \param[in] present Array of flags giving presence of each point.
- * Can be NULL, in which case all values are treated as present.
- *
- * Arrays \p y, \p dy and \p dy should all have \p columnCount
- * elements. The first elements in these arrays should correspond to
- * \p firstColumn.
- */
- AnalysisDataPointSetRef(int index, real x, real dx,
- int firstColumn, int columnCount,
- const real *y, const real *dy,
- const bool *present);
+ * \param[in] values Values for each column.
+ *
+ * The first element in \p values should correspond to \p firstColumn.
+ */
+ AnalysisDataPointSetRef(const AnalysisDataFrameHeader &header,
+ int firstColumn,
+ const AnalysisDataValuesRef &values);
/*! \brief
* Constructs a point set reference from given values.
*
* \param[in] header Header for the frame.
- * \param[in] firstColumn Zero-based index of the first column.
- * Must be >= 0.
- * \param[in] columnCount Number of columns to include.
- * \param[in] y Array of values for each column.
- * Must not be NULL if columnCount > 0.
- * \param[in] dy Array of error estimates for corresponding y.
- * Can be NULL, in which case errors cannot be accessed.
- * \param[in] present Array of flags giving presence of each point.
- * Can be NULL, in which case all values are treated as present.
+ * \param[in] values Values for each column.
*
- * Arrays \p y, \p dy and \p dy should all have \p columnCount
- * elements. The first elements in these arrays should correspond to
- * \p firstColumn.
+ * The first element in \p values should correspond to the first
+ * column.
*/
AnalysisDataPointSetRef(const AnalysisDataFrameHeader &header,
- int firstColumn, int columnCount,
- const real *y, const real *dy,
- const bool *present);
+ const std::vector<AnalysisDataValue> &values);
/*! \brief
* Constructs a point set reference to a subset of columns.
*
//! Returns the number of columns included in this set.
int columnCount() const
{
- return columnCount_;
+ return values().size();
}
//! Returns zero-based index of the last column included in this set (inclusive).
int lastColumn() const
{
- return firstColumn_ + columnCount_ - 1;
+ return firstColumn_ + columnCount() - 1;
+ }
+ /*! \brief
+ * Returns reference container for all values.
+ *
+ * First value in the returned container corresponds to firstColumn().
+ */
+ const AnalysisDataValuesRef &values() const
+ {
+ return values_;
}
/*! \brief
* Returns data value for a column in this set.
*/
real y(int i) const
{
- GMX_ASSERT(i >= 0 && i < columnCount_, "Out of range data access");
- return y_[i];
+ GMX_ASSERT(i >= 0 && i < columnCount(), "Out of range data access");
+ return values()[i].value();
}
/*! \brief
* Returns error estimate for a column in this set if applicable.
* \param[in] i Zero-based column index relative to firstColumn().
* Should be >= 0 and < columnCount().
*
- * Currently, this method either asserts or returns zero if the source
- * data does not specify errors.
+ * Currently, this method returns zero if the source data does not
+ * specify errors.
*/
real dy(int i) const
{
- GMX_ASSERT(dy_ != NULL, "Errors not present, but accessed");
- GMX_ASSERT(i >= 0 && i < columnCount_, "Out of range data access");
- return dy_[i];
+ GMX_ASSERT(i >= 0 && i < columnCount(), "Out of range data access");
+ return values()[i].error();
}
/*! \brief
* Returns whether a column is present in this set.
*/
bool present(int i) const
{
- GMX_ASSERT(i >= 0 && i < columnCount_, "Out of range data access");
- return present_ == NULL || present_[i];
+ GMX_ASSERT(i >= 0 && i < columnCount(), "Out of range data access");
+ return values()[i].isPresent();
}
/*! \brief
* Returns true if all points in this point set are present.
private:
AnalysisDataFrameHeader header_;
int firstColumn_;
- int columnCount_;
- const real *y_;
- const real *dy_;
- const bool *present_;
+ AnalysisDataValuesRef values_;
};
/*! \brief
* Constructs a frame reference from given values.
*
- * \param[in] index Index of the frame. Must be >= 0.
- * \param[in] x x coordinate for the frame.
- * \param[in] dx Error estimate for x.
- * \param[in] columnCount Number of columns to include. Must be >= 0.
- * \param[in] y Array of values for each column.
- * Must not be NULL if columnCount > 0.
- * \param[in] dy Array of error estimates for corresponding y.
- * Can be NULL, in which case errors cannot be accessed.
- * \param[in] present Array of flags giving presence of each point.
- * Can be NULL, in which case all values are treated as present.
- *
- * Arrays \p y, \p dy and \p dy should all have \p columnCount
- * elements.
- */
- AnalysisDataFrameRef(int index, real x, real dx,
- int columnCount,
- const real *y, const real *dy,
- const bool *present);
+ * \param[in] header Header for the frame.
+ * \param[in] values Values for each column.
+ */
+ AnalysisDataFrameRef(const AnalysisDataFrameHeader &header,
+ const AnalysisDataValuesRef &values);
/*! \brief
* Constructs a frame reference from given values.
*
* \param[in] header Header for the frame.
- * \param[in] columnCount Number of columns to include.
- * \param[in] y Array of values for each column.
- * Must not be NULL if columnCount > 0.
- * \param[in] dy Array of error estimates for corresponding y.
- * Can be NULL, in which case errors cannot be accessed.
- * \param[in] present Array of flags giving presence of each point.
- * Can be NULL, in which case all values are treated as present.
- *
- * Arrays \p y, \p dy and \p dy should all have \p columnCount
- * elements.
+ * \param[in] values Values for each column.
*/
AnalysisDataFrameRef(const AnalysisDataFrameHeader &header,
- int columnCount,
- const real *y, const real *dy,
- const bool *present);
+ const std::vector<AnalysisDataValue> &values);
/*! \brief
* Constructs a frame reference to a subset of columns.
*
//! Returns the header for this frame.
const AnalysisDataFrameHeader &header() const
{
- return points_.header();
+ return header_;
}
//! \copydoc AnalysisDataFrameHeader::index()
int frameIndex() const
*
* Should not be called for invalid frames.
*/
- const AnalysisDataPointSetRef &points() const
+ AnalysisDataPointSetRef points() const
{
GMX_ASSERT(isValid(), "Invalid data frame accessed");
- return points_;
+ return AnalysisDataPointSetRef(header_, 0, values_);
}
/*! \brief
* Returns number of columns in this frame.
*/
int columnCount() const
{
- return points().columnCount();
+ return values_.size();
+ }
+ /*! \brief
+ * Returns reference container for all column values.
+ */
+ const AnalysisDataValuesRef &values() const
+ {
+ return values_;
}
/*! \brief
* Convenience method for accessing a column value.
real y(int i) const
{
GMX_ASSERT(isValid(), "Invalid data frame accessed");
- return points().y(i);
+ GMX_ASSERT(i >= 0 && i < columnCount(), "Out of range data access");
+ return values_[i].value();
}
/*! \brief
* Convenience method for accessing error for a column value.
real dy(int i) const
{
GMX_ASSERT(isValid(), "Invalid data frame accessed");
- return points().dy(i);
+ GMX_ASSERT(i >= 0 && i < columnCount(), "Out of range data access");
+ return values_[i].error();
}
/*! \brief
* Convenience method for accessing present status for a column.
bool present(int i) const
{
GMX_ASSERT(isValid(), "Invalid data frame accessed");
- return points().present(i);
+ GMX_ASSERT(i >= 0 && i < columnCount(), "Out of range data access");
+ return values_[i].isPresent();
}
/*! \brief
* Returns true if all points in this frame are present.
*/
- bool allPresent() const
- {
- GMX_ASSERT(isValid(), "Invalid data frame accessed");
- return points().allPresent();
- }
+ bool allPresent() const;
private:
- AnalysisDataPointSetRef points_;
+ AnalysisDataFrameHeader header_;
+ AnalysisDataValuesRef values_;
};
} // namespace gmx
#include <limits>
-#include "smalloc.h"
-
#include "gromacs/analysisdata/abstractdata.h"
#include "gromacs/analysisdata/dataframe.h"
#include "gromacs/analysisdata/paralleloptions.h"
AnalysisDataStorageFrame::AnalysisDataStorageFrame(AnalysisDataStorage *storage,
int columnCount, int index)
- : storage_(storage), header_(index, 0.0, 0.0), columnCount_(columnCount),
- y_(NULL), dy_(NULL), present_(NULL)
+ : storage_(storage), header_(index, 0.0, 0.0), values_(columnCount)
{
- snew(y_, columnCount);
- snew(dy_, columnCount);
- snew(present_, columnCount);
}
AnalysisDataStorageFrame::~AnalysisDataStorageFrame()
{
- sfree(y_);
- sfree(dy_);
- sfree(present_);
}
AnalysisDataPointSetRef
AnalysisDataStorageFrame::currentPoints() const
{
- // TODO: Deduce first column and column count for multipoint data.
- // Requires additional information to be stored.
- return AnalysisDataPointSetRef(header_, 0, columnCount_, y_, dy_, present_);
+ std::vector<AnalysisDataValue>::const_iterator begin = values_.begin();
+ std::vector<AnalysisDataValue>::const_iterator end = values_.end();
+ while (begin != end && !begin->isSet())
+ {
+ ++begin;
+ }
+ while (end != begin && !(end-1)->isSet())
+ {
+ --end;
+ }
+ int firstColumn = (begin != end) ? begin - values_.begin() : 0;
+ return AnalysisDataPointSetRef(header_, firstColumn,
+ AnalysisDataValuesRef(begin, end));
}
void
AnalysisDataStorageFrame::clearValues()
{
- for (int i = 0; i < columnCount(); ++i)
+ std::vector<AnalysisDataValue>::iterator i;
+ for (i = values_.begin(); i != values_.end(); ++i)
{
- y_[i] = 0.0;
- dy_[i] = 0.0;
- present_[i] = false;
+ i->clear();
}
}
return AnalysisDataFrameRef();
}
const AnalysisDataStorageFrame *frame = storedFrame.frame;
- return AnalysisDataFrameRef(frame->header(), frame->columnCount(),
- frame->y_, frame->dy_, frame->present_);
+ return AnalysisDataFrameRef(frame->header(), frame->values_);
}
#ifndef GMX_ANALYSISDATA_DATASTORAGE_H
#define GMX_ANALYSISDATA_DATASTORAGE_H
+#include <vector>
+
#include "../legacyheaders/types/simple.h"
#include "../fatalerror/gmxassert.h"
//! Returns error in x coordinate for the frame if applicable.
real dx() const { return header().dx(); }
//! Returns number of columns for the frame.
- int columnCount() const { return columnCount_; }
+ int columnCount() const { return values_.size(); }
/*! \brief
* Returns point set reference to currently set values.
* Does not throw.
*/
AnalysisDataPointSetRef currentPoints() const;
+ /*! \brief
+ * Sets value for a column.
+ *
+ * \param[in] column Zero-based column index.
+ * \param[in] value Value to set for the column.
+ * \param[in] bPresent Present flag to set for the column.
+ *
+ * If called multiple times for a column (within one point set for
+ * multipoint data), old values are overwritten.
+ *
+ * Does not throw.
+ */
+ void setValue(int column, real value, bool bPresent = true)
+ {
+ GMX_ASSERT(column >= 0 && column < columnCount(),
+ "Invalid column index");
+ values_[column].setValue(value, bPresent);
+ }
/*! \brief
* Sets value for a column.
*
* \param[in] column Zero-based column index.
* \param[in] value Value to set for the column.
* \param[in] error Error estimate to set for the column.
- * \param[in] present Present flag to set for the column.
+ * \param[in] bPresent Present flag to set for the column.
*
* If called multiple times for a column (within one point set for
* multipoint data), old values are overwritten.
*
* Does not throw.
*/
- void setValue(int column, real value, real error = 0.0,
- bool present = true)
+ void setValue(int column, real value, real error, bool bPresent = true)
{
GMX_ASSERT(column >= 0 && column < columnCount(),
"Invalid column index");
- y_[column] = value;
- dy_[column] = error;
- present_[column] = present;
+ values_[column].setValue(value, error, bPresent);
}
/*! \brief
* Access value for a column.
{
GMX_ASSERT(column >= 0 && column < columnCount(),
"Invalid column index");
- return y_[column];
+ return values_[column].value();
}
/*! \brief
* Access value for a column.
{
GMX_ASSERT(column >= 0 && column < columnCount(),
"Invalid column index");
- return y_[column];
+ return values_[column].value();
}
/*! \brief
* Mark point set as finished for multipoint data.
AnalysisDataStorage *storage_;
//! Header for the frame.
AnalysisDataFrameHeader header_;
- //! Number of columns in the frame.
- int columnCount_;
- //! Array of column values for the frame.
- real *y_;
- //! Array of column error values for the frame.
- real *dy_;
- //! Array of flags that tell whether a value is present.
- bool *present_;
+ //! Values for the frame.
+ std::vector<AnalysisDataValue> values_;
/*! \brief
* Needed for full write access to the data and for access to
#ifndef GMX_ANALYSISDATA_MODULES_DISPLACEMENT_IMPL_H
#define GMX_ANALYSISDATA_MODULES_DISPLACEMENT_IMPL_H
+#include <vector>
+
+#include "../dataframe.h"
+
#include "displacement.h"
namespace gmx
//! Old values.
real *oldval;
//! The most recently calculated displacements.
- real *currd;
+ std::vector<AnalysisDataValue> currValues_;
//! Histogram module for calculating MSD histograms, or NULL if not set.
AnalysisDataBinAverageModule *histm;
AnalysisDataDisplacementModule::Impl::Impl()
: nmax(0), tmax(0.0), ndim(3),
bFirst(true), t0(0.0), dt(0.0), t(0.0),
- max_store(-1), nstored(0), oldval(NULL), currd(NULL),
+ max_store(-1), nstored(0), oldval(NULL),
histm(NULL)
{
}
AnalysisDataDisplacementModule::Impl::~Impl()
{
sfree(oldval);
- sfree(currd);
}
/********************************************************************
_impl->ci = -_impl->nmax;
int ncol = _impl->nmax / _impl->ndim + 1;
- snew(_impl->currd, ncol);
+ _impl->currValues_.reserve(ncol);
setColumnCount(ncol);
}
{
i += _impl->max_store;
}
- _impl->currd[0] = step * _impl->dt;
+ _impl->currValues_.clear();
+ _impl->currValues_.push_back(AnalysisDataValue(step * _impl->dt));
int k = 1;
for (int j = 0; j < _impl->nmax; j += _impl->ndim, ++k)
{
dist2 += sqr(_impl->oldval[_impl->ci + j + d]
- _impl->oldval[i + j + d]);
}
- _impl->currd[k] = dist2;
+ _impl->currValues_.push_back(AnalysisDataValue(dist2));
}
- notifyPointsAdd(AnalysisDataPointSetRef(
- header, 0, k, _impl->currd, NULL, NULL));
+ notifyPointsAdd(AnalysisDataPointSetRef(header, _impl->currValues_));
}
notifyFrameFinish(header);
* MockAnalysisModule::Impl
*/
+namespace
+{
+
+/*! \brief
+ * Helper callback function for TestReferenceData::checkCompound().
+ */
+void checkReferenceDataPoint(TestReferenceChecker *checker,
+ const AnalysisDataValue &value)
+{
+ TestReferenceChecker compound(checker->checkCompound("DataValue", NULL));
+ compound.checkReal(value.value(), "Value");
+ if (value.hasError())
+ {
+ compound.checkReal(value.error(), "Error");
+ }
+ if (!value.isPresent())
+ {
+ compound.checkBoolean(value.isPresent(), "Present");
+ }
+}
+
+}
+
MockAnalysisModule::Impl::Impl(int flags)
: flags_(flags), frameIndex_(0)
{
EXPECT_TRUE(frameChecker_.get() != NULL);
if (frameChecker_.get() != NULL)
{
- // TODO: Add interface to points to make this easier.
- std::vector<real> tmp;
- tmp.reserve(points.columnCount());
- for (int i = 0; i < points.columnCount(); ++i)
- {
- tmp.push_back(points.y(i));
- }
- frameChecker_->checkSequenceArray(tmp.size(), &tmp[0], "Y");
+ frameChecker_->checkSequence(points.values().begin(), points.values().end(), "Y",
+ &checkReferenceDataPoint);
}
}
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.500000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>3.000000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">2.500000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>4.000000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">4.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame4">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame5">
<Real Name="X">3.500000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.000000</Real>
- <Real>3.000000</Real>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame6">
<Real Name="X">4.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.000000</Real>
- <Real>3.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.500000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>3.000000</Real>
- <Real>1.414214</Real>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.414214</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.500000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>7.000000</Real>
- <Real>2.828427</Real>
+ <DataValue>
+ <Real Name="Value">7.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.828427</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.500000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.000000</Real>
- <Real>3.162278</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">3.162278</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.500000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>3.000000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">2.500000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>4.000000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">4.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame4">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame5">
<Real Name="X">3.500000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.000000</Real>
- <Real>3.000000</Real>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame6">
<Real Name="X">4.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.000000</Real>
- <Real>3.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>4.000000</Real>
- <Real>2.236068</Real>
+ <DataValue>
+ <Real Name="Value">4.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.236068</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>6.000000</Real>
- <Real>2.236068</Real>
+ <DataValue>
+ <Real Name="Value">6.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.236068</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">4.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.000000</Real>
- <Real>4.242640</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">4.242640</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>0.000000</Real>
- <Real>1.000000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>1.000000</Real>
- <Real>1.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>2.000000</Real>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">0.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.000000</Real>
- <Real>0.816497</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.816497</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.666667</Real>
- <Real>0.471404</Real>
+ <DataValue>
+ <Real Name="Value">0.666667</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.471404</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.000000</Real>
- <Real>0.816497</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.816497</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>0.000000</Real>
- <Real>1.000000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>1.000000</Real>
- <Real>1.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>2.000000</Real>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">0.500000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.000000</Real>
- <Real>0.816497</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.816497</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.666667</Real>
- <Real>0.471404</Real>
+ <DataValue>
+ <Real Name="Value">0.666667</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.471404</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">1.500000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.000000</Real>
- <Real>0.816497</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.816497</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.700000</Real>
- <Real>0.500000</Real>
+ <DataValue>
+ <Real Name="Value">0.700000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.500000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.100000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.100000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.300000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.900000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.900000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.300000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.200000</Real>
- <Real>3.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.200000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>3.300000</Real>
- <Real>0.500000</Real>
+ <DataValue>
+ <Real Name="Value">3.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.500000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.200000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.200000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.300000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.250000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>1.250000</Real>
- <Real>0.433013</Real>
- <Real>4.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.250000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.433013</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">4.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.750000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">2.250000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>2.000000</Real>
- <Real>1.000000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">2.750000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>2.000000</Real>
- <Real>0.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.700000</Real>
- <Real>0.500000</Real>
+ <DataValue>
+ <Real Name="Value">0.700000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.500000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.100000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.100000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.300000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.900000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.900000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.300000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.200000</Real>
- <Real>3.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.200000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>3.300000</Real>
- <Real>0.500000</Real>
+ <DataValue>
+ <Real Name="Value">3.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.500000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.200000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.200000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.300000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.250000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>1.100000</Real>
- <Real>0.489898</Real>
- <Real>5.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.100000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.489898</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">5.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.750000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">2.250000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>2.000000</Real>
- <Real>1.000000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">2.750000</Real>
<Sequence Name="Y">
<Int Name="Length">3</Int>
- <Real>1.250000</Real>
- <Real>0.750000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.250000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.750000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>0.700000</Real>
+ <DataValue>
+ <Real Name="Value">0.700000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>1.100000</Real>
+ <DataValue>
+ <Real Name="Value">1.100000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>2.300000</Real>
+ <DataValue>
+ <Real Name="Value">2.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>2.900000</Real>
+ <DataValue>
+ <Real Name="Value">2.900000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>1.300000</Real>
+ <DataValue>
+ <Real Name="Value">1.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>2.200000</Real>
+ <DataValue>
+ <Real Name="Value">2.200000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>3.300000</Real>
+ <DataValue>
+ <Real Name="Value">3.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>1.200000</Real>
+ <DataValue>
+ <Real Name="Value">1.200000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>1.300000</Real>
+ <DataValue>
+ <Real Name="Value">1.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">4</Int>
- <Real>1.000000</Real>
- <Real>0.000000</Real>
- <Real>1.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">4</Int>
- <Real>1.000000</Real>
- <Real>0.000000</Real>
- <Real>1.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">4</Int>
- <Real>2.000000</Real>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.250000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.333333</Real>
- <Real>0.471404</Real>
+ <DataValue>
+ <Real Name="Value">1.333333</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.471404</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.750000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">2.250000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.666667</Real>
- <Real>0.471404</Real>
+ <DataValue>
+ <Real Name="Value">0.666667</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.471404</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">2.750000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.333333</Real>
- <Real>0.471405</Real>
+ <DataValue>
+ <Real Name="Value">0.333333</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.471405</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>0.700000</Real>
+ <DataValue>
+ <Real Name="Value">0.700000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>1.100000</Real>
+ <DataValue>
+ <Real Name="Value">1.100000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>2.300000</Real>
+ <DataValue>
+ <Real Name="Value">2.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>2.900000</Real>
+ <DataValue>
+ <Real Name="Value">2.900000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>1.300000</Real>
+ <DataValue>
+ <Real Name="Value">1.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>2.200000</Real>
+ <DataValue>
+ <Real Name="Value">2.200000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>3.300000</Real>
+ <DataValue>
+ <Real Name="Value">3.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>1.200000</Real>
+ <DataValue>
+ <Real Name="Value">1.200000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">1</Int>
- <Real>1.300000</Real>
+ <DataValue>
+ <Real Name="Value">1.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">4</Int>
- <Real>2.000000</Real>
- <Real>0.000000</Real>
- <Real>1.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">4</Int>
- <Real>1.000000</Real>
- <Real>0.000000</Real>
- <Real>1.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">4</Int>
- <Real>2.000000</Real>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.250000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.666667</Real>
- <Real>0.471405</Real>
+ <DataValue>
+ <Real Name="Value">1.666667</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.471405</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.750000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">2.250000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.666667</Real>
- <Real>0.471404</Real>
+ <DataValue>
+ <Real Name="Value">0.666667</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.471404</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">2.750000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.666667</Real>
- <Real>0.471404</Real>
+ <DataValue>
+ <Real Name="Value">0.666667</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.471404</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.700000</Real>
- <Real>0.500000</Real>
+ <DataValue>
+ <Real Name="Value">0.700000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.500000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.100000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.100000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.300000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.900000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.900000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.300000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.200000</Real>
- <Real>3.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.200000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>3.300000</Real>
- <Real>0.500000</Real>
+ <DataValue>
+ <Real Name="Value">3.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.500000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.200000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.200000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.300000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">4</Int>
- <Real>1.000000</Real>
- <Real>0.000000</Real>
- <Real>1.000000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">4</Int>
- <Real>1.000000</Real>
- <Real>0.000000</Real>
- <Real>3.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">4</Int>
- <Real>3.000000</Real>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.250000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.666667</Real>
- <Real>0.942809</Real>
+ <DataValue>
+ <Real Name="Value">1.666667</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.942809</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.750000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">2.250000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.333333</Real>
- <Real>1.247219</Real>
+ <DataValue>
+ <Real Name="Value">1.333333</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.247219</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">2.750000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.666667</Real>
- <Real>0.942809</Real>
+ <DataValue>
+ <Real Name="Value">0.666667</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.942809</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.700000</Real>
- <Real>0.500000</Real>
+ <DataValue>
+ <Real Name="Value">0.700000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.500000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.100000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.100000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.300000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.900000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.900000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.300000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>2.200000</Real>
- <Real>3.000000</Real>
+ <DataValue>
+ <Real Name="Value">2.200000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>3.300000</Real>
- <Real>0.500000</Real>
+ <DataValue>
+ <Real Name="Value">3.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.500000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.200000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.200000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.300000</Real>
- <Real>1.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.300000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.000000</Real>
<Sequence Name="Y">
<Int Name="Length">4</Int>
- <Real>1.500000</Real>
- <Real>0.000000</Real>
- <Real>1.000000</Real>
- <Real>2.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.500000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<Sequence Name="Y">
<Int Name="Length">4</Int>
- <Real>1.000000</Real>
- <Real>0.000000</Real>
- <Real>3.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<Sequence Name="Y">
<Int Name="Length">4</Int>
- <Real>3.000000</Real>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
- <Real>0.500000</Real>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.500000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
<Real Name="X">1.250000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.833333</Real>
- <Real>0.849837</Real>
+ <DataValue>
+ <Real Name="Value">1.833333</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.849837</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.750000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.000000</Real>
- <Real>0.000000</Real>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">2.250000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>1.333333</Real>
- <Real>1.247219</Real>
+ <DataValue>
+ <Real Name="Value">1.333333</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.247219</Real>
+ </DataValue>
</Sequence>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">2.750000</Real>
<Sequence Name="Y">
<Int Name="Length">2</Int>
- <Real>0.833333</Real>
- <Real>0.849837</Real>
+ <DataValue>
+ <Real Name="Value">0.833333</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.849837</Real>
+ </DataValue>
</Sequence>
</DataFrame>
</AnalysisData>
set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${UTILITY_SOURCES} PARENT_SCOPE)
set(UTILITY_PUBLIC_HEADERS
- flags.h format.h)
+ arrayref.h flags.h format.h)
install(FILES ${UTILITY_PUBLIC_HEADERS}
DESTINATION ${INCL_INSTALL_DIR}/gromacs/utility
COMPONENT development)
--- /dev/null
+/*
+ *
+ * This source code is part of
+ *
+ * G R O M A C S
+ *
+ * GROningen MAchine for Chemical Simulations
+ *
+ * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2009, The GROMACS development team,
+ * check out http://www.gromacs.org for more information.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * If you want to redistribute modifications, please consider that
+ * scientific software is very special. Version control is crucial -
+ * bugs must be traceable. We will be happy to consider code for
+ * inclusion in the official distribution, but derived work must not
+ * be called official GROMACS. Details are found in the README & COPYING
+ * files - if they are missing, get the official version at www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the papers on the package - you can find them in the top README file.
+ *
+ * For more info, check our website at http://www.gromacs.org
+ */
+/*! \file
+ * \brief
+ * Declares gmx::ConstArrayRef.
+ *
+ * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \inpublicapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_ARRAYREF_H
+#define GMX_UTILITY_ARRAYREF_H
+
+#include <cstddef>
+
+#include <iterator>
+#include <stdexcept>
+#include <utility>
+#include <vector>
+
+#include "../fatalerror/gmxassert.h"
+
+namespace gmx
+{
+
+/*! \brief
+ * STL container non-mutable interface for a C array (or part of a std::vector).
+ *
+ * \tparam T Value type of elements.
+ *
+ * This class provides an interface similar to \c std::vector<T>, with the
+ * following main differences:
+ * - This class does not have its own storage. Instead, it references an
+ * existing array of values (either a C-style array or part of an existing
+ * std::vector<T>).
+ * - Only const methods are provided to access the stored values.
+ * It is not possible to alter the referenced array.
+ * - Copying objects of this type is cheap, and the copies behave identically
+ * to the original object: the copy references the same set of values.
+ *
+ * \inpublicapi
+ * \ingroup module_utility
+ */
+template <typename T>
+class ConstArrayRef
+{
+ public:
+ typedef T value_type;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef const T &const_reference;
+ typedef const T *const_pointer;
+ typedef const T *const_iterator;
+ //! Equal to \a const_reference since changes are not allowed.
+ typedef const_reference reference;
+ //! Equal to \a const_pointer since changes are not allowed.
+ typedef const_pointer pointer;
+ //! Equal to \a const_iterator since changes are not allowed.
+ typedef const_iterator iterator;
+ //! Standard reverse iterator.
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ //! Standard reverse iterator.
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ /*! \brief
+ * Constructs an empty reference.
+ */
+ ConstArrayRef() : begin_(NULL), end_(NULL) {}
+ /*! \brief
+ * Constructs a reference to a particular range.
+ *
+ * \param[in] begin Pointer to the beginning of a range.
+ * \param[in] end Pointer to the end of a range.
+ *
+ * Passed pointers must remain valid for the lifetime of this object.
+ */
+ ConstArrayRef(const_pointer begin, const_pointer end)
+ : begin_(begin), end_(end)
+ {
+ GMX_ASSERT(end >= begin, "Invalid range");
+ }
+ /*! \brief
+ * Constructs a reference to a particular rangein a std::vector.
+ *
+ * \param[in] begin Pointer to the beginning of a range.
+ * \param[in] end Pointer to the end of a range.
+ *
+ * The referenced vector must remain valid and not be reallocated for
+ * the lifetime of this object.
+ */
+ ConstArrayRef(typename std::vector<T>::const_iterator begin,
+ typename std::vector<T>::const_iterator end)
+ : begin_((begin != end) ? &*begin : NULL),
+ end_((begin != end) ? &*end : NULL)
+ {
+ GMX_ASSERT(end >= begin, "Invalid range");
+ }
+ /*! \brief
+ * Constructs a reference to an array.
+ *
+ * \param[in] size Number of elements in the array.
+ * \param[in] begin Pointer to the beginning of the array.
+ * May be NULL if \p size is zero.
+ *
+ * Passed pointer must remain valid for the lifetime of this object.
+ */
+ ConstArrayRef(size_type size, const_pointer begin)
+ : begin_(begin), end_(begin + size)
+ {
+ }
+
+ const_iterator begin() const { return begin_; }
+ const_iterator end() const { return end_; }
+ const_iterator rbegin() const { return reverse_iterator(end()); }
+ const_iterator rend() const { return reverse_iterator(begin()); }
+
+ size_type size() const { return end_ - begin_; }
+ size_type capacity() const { return end_ - begin_; }
+ bool empty() const { return begin_ == end_; }
+
+ const_reference operator[](size_type n) const { return begin_[n]; }
+ const_reference at(size_type n) const
+ {
+ if (n >= size())
+ {
+ throw std::out_of_range("Vector index out of range");
+ }
+ return begin_[n];
+ }
+ const_reference front() const { return *begin_; }
+ const_reference back() const { return *(end_ - 1); }
+
+ /*! \brief
+ * Swaps referenced memory with the other object.
+ *
+ * The actual memory areas are not modified, only the references are
+ * swapped.
+ */
+ void swap(ConstArrayRef<T> &other)
+ {
+ std::swap(begin_, other.begin_);
+ std::swap(end_, other.end_);
+ }
+
+ private:
+ const_pointer begin_;
+ const_pointer end_;
+};
+
+/*! \brief
+ * Simple swap method for ConstArrayRef objects.
+ *
+ * \see ConstArrayRef::swap()
+ */
+template <typename T>
+void swap(ConstArrayRef<T> &a, ConstArrayRef<T> &b)
+{
+ a.swap(b);
+}
+
+} // namespace gmx
+
+#endif