for (size_t g = 0; g < sel_.size(); ++g)
{
fprintf(stderr, "Average mean distance for '%s': %.3f nm\n",
- sel_[g].name(), avem_->average(g));
+ sel_[g].name(), avem_->average(0, g));
}
}
#include <cmath>
+#include <algorithm>
#include <vector>
#include "gromacs/analysisdata/dataframe.h"
class AnalysisDataAverageModule::Impl
{
public:
- //! Averaging helper object.
- AnalysisDataFrameAverager averager_;
+ Impl() : bDataSets_(false) {}
+
+ //! Averaging helper objects for each input data set.
+ std::vector<AnalysisDataFrameAverager> averagers_;
+ //! Whether to average all columns in a data set into a single value.
+ bool bDataSets_;
};
AnalysisDataAverageModule::AnalysisDataAverageModule()
: impl_(new Impl())
{
- setColumnCount(2);
}
AnalysisDataAverageModule::~AnalysisDataAverageModule()
{
}
-int
-AnalysisDataAverageModule::flags() const
+void AnalysisDataAverageModule::setAverageDataSets(bool bDataSets)
{
- return efAllowMultipoint | efAllowMulticolumn | efAllowMissing;
+ impl_->bDataSets_ = bDataSets;
+}
+
+int AnalysisDataAverageModule::flags() const
+{
+ return efAllowMultipoint | efAllowMulticolumn | efAllowMissing
+ | efAllowMultipleDataSets;
}
void
AnalysisDataAverageModule::dataStarted(AbstractAnalysisData *data)
{
- const int valueCount = data->columnCount();
- impl_->averager_.setColumnCount(valueCount);
- setRowCount(valueCount);
+ if (impl_->bDataSets_)
+ {
+ setColumnCount(1);
+ setRowCount(data->dataSetCount());
+ impl_->averagers_.resize(1);
+ impl_->averagers_[0].setColumnCount(data->dataSetCount());
+ }
+ else
+ {
+ setColumnCount(data->dataSetCount());
+ impl_->averagers_.resize(data->dataSetCount());
+ int rowCount = 0;
+ for (int i = 0; i < data->dataSetCount(); ++i)
+ {
+ impl_->averagers_[i].setColumnCount(data->columnCount(i));
+ rowCount = std::max(rowCount, data->columnCount(i));
+ }
+ setRowCount(rowCount);
+ }
}
void
void
AnalysisDataAverageModule::pointsAdded(const AnalysisDataPointSetRef &points)
{
- impl_->averager_.addPoints(points);
+ if (impl_->bDataSets_)
+ {
+ const int dataSet = points.dataSetIndex();
+ for (int i = 0; i < points.columnCount(); ++i)
+ {
+ if (points.present(i))
+ {
+ impl_->averagers_[0].addValue(dataSet, points.y(i));
+ }
+ }
+ }
+ else
+ {
+ impl_->averagers_[points.dataSetIndex()].addPoints(points);
+ }
}
void
void
AnalysisDataAverageModule::dataFinished()
{
- impl_->averager_.finish();
allocateValues();
- for (int i = 0; i < rowCount(); ++i)
+ for (int i = 0; i < columnCount(); ++i)
{
- value(i, 0).setValue(impl_->averager_.average(i));
- value(i, 1).setValue(std::sqrt(impl_->averager_.variance(i)));
+ impl_->averagers_[i].finish();
+ int j = 0;
+ for (; j < impl_->averagers_[i].columnCount(); ++j)
+ {
+ value(j, i).setValue(impl_->averagers_[i].average(j),
+ std::sqrt(impl_->averagers_[i].variance(j)));
+ }
+ for (; j < rowCount(); ++j)
+ {
+ value(j, i).setValue(0.0, 0.0, false);
+ }
}
valuesReady();
}
-real
-AnalysisDataAverageModule::average(int index) const
+real AnalysisDataAverageModule::average(int dataSet, int column) const
+{
+ if (impl_->bDataSets_)
+ {
+ GMX_ASSERT(column == 0,
+ "Column should be zero with setAverageDataSets(true)");
+ std::swap(dataSet, column);
+ }
+ return value(column, dataSet).value();
+}
+
+real AnalysisDataAverageModule::standardDeviation(int dataSet, int column) const
{
- return value(index, 0).value();
+ if (impl_->bDataSets_)
+ {
+ GMX_ASSERT(column == 0,
+ "Column should be zero with setAverageDataSets(true)");
+ std::swap(dataSet, column);
+ }
+ return value(column, dataSet).error();
}
-real
-AnalysisDataAverageModule::stddev(int index) const
+int AnalysisDataAverageModule::sampleCount(int dataSet, int column) const
{
- return value(index, 1).value();
+ if (impl_->bDataSets_)
+ {
+ GMX_ASSERT(column == 0,
+ "Column should be zero with setAverageDataSets(true)");
+ std::swap(dataSet, column);
+ }
+ return impl_->averagers_[dataSet].sampleCount(column);
}
* Data module for independently averaging each column in input data.
*
* Computes the average and standard deviation independently for each column in
- * the input data. Multipoint data and missing data points are both supported.
+ * the input data. Multipoint data, multiple data sets, and missing data
+ * points are all supported.
* The average is always calculated over all frames and data points for a
* column.
- * Multiple input data sets are currently not supported.
*
- * Output data contains a frame for each column in the input data.
- * The first column of each output frame is the average of the corresponding
- * input column. The second output column is the standard deviation of the
- * corresponding input column.
- * average() and stddev() methods are also provided for convenient access to
- * these properties.
+ * Output data contains a column for each data set in the input data, and a
+ * frame for each column in the input data. If different data sets have
+ * different number of columns, the frame count accomodates the largest data
+ * set. Other columns are padded with zero values that are additionally marked
+ * as missing.
+ * Each value in the output data is the average of the corresponding
+ * input column in the corresponding input data set. The error value for each
+ * value provides the standard deviation of the corresponding input column.
+ * average(), standardDeviation(), and sampleCount() methods are also
+ * provided for convenient access to these properties.
*
* The output data becomes available only after the input data has been
* finished.
using AbstractAnalysisArrayData::setXAxis;
+ /*! \brief
+ * Sets the averaging to happen over entire data sets.
+ *
+ * If \p bDataSets is false (the default), the module averages each
+ * column separately. The output will have a column for each data set,
+ * and a row for each column.
+ *
+ * If \p bDataSets is true, the module averages all values within
+ * a single data set into a single average/standard deviation.
+ * The output will have only one column, with one row for each data
+ * set.
+ */
+ void setAverageDataSets(bool bDataSets);
+
virtual int flags() const;
virtual void dataStarted(AbstractAnalysisData *data);
virtual void frameFinished(const AnalysisDataFrameHeader &header);
virtual void dataFinished();
- //! Convenience access to the average of a data column.
- real average(int index) const;
- //! Convenience access to the standard deviation of a data column.
- real stddev(int index) const;
+ /*! \brief
+ * Convenience access to the average of a data column.
+ *
+ * Note that the interpretation of the parameters follows their naming:
+ * with \c setAverageDataSets(false), \p dataSet corresponds to a
+ * column in the output, but with \c setAverageDataSets(false) it
+ * corresponds to an output row. In both cases, it selects the data
+ * set; with \c setAverageDataSets(false), \p column should always be
+ * zero as there is only one value per data set.
+ */
+ real average(int dataSet, int column) const;
+ /*! \brief
+ * Convenience access to the standard deviation of a data column.
+ *
+ * See average() for the interpretation of the parameters.
+ */
+ real standardDeviation(int dataSet, int column) const;
+ /*! \brief
+ * Access the number of samples for a data column.
+ *
+ * See average() for the interpretation of the parameters.
+ */
+ int sampleCount(int dataSet, int column) const;
private:
class Impl;
public:
AnalysisDataFrameAverager() : bFinished_(false) {}
+ /*! \brief
+ * Returns the number of columns in this averager.
+ */
+ int columnCount() const { return values_.size(); }
+
/*! \brief
* Sets the number of columns in the input data.
*
*/
real average(int index) const
{
- GMX_ASSERT(index >= 0 && index <= static_cast<int>(values_.size()),
+ GMX_ASSERT(index >= 0 && index < columnCount(),
"Invalid column index");
GMX_ASSERT(bFinished_,
"Values available only after finished() has been called");
*/
real variance(int index) const
{
- GMX_ASSERT(index >= 0 && index <= static_cast<int>(values_.size()),
+ GMX_ASSERT(index >= 0 && index < columnCount(),
"Invalid column index");
GMX_ASSERT(bFinished_,
"Values available only after finished() has been called");
FILE *fp_;
bool bPlain_;
- bool gOmitX_;
+ bool bOmitX_;
+ bool bErrorsAsSeparateColumn_;
std::string title_;
std::string subtitle_;
std::string xlabel_;
};
AbstractPlotModule::Impl::Impl(const AnalysisDataPlotSettings &settings)
- : settings_(settings), fp_(NULL), bPlain_(false), gOmitX_(false),
- xscale_(1.0)
+ : settings_(settings), fp_(NULL), bPlain_(false), bOmitX_(false),
+ bErrorsAsSeparateColumn_(false), xscale_(1.0)
{
strcpy(xformat_, "%11.3f");
strcpy(yformat_, " %8.3f");
}
+void
+AbstractPlotModule::setErrorsAsSeparateColumn(bool bSeparate)
+{
+ impl_->bErrorsAsSeparateColumn_ = bSeparate;
+}
+
+
void
AbstractPlotModule::setOmitX(bool bOmitX)
{
- impl_->gOmitX_ = bOmitX;
+ impl_->bOmitX_ = bOmitX;
}
int
AbstractPlotModule::flags() const
{
- return efAllowMulticolumn | efAllowMultipoint | efAllowMultipleDataSets;
+ return efAllowMissing | efAllowMulticolumn | efAllowMultipoint
+ | efAllowMultipleDataSets;
}
{
return;
}
- if (!impl_->gOmitX_)
+ if (!impl_->bOmitX_)
{
std::fprintf(impl_->fp_, impl_->xformat_, frame.x() * impl_->xscale_);
}
void
-AbstractPlotModule::writeValue(real value) const
+AbstractPlotModule::writeValue(const AnalysisDataValue &value) const
{
GMX_ASSERT(isFileOpen(), "File not opened, but write attempted");
- std::fprintf(impl_->fp_, impl_->yformat_, value);
+ const real y = value.isSet() ? value.value() : 0.0;
+ std::fprintf(impl_->fp_, impl_->yformat_, y);
+ if (impl_->bErrorsAsSeparateColumn_)
+ {
+ const real dy = value.isSet() ? value.error() : 0.0;
+ std::fprintf(impl_->fp_, impl_->yformat_, dy);
+ }
}
//! \endcond
}
for (int i = 0; i < points.columnCount(); ++i)
{
- writeValue(points.y(i));
+ writeValue(points.values()[i]);
}
}
{
if (bWrite_[i])
{
- writeValue(points.y(i + d));
+ writeValue(points.values()[i + d]);
}
}
if (bWrite_[DIM])
{
- rvec y = { points.y(i), points.y(i + 1), points.y(i + 2) };
- writeValue(norm(y));
+ const rvec y = { points.y(i), points.y(i + 1), points.y(i + 2) };
+ AnalysisDataValue value(norm(y));
+ writeValue(value);
}
}
}
namespace gmx
{
+class AnalysisDataValue;
class Options;
class SelectionCollection;
* methods have any effect on the output.
*/
void setPlainOutput(bool bPlain);
+ /*! \brief
+ * Plot errors as a separate output column after each value column.
+ */
+ void setErrorsAsSeparateColumn(bool bSeparate);
/*! \brief
* Omit the X coordinates from the output.
*
*
* Must not be called if isFileOpen() returns false.
*/
- void writeValue(real value) const;
+ void writeValue(const AnalysisDataValue &value) const;
//! \endcond
private:
ASSERT_NO_THROW_GMX(presentAllData(input, &data));
}
+TEST_F(AverageModuleTest, HandlesMultipleDataSets)
+{
+ const AnalysisDataTestInput &input = MultiDataSetInputData::get();
+ gmx::AnalysisData data;
+ ASSERT_NO_THROW_GMX(setupDataObject(input, &data));
+
+ gmx::AnalysisDataAverageModulePointer module(
+ new gmx::AnalysisDataAverageModule);
+ data.addModule(module);
+
+ ASSERT_NO_THROW_GMX(addStaticCheckerModule(input, &data));
+ ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data));
+ ASSERT_NO_THROW_GMX(addReferenceCheckerModule("Average", module.get()));
+ ASSERT_NO_THROW_GMX(presentAllData(input, &data));
+}
+
+TEST_F(AverageModuleTest, HandlesDataSetAveraging)
+{
+ const AnalysisDataTestInput &input = MultiDataSetInputData::get();
+ gmx::AnalysisData data;
+ ASSERT_NO_THROW_GMX(setupDataObject(input, &data));
+
+ gmx::AnalysisDataAverageModulePointer module(
+ new gmx::AnalysisDataAverageModule);
+ module->setAverageDataSets(true);
+ data.addModule(module);
+
+ ASSERT_NO_THROW_GMX(addStaticCheckerModule(input, &data));
+ ASSERT_NO_THROW_GMX(addReferenceCheckerModule("InputData", &data));
+ ASSERT_NO_THROW_GMX(addReferenceCheckerModule("Average", module.get()));
+ ASSERT_NO_THROW_GMX(presentAllData(input, &data));
+}
+
TEST_F(AverageModuleTest, CanCustomizeXAxis)
{
const AnalysisDataTestInput &input = SimpleInputData::get();
<DataFrame Name="Frame0">
<Real Name="X">0.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
- <DataValue>
- <Real Name="Value">1.000000</Real>
- </DataValue>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
+ <Real Name="Error">1.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.666667</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.577350</Real>
+ <Real Name="Error">0.577350</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">2.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
- <DataValue>
- <Real Name="Value">1.000000</Real>
- </DataValue>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
+ <Real Name="Error">1.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame0">
<Real Name="X">0.500000</Real>
<DataValues>
- <Int Name="Count">2</Int>
- <DataValue>
- <Real Name="Value">1.000000</Real>
- </DataValue>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
+ <Real Name="Error">1.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.666667</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.577350</Real>
+ <Real Name="Error">0.577350</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">1.500000</Real>
<DataValues>
- <Int Name="Count">2</Int>
- <DataValue>
- <Real Name="Value">1.000000</Real>
- </DataValue>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
+ <Real Name="Error">1.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
--- /dev/null
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+ <AnalysisData Name="InputData">
+ <DataFrame Name="Frame0">
+ <Real Name="X">1.000000</Real>
+ <DataValues>
+ <Int Name="Count">3</Int>
+ <Int Name="DataSet">0</Int>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ </DataValues>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <Int Name="DataSet">0</Int>
+ <Int Name="FirstColumn">0</Int>
+ <Int Name="LastColumn">1</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <Int Name="DataSet">1</Int>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ </DataValues>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <Int Name="DataSet">1</Int>
+ <Int Name="FirstColumn">1</Int>
+ <Int Name="LastColumn">1</Int>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame1">
+ <Real Name="X">2.000000</Real>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <Int Name="DataSet">0</Int>
+ <Int Name="FirstColumn">0</Int>
+ <Int Name="LastColumn">1</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ </DataValues>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <Int Name="DataSet">0</Int>
+ <Int Name="FirstColumn">2</Int>
+ <Int Name="LastColumn">2</Int>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ </DataValues>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <Int Name="DataSet">1</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame2">
+ <Real Name="X">3.000000</Real>
+ <DataValues>
+ <Int Name="Count">3</Int>
+ <Int Name="DataSet">0</Int>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <Int Name="DataSet">1</Int>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ </AnalysisData>
+ <AnalysisData Name="Average">
+ <DataFrame Name="Frame0">
+ <Real Name="X">0.000000</Real>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <DataValue>
+ <Real Name="Value">0.909091</Real>
+ <Real Name="Error">0.831209</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame1">
+ <Real Name="X">1.000000</Real>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <DataValue>
+ <Real Name="Value">1.142857</Real>
+ <Real Name="Error">0.899735</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ </AnalysisData>
+</ReferenceData>
--- /dev/null
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+ <AnalysisData Name="InputData">
+ <DataFrame Name="Frame0">
+ <Real Name="X">1.000000</Real>
+ <DataValues>
+ <Int Name="Count">3</Int>
+ <Int Name="DataSet">0</Int>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ </DataValues>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <Int Name="DataSet">0</Int>
+ <Int Name="FirstColumn">0</Int>
+ <Int Name="LastColumn">1</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <Int Name="DataSet">1</Int>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ </DataValues>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <Int Name="DataSet">1</Int>
+ <Int Name="FirstColumn">1</Int>
+ <Int Name="LastColumn">1</Int>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame1">
+ <Real Name="X">2.000000</Real>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <Int Name="DataSet">0</Int>
+ <Int Name="FirstColumn">0</Int>
+ <Int Name="LastColumn">1</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ </DataValues>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <Int Name="DataSet">0</Int>
+ <Int Name="FirstColumn">2</Int>
+ <Int Name="LastColumn">2</Int>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ </DataValues>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <Int Name="DataSet">1</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame2">
+ <Real Name="X">3.000000</Real>
+ <DataValues>
+ <Int Name="Count">3</Int>
+ <Int Name="DataSet">0</Int>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <Int Name="DataSet">1</Int>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">2.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ </AnalysisData>
+ <AnalysisData Name="Average">
+ <DataFrame Name="Frame0">
+ <Real Name="X">0.000000</Real>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.816497</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">1.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame1">
+ <Real Name="X">1.000000</Real>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <DataValue>
+ <Real Name="Value">0.500000</Real>
+ <Real Name="Error">0.577350</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.250000</Real>
+ <Real Name="Error">0.957427</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame2">
+ <Real Name="X">2.000000</Real>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <DataValue>
+ <Real Name="Value">1.333333</Real>
+ <Real Name="Error">1.154701</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ <Bool Name="Present">false</Bool>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ </AnalysisData>
+</ReferenceData>
<DataFrame Name="Frame0">
<Real Name="X">0.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.333333</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.816497</Real>
+ <Real Name="Error">0.816497</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">1.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.577350</Real>
+ <Real Name="Error">0.577350</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">2.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">1.414214</Real>
+ <Real Name="Error">1.414214</Real>
</DataValue>
</DataValues>
</DataFrame>
</table>
</xsl:template>
+<xsl:template match="DataValue[Bool[@Name='Present']='false']">
+ (
+ <xsl:value-of select="Real[@Name='Value']"/>
+ <xsl:if test="Real[@Name='Error']">
+ ± <xsl:value-of select="Real[@Name='Error']"/>
+ </xsl:if>
+ )
+</xsl:template>
<xsl:template match="DataValue">
<xsl:value-of select="Real[@Name='Value']"/>
<xsl:if test="Real[@Name='Error']">
: TrajectoryAnalysisModule(name, shortDescription),
meanLength_(0.1), lengthDev_(1.0), binWidth_(0.001)
{
+ summaryStatsModule_.reset(new AnalysisDataAverageModule());
+ summaryStatsModule_->setAverageDataSets(true);
+ distances_.addModule(summaryStatsModule_);
+ allStatsModule_.reset(new AnalysisDataAverageModule());
+ distances_.addModule(allStatsModule_);
averageModule_.reset(new AnalysisDataFrameAverageModule());
distances_.addModule(averageModule_);
histogramModule_.reset(new AnalysisDataSimpleHistogramModule());
registerAnalysisDataset(&distances_, "dist");
registerAnalysisDataset(&xyz_, "xyz");
+ registerBasicDataset(summaryStatsModule_.get(), "stats");
+ registerBasicDataset(allStatsModule_.get(), "allstats");
registerBasicDataset(averageModule_.get(), "average");
registerBasicDataset(&histogramModule_->averager(), "histogram");
}
"[TT]-oh[tt] writes a histogram of the distances for each selection.",
"The location of the histogram is set with [TT]-len[tt] and",
"[TT]-tol[tt]. Bin width is set with [TT]-binw[tt].",
+ "[TT]-oallstat[tt] writes out the average and standard deviation for",
+ "each individual distance, calculated over the frames."
};
options->setDescription(concatenateStrings(desc));
options->addOption(FileNameOption("oh").filetype(eftPlot).outputFile()
.store(&fnHistogram_).defaultBasename("disthist")
.description("Histogram of the distances"));
+ options->addOption(FileNameOption("oallstat").filetype(eftPlot).outputFile()
+ .store(&fnAllStats_).defaultBasename("diststat")
+ .description("Statistics for individual distances"));
// TODO: Consider what is the best way to support dynamic selections.
// Again, most of the code already supports it, but it needs to be
// considered how should -oall work, and additional checks should be added.
// TODO: Add legends
histogramModule_->averager().addModule(plotm);
}
+
+ if (!fnAllStats_.empty())
+ {
+ AnalysisDataPlotModulePointer plotm(
+ new AnalysisDataPlotModule(settings.plotSettings()));
+ plotm->setFileName(fnAllStats_);
+ plotm->setErrorsAsSeparateColumn(true);
+ plotm->setTitle("Statistics for individual distances");
+ plotm->setXLabel("Distance index");
+ plotm->setYLabel("Average/standard deviation (nm)");
+ // TODO: Add legends
+ // TODO: Consider whether this output format is the best possible.
+ allStatsModule_->addModule(plotm);
+ }
}
void
Distance::writeOutput()
{
- // TODO: Print bond length statistics
- //fprintf(stderr, "Average distance: %f\n", avem_->average(0));
- //fprintf(stderr, "Std. deviation: %f\n", avem_->stddev(0));
+ SelectionList::const_iterator sel;
+ int index;
+ for (sel = sel_.begin(), index = 0; sel != sel_.end(); ++sel, ++index)
+ {
+ printf("%s:\n", sel->name());
+ printf(" Number of samples: %d\n",
+ summaryStatsModule_->sampleCount(index, 0));
+ printf(" Average distance: %-6.3f nm\n",
+ summaryStatsModule_->average(index, 0));
+ printf(" Standard deviation: %-6.3f nm\n",
+ summaryStatsModule_->standardDeviation(index, 0));
+ }
}
} // namespace analysismodules
std::string fnAll_;
std::string fnXYZ_;
std::string fnHistogram_;
+ std::string fnAllStats_;
double meanLength_;
double lengthDev_;
double binWidth_;
AnalysisData distances_;
AnalysisData xyz_;
+ AnalysisDataAverageModulePointer summaryStatsModule_;
+ AnalysisDataAverageModulePointer allStatsModule_;
AnalysisDataFrameAverageModulePointer averageModule_;
AnalysisDataSimpleHistogramModulePointer histogramModule_;
FreeVolume::writeOutput()
{
// Final results come from statistics module in analysis framework
- double FVaver = adata_->average(0);
- double FVerror = adata_->stddev(0);
+ double FVaver = adata_->average(0, 0);
+ double FVerror = adata_->standardDeviation(0, 0);
printf("Free volume %.2f +/- %.2f %%\n", FVaver, FVerror);
- double Vaver = adata_->average(1);
- double Verror = adata_->stddev(1);
+ double Vaver = adata_->average(0, 1);
+ double Verror = adata_->standardDeviation(0, 1);
printf("Total volume %.2f +/- %.2f nm^3\n", Vaver, Verror);
printf("Number of molecules %d total mass %.2f Dalton\n", nmol_, mtot_);
- double RhoAver = mtot_ / (adata_->average(1) * 1e-24 * AVOGADRO);
+ double RhoAver = mtot_ / (Vaver * 1e-24 * AVOGADRO);
double RhoError = sqr(RhoAver / Vaver)*Verror;
printf("Average molar mass: %.2f Dalton\n", mtot_/nmol_);
ConstArrayRef<int>::const_iterator ai;
for (ai = atomIndices.begin(); ai != atomIndices.end(); ++ai)
{
- pdbinfo[*ai].occup = occupancyModule_->average(i);
+ pdbinfo[*ai].occup = occupancyModule_->average(0, i);
}
}
std::vector<int> indices;
for (int i = 0; i < sel_[0].posCount(); ++i)
{
- if (occupancyModule_->average(i) > 0)
+ if (occupancyModule_->average(0, i) > 0)
{
ConstArrayRef<int> atomIndices = sel_[0].position(i).atomIndices();
ConstArrayRef<int>::const_iterator ai;
<ReferenceData>
<String Name="CommandLine">distance -select 'atomname S1 S2' -len 2 -binw 0.5</String>
<OutputData Name="Data">
+ <AnalysisData Name="allstats">
+ <DataFrame Name="Frame0">
+ <Real Name="X">0.000000</Real>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame1">
+ <Real Name="X">1.000000</Real>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame2">
+ <Real Name="X">2.000000</Real>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <DataValue>
+ <Real Name="Value">3.162278</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame3">
+ <Real Name="X">3.000000</Real>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame4">
+ <Real Name="X">4.000000</Real>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ </AnalysisData>
<AnalysisData Name="average">
<DataFrame Name="Frame0">
<Real Name="X">0.000000</Real>
</DataValues>
</DataFrame>
</AnalysisData>
+ <AnalysisData Name="stats">
+ <DataFrame Name="Frame0">
+ <Real Name="X">0.000000</Real>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <DataValue>
+ <Real Name="Value">1.432456</Real>
+ <Real Name="Error">0.967000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ </AnalysisData>
<AnalysisData Name="xyz">
<DataFrame Name="Frame0">
<Real Name="X">0.000000</Real>
<ReferenceData>
<String Name="CommandLine">distance -select 'atomname S1 S2' 'resindex 1 to 4 and atomname CB merge resindex 2 to 5 and atomname CB' -len 2 -binw 0.5</String>
<OutputData Name="Data">
+ <AnalysisData Name="allstats">
+ <DataFrame Name="Frame0">
+ <Real Name="X">0.000000</Real>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">3.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame1">
+ <Real Name="X">1.000000</Real>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.414214</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame2">
+ <Real Name="X">2.000000</Real>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <DataValue>
+ <Real Name="Value">3.162278</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.414214</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame3">
+ <Real Name="X">3.000000</Real>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">1.414214</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame4">
+ <Real Name="X">4.000000</Real>
+ <DataValues>
+ <Int Name="Count">2</Int>
+ <DataValue>
+ <Real Name="Value">1.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ </DataValue>
+ <DataValue>
+ <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
+ <Bool Name="Present">false</Bool>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ </AnalysisData>
<AnalysisData Name="average">
<DataFrame Name="Frame0">
<Real Name="X">0.000000</Real>
</DataValues>
</DataFrame>
</AnalysisData>
+ <AnalysisData Name="stats">
+ <DataFrame Name="Frame0">
+ <Real Name="X">0.000000</Real>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <DataValue>
+ <Real Name="Value">1.432456</Real>
+ <Real Name="Error">0.967000</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ <DataFrame Name="Frame1">
+ <Real Name="X">1.000000</Real>
+ <DataValues>
+ <Int Name="Count">1</Int>
+ <DataValue>
+ <Real Name="Value">1.810660</Real>
+ <Real Name="Error">0.792893</Real>
+ </DataValue>
+ </DataValues>
+ </DataFrame>
+ </AnalysisData>
<AnalysisData Name="xyz">
<DataFrame Name="Frame0">
<Real Name="X">0.000000</Real>
<DataFrame Name="Frame0">
<Real Name="X">1.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">4.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame4">
<Real Name="X">5.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame5">
<Real Name="X">6.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame6">
<Real Name="X">7.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame7">
<Real Name="X">8.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame8">
<Real Name="X">9.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame9">
<Real Name="X">10.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame10">
<Real Name="X">11.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
- <DataValue>
- <Real Name="Value">0.000000</Real>
- </DataValue>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame11">
<Real Name="X">12.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame12">
<Real Name="X">13.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame13">
<Real Name="X">14.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame14">
<Real Name="X">15.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
- <DataValue>
- <Real Name="Value">0.000000</Real>
- </DataValue>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame0">
<Real Name="X">1.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">4.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame4">
<Real Name="X">5.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame5">
<Real Name="X">6.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame6">
<Real Name="X">7.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame7">
<Real Name="X">8.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame8">
<Real Name="X">9.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
- <DataValue>
- <Real Name="Value">0.000000</Real>
- </DataValue>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame0">
<Real Name="X">1.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">4.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame4">
<Real Name="X">5.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame5">
<Real Name="X">6.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame6">
<Real Name="X">7.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame7">
<Real Name="X">8.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame8">
<Real Name="X">9.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
- <DataValue>
- <Real Name="Value">0.000000</Real>
- </DataValue>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame0">
<Real Name="X">1.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">4.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame4">
<Real Name="X">5.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame5">
<Real Name="X">6.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame6">
<Real Name="X">7.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame7">
<Real Name="X">8.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame8">
<Real Name="X">9.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
- <DataValue>
- <Real Name="Value">0.000000</Real>
- </DataValue>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame0">
<Real Name="X">1.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame1">
<Real Name="X">2.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame2">
<Real Name="X">3.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame3">
<Real Name="X">4.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame4">
<Real Name="X">5.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame5">
<Real Name="X">6.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame6">
<Real Name="X">7.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">1.000000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame7">
<Real Name="X">8.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.500000</Real>
- </DataValue>
- <DataValue>
- <Real Name="Value">0.707107</Real>
+ <Real Name="Error">0.707107</Real>
</DataValue>
</DataValues>
</DataFrame>
<DataFrame Name="Frame8">
<Real Name="X">9.000000</Real>
<DataValues>
- <Int Name="Count">2</Int>
- <DataValue>
- <Real Name="Value">0.000000</Real>
- </DataValue>
+ <Int Name="Count">1</Int>
<DataValue>
<Real Name="Value">0.000000</Real>
+ <Real Name="Error">0.000000</Real>
</DataValue>
</DataValues>
</DataFrame>
</table>
</xsl:template>
+<xsl:template match="DataValue[Bool[@Name='Present']='false']">
+ (
+ <xsl:value-of select="Real[@Name='Value']"/>
+ <xsl:if test="Real[@Name='Error']">
+ ± <xsl:value-of select="Real[@Name='Error']"/>
+ </xsl:if>
+ )
+</xsl:template>
<xsl:template match="DataValue">
<xsl:value-of select="Real[@Name='Value']"/>
<xsl:if test="Real[@Name='Error']">
</table>
</xsl:template>
+<xsl:template match="DataValue[Bool[@Name='Present']='false']">
+ (
+ <xsl:value-of select="Real[@Name='Value']"/>
+ <xsl:if test="Real[@Name='Error']">
+ ± <xsl:value-of select="Real[@Name='Error']"/>
+ </xsl:if>
+ )
+</xsl:template>
<xsl:template match="DataValue">
<xsl:value-of select="Real[@Name='Value']"/>
<xsl:if test="Real[@Name='Error']">
MockAnalysisDataModule::setupReferenceCheck(const TestReferenceChecker &checker,
AbstractAnalysisData *source)
{
- impl_->flags_ |= efAllowMulticolumn | efAllowMultipoint | efAllowMultipleDataSets;
+ impl_->flags_ |= efAllowMulticolumn | efAllowMultipoint | efAllowMissing
+ | efAllowMultipleDataSets;
impl_->rootChecker_.reset(new TestReferenceChecker(checker));
// Google Mock does not support checking the order fully, because