Implement common analysis data value object.
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 22 Jan 2012 09:38:20 +0000 (11:38 +0200)
committerTeemu Murtola <teemu.murtola@gmail.com>
Wed, 22 Feb 2012 05:38:10 +0000 (07:38 +0200)
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

21 files changed:
src/gromacs/analysisdata/arraydata.cpp
src/gromacs/analysisdata/arraydata.h
src/gromacs/analysisdata/dataframe.cpp
src/gromacs/analysisdata/dataframe.h
src/gromacs/analysisdata/datastorage.cpp
src/gromacs/analysisdata/datastorage.h
src/gromacs/analysisdata/modules/displacement-impl.h
src/gromacs/analysisdata/modules/displacement.cpp
src/gromacs/analysisdata/tests/mock_module.cpp
src/gromacs/analysisdata/tests/refdata/AbstractAverageHistogramTest_ResamplesAtDoubleBinWidth.xml
src/gromacs/analysisdata/tests/refdata/AbstractAverageHistogramTest_ResamplesAtDoubleBinWidthWithIntegerBins.xml
src/gromacs/analysisdata/tests/refdata/AverageModuleTest_BasicTest.xml
src/gromacs/analysisdata/tests/refdata/AverageModuleTest_CanCustomizeXAxis.xml
src/gromacs/analysisdata/tests/refdata/BinAverageModuleTest_ComputesCorrectly.xml
src/gromacs/analysisdata/tests/refdata/BinAverageModuleTest_ComputesCorrectlyWithAll.xml
src/gromacs/analysisdata/tests/refdata/SimpleHistogramModuleTest_ComputesCorrectly.xml
src/gromacs/analysisdata/tests/refdata/SimpleHistogramModuleTest_ComputesCorrectlyWithAll.xml
src/gromacs/analysisdata/tests/refdata/WeightedHistogramModuleTest_ComputesCorrectly.xml
src/gromacs/analysisdata/tests/refdata/WeightedHistogramModuleTest_ComputesCorrectlyWithAll.xml
src/gromacs/utility/CMakeLists.txt
src/gromacs/utility/arrayref.h [new file with mode: 0644]

index 94e90bec3c0d4fced7ca822761c7511b6b6c0d2e..05c3a087b13dc75656eac00abeb38378bc0ef83e 100644 (file)
@@ -59,8 +59,15 @@ AbstractAnalysisArrayData::~AbstractAnalysisArrayData()
 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()));
 }
 
 
@@ -97,6 +104,11 @@ AbstractAnalysisArrayData::allocateValues()
     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);
+    }
 }
 
 
@@ -119,14 +131,15 @@ AbstractAnalysisArrayData::valuesReady()
     }
     _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();
index 1dc004f6f263bae46043be83124c9b942a223d1a..b1cba7a5a214f948297a267ab3303e510f989d1d 100644 (file)
 #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
 {
@@ -58,6 +57,9 @@ 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
  */
@@ -91,7 +93,7 @@ class AbstractAnalysisArrayData : public AbstractAnalysisData
             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:
@@ -125,7 +127,7 @@ class AbstractAnalysisArrayData : public AbstractAnalysisData
             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.
@@ -159,7 +161,7 @@ class AbstractAnalysisArrayData : public AbstractAnalysisData
         virtual bool requestStorageInternal(int nframes);
 
         int                  _nrows;
-        std::vector<real>    _value;
+        std::vector<AnalysisDataValue> _value;
         real                 _xstart;
         real                 _xstep;
         bool                 _bReady;
index f31f31f271fb5bc2148ce5fcee8cea76468ff6e7..45ca1a90ff2e1a50099b1e3c5062412c3a3809bc 100644 (file)
@@ -64,35 +64,29 @@ AnalysisDataFrameHeader::AnalysisDataFrameHeader(int index, real x, real dx)
  */
 
 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");
@@ -100,47 +94,39 @@ AnalysisDataPointSetRef::AnalysisDataPointSetRef(
         || 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;
@@ -152,31 +138,49 @@ bool AnalysisDataPointSetRef::allPresent() const
  */
 
 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
index 15fb60a6494204a248febdb133cc3060d92ae763..8a18c3e4ad1182ac501a5f66de6260e65e66593d 100644 (file)
 #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.
  *
@@ -144,10 +265,7 @@ class AnalysisDataFrameHeader
  * 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
@@ -158,49 +276,27 @@ class AnalysisDataPointSetRef
         /*! \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.
          *
@@ -252,12 +348,21 @@ class AnalysisDataPointSetRef
         //! 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.
@@ -267,8 +372,8 @@ class AnalysisDataPointSetRef
          */
         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.
@@ -276,14 +381,13 @@ class AnalysisDataPointSetRef
          * \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.
@@ -296,8 +400,8 @@ class AnalysisDataPointSetRef
          */
         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.
@@ -309,10 +413,7 @@ class AnalysisDataPointSetRef
     private:
         AnalysisDataFrameHeader header_;
         int                     firstColumn_;
-        int                     columnCount_;
-        const real             *y_;
-        const real             *dy_;
-        const bool             *present_;
+        AnalysisDataValuesRef   values_;
 };
 
 
@@ -346,43 +447,19 @@ class AnalysisDataFrameRef
         /*! \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.
          *
@@ -411,7 +488,7 @@ class AnalysisDataFrameRef
         //! Returns the header for this frame.
         const AnalysisDataFrameHeader &header() const
         {
-            return points_.header();
+            return header_;
         }
         //! \copydoc AnalysisDataFrameHeader::index()
         int frameIndex() const
@@ -433,10 +510,10 @@ class AnalysisDataFrameRef
          *
          * 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.
@@ -445,7 +522,14 @@ class AnalysisDataFrameRef
          */
         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.
@@ -455,7 +539,8 @@ class AnalysisDataFrameRef
         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.
@@ -465,7 +550,8 @@ class AnalysisDataFrameRef
         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.
@@ -475,19 +561,17 @@ class AnalysisDataFrameRef
         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
index 93e716f8793c5a67f59173dac144d9ca74ee6064..3c4360e8abfb4cbe1468d7deae9980949aa05f30 100644 (file)
@@ -39,8 +39,6 @@
 
 #include <limits>
 
-#include "smalloc.h"
-
 #include "gromacs/analysisdata/abstractdata.h"
 #include "gromacs/analysisdata/dataframe.h"
 #include "gromacs/analysisdata/paralleloptions.h"
@@ -76,40 +74,42 @@ AnalysisDataParallelOptions::AnalysisDataParallelOptions(int parallelizationFact
 
 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();
     }
 }
 
@@ -333,8 +333,7 @@ AnalysisDataStorage::tryGetDataFrame(int index) const
         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_);
 }
 
 
index fce3e3ed3603866a1578e69aa2f8e5aa2e6c4343..d056320fc4807046f51580e805da353b48caf9d0 100644 (file)
@@ -39,6 +39,8 @@
 #ifndef GMX_ANALYSISDATA_DATASTORAGE_H
 #define GMX_ANALYSISDATA_DATASTORAGE_H
 
+#include <vector>
+
 #include "../legacyheaders/types/simple.h"
 
 #include "../fatalerror/gmxassert.h"
@@ -78,7 +80,7 @@ class AnalysisDataStorageFrame
         //! 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.
@@ -86,27 +88,42 @@ class AnalysisDataStorageFrame
          * 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.
@@ -123,7 +140,7 @@ class AnalysisDataStorageFrame
         {
             GMX_ASSERT(column >= 0 && column < columnCount(),
                        "Invalid column index");
-            return y_[column];
+            return values_[column].value();
         }
         /*! \brief
          * Access value for a column.
@@ -139,7 +156,7 @@ class AnalysisDataStorageFrame
         {
             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.
@@ -175,14 +192,8 @@ class AnalysisDataStorageFrame
         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
index 2accf0062a579db5db30c055976e94da0c745f6c..9d7b2d39278708c411b2b1cdde9c581c06ac61ad 100644 (file)
 #ifndef GMX_ANALYSISDATA_MODULES_DISPLACEMENT_IMPL_H
 #define GMX_ANALYSISDATA_MODULES_DISPLACEMENT_IMPL_H
 
+#include <vector>
+
+#include "../dataframe.h"
+
 #include "displacement.h"
 
 namespace gmx
@@ -82,7 +86,7 @@ class AnalysisDataDisplacementModule::Impl
         //! 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;
index 45b8a78e3e0f0ef965dc9628421e05173d2dcb3a..de7da3f0cdfd7f65088d1aa11f3d00298c32594a 100644 (file)
@@ -62,7 +62,7 @@ namespace gmx
 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)
 {
 }
@@ -70,7 +70,6 @@ AnalysisDataDisplacementModule::Impl::Impl()
 AnalysisDataDisplacementModule::Impl::~Impl()
 {
     sfree(oldval);
-    sfree(currd);
 }
 
 /********************************************************************
@@ -139,7 +138,7 @@ AnalysisDataDisplacementModule::dataStarted(AbstractAnalysisData *data)
     _impl->ci = -_impl->nmax;
 
     int ncol = _impl->nmax / _impl->ndim + 1;
-    snew(_impl->currd, ncol);
+    _impl->currValues_.reserve(ncol);
     setColumnCount(ncol);
 }
 
@@ -240,7 +239,8 @@ AnalysisDataDisplacementModule::frameFinished(const AnalysisDataFrameHeader & /*
         {
             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)
         {
@@ -251,10 +251,9 @@ AnalysisDataDisplacementModule::frameFinished(const AnalysisDataFrameHeader & /*
                 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);
index 63b6b2d037fa8aecc4d9fa802d133713f9937495..d65ff02d6a2dab6b7313ae49d28f8ce22b9adbc5 100644 (file)
@@ -59,6 +59,29 @@ namespace test
  * 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)
 {
@@ -83,14 +106,8 @@ MockAnalysisModule::Impl::checkReferencePoints(const AnalysisDataPointSetRef &po
     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);
     }
 }
 
index 8f2418499261957086c09c5587187afe61dac09d..fe3e6910d6c6551d95643c2e6c601b00fd0e7058 100644 (file)
@@ -5,56 +5,84 @@
       <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>
index 407c67c3e443ec71cf211be04b65a778d380382b..4b49d8708c02f06854b28530ac330733c6531c80 100644 (file)
@@ -5,56 +5,84 @@
       <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>
index cabe8addb2ef6c101d7d47a375c3464d446d3b16..be4bff5251317d0503a3ac314e59fcb3230fa82d 100644 (file)
@@ -5,27 +5,54 @@
       <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>
index 19e0bf289e34db64a8a442a92fac1b133dad52aa..b1b3d6f2263a2f6346d931bf800bacd26996c9f2 100644 (file)
@@ -5,27 +5,54 @@
       <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>
index a4dcc99f9452c612d67179f4cb4e3da8b5f24b9a..2a33cca2a3b8a81b9263925ad8cecdeb4b48e164 100644 (file)
       <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>
index 5b8c1ae86883ee866c3219183c933aba010abdb2..2bc9eb68c04bcd2c1175e7295fd53ac74cb07b9b 100644 (file)
       <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>
index bcae99ff7982cf4fa3b72d7c4baf747b15ca0a73..97aeda88252eccf0032f82651dd8e868d79bc889 100644 (file)
@@ -5,45 +5,72 @@
       <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>
index 9424ffaec6a49a4d91487cd07c23e1c45da1cc00..08096c823290b913bf4e19687adc15dd4e035596 100644 (file)
@@ -5,45 +5,72 @@
       <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>
index 2907f31152571fcfbb3b585b2bf1bad0cf77f456..3deaf195cf7aefb2d6af4643cc69921d14bdec7f 100644 (file)
       <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>
index 1ad5f094b71aeb8f747850ce49b5115d596389ef..156b36a94f4b07de5e90230738b39473be6f4d84 100644 (file)
       <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>
index 2a96037b057b929c65b8f0a92e58ccbe80eb891e..05722d7ed12db6bcdec2cbfba3c3d0354d533ca2 100644 (file)
@@ -2,7 +2,7 @@ file(GLOB UTILITY_SOURCES *.cpp)
 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)
diff --git a/src/gromacs/utility/arrayref.h b/src/gromacs/utility/arrayref.h
new file mode 100644 (file)
index 0000000..758515d
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+ *
+ *                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