diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/IMDWorkspace.h b/Code/Mantid/Framework/API/inc/MantidAPI/IMDWorkspace.h index d224a214cb02dc8b404c187dcbe49f378b72aeb0..1fd2f2eb790ce1128de51146649b8127e9023130 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/IMDWorkspace.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/IMDWorkspace.h @@ -92,103 +92,101 @@ namespace Mantid - - /// Get the signal at the specified index. - virtual double getSignalAt(size_t index1) const + virtual signal_t getSignalAt(size_t index1) const { return getPoint(index1).getSignal(); } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t) - virtual double getSignalAt(size_t index1, size_t index2) const + virtual signal_t getSignalAt(size_t index1, size_t index2) const { return getCell(index1,index2).getSignal(); } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t) - virtual double getSignalAt(size_t index1, size_t index2, size_t index3) const + virtual signal_t getSignalAt(size_t index1, size_t index2, size_t index3) const { return getCell(index1,index2,index3).getSignal(); } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t) - virtual double getSignalAt(size_t index1, size_t index2, size_t index3, size_t index4) const + virtual signal_t getSignalAt(size_t index1, size_t index2, size_t index3, size_t index4) const { return getCell(index1,index2,index3,index4).getSignal(); } /// Get the error of the signal at the specified index. - virtual double getErrorAt(size_t index) const + virtual signal_t getErrorAt(size_t index) const { return getPoint(index).getError(); } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t) - virtual double getErrorAt(size_t index1, size_t index2) const + virtual signal_t getErrorAt(size_t index1, size_t index2) const { return getCell(index1,index2).getError(); } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t) - virtual double getErrorAt(size_t index1, size_t index2, size_t index3) const + virtual signal_t getErrorAt(size_t index1, size_t index2, size_t index3) const { return getCell(index1,index2,index3).getError(); } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t) - virtual double getErrorAt(size_t index1, size_t index2, size_t index3, size_t index4) const + virtual signal_t getErrorAt(size_t index1, size_t index2, size_t index3, size_t index4) const { return getCell(index1,index2,index3,index4).getError(); } /// Get the signal at the specified index, normalized by cell volume - virtual double getSignalNormalizedAt(size_t index) const + virtual signal_t getSignalNormalizedAt(size_t index) const { UNUSED_ARG(index); throw std::runtime_error("Not implemented yet."); } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getSignalNormalizedAt(size_t index1, size_t index2) const + virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2) const { UNUSED_ARG(index1); UNUSED_ARG(index2); throw std::runtime_error("Not implemented yet."); } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getSignalNormalizedAt(size_t index1, size_t index2, size_t index3) const + virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2, size_t index3) const { UNUSED_ARG(index1); UNUSED_ARG(index2); UNUSED_ARG(index3); throw std::runtime_error("Not implemented yet."); } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const + virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const { UNUSED_ARG(index1); UNUSED_ARG(index2); UNUSED_ARG(index3); UNUSED_ARG(index4); throw std::runtime_error("Not implemented yet."); } /// Get the error of the signal at the specified index, normalized by cell volume - virtual double getErrorNormalizedAt(size_t index) const + virtual signal_t getErrorNormalizedAt(size_t index) const { UNUSED_ARG(index); throw std::runtime_error("Not implemented yet."); } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getErrorNormalizedAt(size_t index1, size_t index2) const + virtual signal_t getErrorNormalizedAt(size_t index1, size_t index2) const { UNUSED_ARG(index1); UNUSED_ARG(index2); throw std::runtime_error("Not implemented yet."); } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getErrorNormalizedAt(size_t index1, size_t index2, size_t index3) const + virtual signal_t getErrorNormalizedAt(size_t index1, size_t index2, size_t index3) const { UNUSED_ARG(index1); UNUSED_ARG(index2); UNUSED_ARG(index3); throw std::runtime_error("Not implemented yet."); } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getErrorNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const + virtual signal_t getErrorNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const { UNUSED_ARG(index1); UNUSED_ARG(index2); UNUSED_ARG(index3); UNUSED_ARG(index4); throw std::runtime_error("Not implemented yet."); } @@ -197,13 +195,13 @@ namespace Mantid /// Return a vector containing a copy of the signal data in the workspace. TODO: Make this more efficient if needed. - virtual std::vector<double> getSignalDataVector() const + virtual std::vector<signal_t> getSignalDataVector() const { throw std::runtime_error("Not implemented yet."); } /// Return a vector containing a copy of the signal data in the workspace. TODO: Make this more efficient if needed. - virtual std::vector<double> getErrorDataVector() const + virtual std::vector<signal_t> getErrorDataVector() const { throw std::runtime_error("Not implemented yet."); } diff --git a/Code/Mantid/Framework/API/src/IMDEventWorkspace.cpp b/Code/Mantid/Framework/API/src/IMDEventWorkspace.cpp index 1a8aa671fedf98c8ca2a7621ef545d0788f294a3..caf4d3edbee395a0e8b194d2c4d13d8c3fa0913b 100644 --- a/Code/Mantid/Framework/API/src/IMDEventWorkspace.cpp +++ b/Code/Mantid/Framework/API/src/IMDEventWorkspace.cpp @@ -2,7 +2,7 @@ #include "MantidAPI/IMDEventWorkspace.h" #include "MantidKernel/IPropertyManager.h" -using Mantid::MDEvents::coord_t; +using Mantid::coord_t; using namespace Mantid::Geometry; namespace Mantid diff --git a/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp b/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp index 7f3085751e0d4b95299ec1cc1784987ac3d8401c..4f7e8e87093f35e5bcbf31418695b9eda9a02ea1 100644 --- a/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp +++ b/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp @@ -1077,17 +1077,17 @@ namespace Mantid { VecCoordinate verts(4); - double x = this->dataX(histogram)[bin]; - double signal = this->dataY(histogram)[bin]; - double error = this->dataE(histogram)[bin]; - double histogram_d = static_cast<double>(histogram); + signal_t signal = this->dataY(histogram)[bin]; + signal_t error = this->dataE(histogram)[bin]; + coord_t x = this->dataX(histogram)[bin]; + coord_t histogram_d = static_cast<double>(histogram); if(isHistogramData()) //TODO. complete vertex generating cases. { - verts[0] = coordinate::createCoordinate2D(x, histogram_d); - verts[1] = coordinate::createCoordinate2D(this->dataX(histogram)[bin+1], histogram_d); - verts[2] = coordinate::createCoordinate2D(x, histogram_d+1.); - verts[3] = coordinate::createCoordinate2D(this->dataX(histogram)[bin+1], histogram_d+1.); + verts[0] = Coordinate::createCoordinate2D(x, histogram_d); + verts[1] = Coordinate::createCoordinate2D(this->dataX(histogram)[bin+1], histogram_d); + verts[2] = Coordinate::createCoordinate2D(x, histogram_d+1.); + verts[3] = Coordinate::createCoordinate2D(this->dataX(histogram)[bin+1], histogram_d+1.); } IDetector_sptr detector; diff --git a/Code/Mantid/Framework/API/test/IMDWorkspaceTest.h b/Code/Mantid/Framework/API/test/IMDWorkspaceTest.h index f8177a0a3dca95f37f4be57f4dd5c80decac87de..6edaed901e4e1549d58c932a61d345383b23c3d6 100644 --- a/Code/Mantid/Framework/API/test/IMDWorkspaceTest.h +++ b/Code/Mantid/Framework/API/test/IMDWorkspaceTest.h @@ -204,7 +204,7 @@ public: void testGetPointVertexes() { const Mantid::Geometry::SignalAggregate& pointA = workspace.getPoint(4); - std::vector<coordinate> vertexes = pointA.getVertexes(); + std::vector<Coordinate> vertexes = pointA.getVertexes(); TSM_ASSERT_EQUALS("Wrong number of vertexes returned", 4, vertexes.size()); TSM_ASSERT_EQUALS("The v0 x-value is incorrect.", 4, vertexes.at(0).getX()); diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/Coordinate.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/Coordinate.h index 7ac70fac0e3e4b1b7ef14b21308fc22626478e10..622d1fce74436e71b86eff70a41ab2159ec653c5 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/Coordinate.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/Coordinate.h @@ -5,10 +5,10 @@ * Author: owen */ -#ifndef MD_COORDINATE_H_ -#define MD_COORDINATE_H_ +#ifndef MD_Coordinate_H_ +#define MD_Coordinate_H_ -/** The class represents a 4dimensional coordinate. Supports simple rendering of MDCells and MDPoints. +/** The class represents a 4dimensional Coordinate. Supports simple rendering of MDCells and MDPoints. * * Abstract type for a multi dimensional dimension. Gives a read-only layer to the concrete implementation. @@ -43,67 +43,67 @@ namespace Mantid { namespace Geometry { -class EXPORT_OPT_MANTID_GEOMETRY coordinate +class EXPORT_OPT_MANTID_GEOMETRY Coordinate { public: ///Default constructor. All vertexes zero. - coordinate(); + Coordinate(); /// Construct from an array - coordinate(Mantid::MDEvents::coord_t * coords, size_t numdims); + Coordinate(Mantid::coord_t * coords, size_t numdims); //Copy constructor - coordinate(const coordinate & other); + Coordinate(const Coordinate & other); //Assignment operator - coordinate & operator= (const coordinate & other); + Coordinate & operator= (const Coordinate & other); ///Construction Method for 1D. - static coordinate createCoordinate1D(const double& xArg); + static Coordinate createCoordinate1D(const coord_t& xArg); ///Construction Method for 2D. - static coordinate createCoordinate2D(const double& xArg, const double& yArg); + static Coordinate createCoordinate2D(const coord_t& xArg, const coord_t& yArg); ///Construction Method for 3D. - static coordinate createCoordinate3D(const double& xArg, const double& yArg, const double& zArg); + static Coordinate createCoordinate3D(const coord_t& xArg, const coord_t& yArg, const coord_t& zArg); ///Construction Method for 4D. - static coordinate createCoordinate4D(const double& xArg, const double& yArg,const double& zArg,const double& tArg); + static Coordinate createCoordinate4D(const coord_t& xArg, const coord_t& yArg,const coord_t& zArg,const coord_t& tArg); /// Getter for x value - double getX() const; + coord_t getX() const; /// Getter for y value. - double getY() const; + coord_t getY() const; /// Getter for z value. - double getZ() const; + coord_t getZ() const; /// Getter for t value. - double gett() const; + coord_t gett() const; private: - double m_x; - double m_y; - double m_z; - double m_t; + coord_t m_x; + coord_t m_y; + coord_t m_z; + coord_t m_t; ///Constructor for 1D. - coordinate(const double& xArg); + Coordinate(const coord_t& xArg); ///Constructor for 2D. - coordinate(const double& xArg, const double& yArg); + Coordinate(const coord_t& xArg, const coord_t& yArg); ///Constructor for 3D. - coordinate(const double& xArg, const double& yArg, const double& zArg); + Coordinate(const coord_t& xArg, const coord_t& yArg, const coord_t& zArg); ///Constructor for 4D. - coordinate(const double& xArg, const double& yArg,const double& zArg,const double& tArg); + Coordinate(const coord_t& xArg, const coord_t& yArg,const coord_t& zArg,const coord_t& tArg); }; -typedef std::vector<coordinate> VecCoordinate; +typedef std::vector<Coordinate> VecCoordinate; } } -#endif /* COORDINATE_H_ */ +#endif /* Coordinate_H_ */ diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDCell.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDCell.h index aa42bc634a5be260376d98b41ed89fead5ebb7d8..b2e21ed11ca1c57d20fe4dda69f187cfb1ad4129 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDCell.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDCell.h @@ -43,19 +43,19 @@ namespace Mantid private: double m_cachedSignal; double m_cachedError; - std::vector<coordinate> m_vertexes; + std::vector<Coordinate> m_vertexes; std::vector<boost::shared_ptr<MDPoint> > m_contributingPoints; inline void calculateCachedValues(); public: /// Default constructor MDCell(){}; /// Construct from exising points. - MDCell(std::vector<boost::shared_ptr<MDPoint> > pContributingPoints, std::vector<coordinate> vertexes); + MDCell(std::vector<boost::shared_ptr<MDPoint> > pContributingPoints, std::vector<Coordinate> vertexes); /// Construct image-only mode. No contributing points maintained. - MDCell(const double& signal,const double& error, const std::vector<coordinate>& vertexes); - std::vector<coordinate> getVertexes() const; - double getSignal() const; - double getError() const; + MDCell(const double& signal,const double& error, const std::vector<Coordinate>& vertexes); + std::vector<Coordinate> getVertexes() const; + signal_t getSignal() const; + signal_t getError() const; std::vector<boost::shared_ptr<MDPoint> > getContributingPoints() const; ~MDCell(); }; diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDPoint.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDPoint.h index 3084573658f61c77632db4666cdb43799fc9bb97..de5959d7761c8c18c0dcce15ccfe4c484d627f5e 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDPoint.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDPoint.h @@ -32,10 +32,11 @@ // Includes //---------------------------------------------------------------------- #include "MantidGeometry/DllExport.h" -#include <vector> #include "MantidGeometry/IDetector.h" #include "MantidGeometry/IInstrument.h" #include "MantidGeometry/MDGeometry/Coordinate.h" +#include "MantidKernel/System.h" +#include <vector> namespace Mantid { @@ -46,9 +47,9 @@ namespace Mantid class EXPORT_OPT_MANTID_GEOMETRY SignalAggregate { public: - virtual std::vector<coordinate> getVertexes() const = 0; - virtual double getSignal() const = 0; - virtual double getError() const = 0; + virtual std::vector<Coordinate> getVertexes() const = 0; + virtual signal_t getSignal() const = 0; + virtual signal_t getError() const = 0; virtual std::vector<boost::shared_ptr<MDPoint> > getContributingPoints() const = 0; virtual ~SignalAggregate(){}; }; @@ -56,19 +57,19 @@ namespace Mantid class EXPORT_OPT_MANTID_GEOMETRY MDPoint : public SignalAggregate { private: - double m_signal; - double m_error; + signal_t m_signal; + signal_t m_error; IInstrument_sptr m_instrument; IDetector_sptr m_detector; - std::vector<coordinate> m_vertexes; + std::vector<Coordinate> m_vertexes; int m_runId; public: MDPoint(){}; - MDPoint(double signal, double error, const std::vector<coordinate>& vertexes, IDetector_sptr detector, IInstrument_sptr instrument, + MDPoint(signal_t signal, signal_t error, const std::vector<Coordinate>& vertexes, IDetector_sptr detector, IInstrument_sptr instrument, const int runId = 0); - std::vector<coordinate> getVertexes() const; - double getSignal() const; - double getError() const; + std::vector<Coordinate> getVertexes() const; + signal_t getSignal() const; + signal_t getError() const; IDetector_sptr getDetector() const; IInstrument_sptr getInstrument() const; int getRunId() const; diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/Coordinate.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/Coordinate.cpp index 53d28cfbe1ea21be0364a6f461d912d4990dc299..3eb56ff6aa940670f287d3da1e87f9622fd8e9bc 100644 --- a/Code/Mantid/Framework/Geometry/src/MDGeometry/Coordinate.cpp +++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/Coordinate.cpp @@ -4,42 +4,42 @@ namespace Mantid { namespace Geometry { -///Construction Method for 1D. - coordinate coordinate::createCoordinate1D(const double& xArg) + ///Construction Method for 1D. + Coordinate Coordinate::createCoordinate1D(const coord_t& xArg) { - return coordinate(xArg); + return Coordinate(xArg); } ///Construction Method for 2D. - coordinate coordinate::createCoordinate2D(const double& xArg, const double& yArg) + Coordinate Coordinate::createCoordinate2D(const coord_t& xArg, const coord_t& yArg) { - return coordinate(xArg, yArg); + return Coordinate(xArg, yArg); } ///Construction Method for 3D. - coordinate coordinate::createCoordinate3D(const double& xArg, const double& yArg, const double& zArg) + Coordinate Coordinate::createCoordinate3D(const coord_t& xArg, const coord_t& yArg, const coord_t& zArg) { - return coordinate(xArg, yArg, zArg); + return Coordinate(xArg, yArg, zArg); } ///Construction Method for 4D. - coordinate coordinate::createCoordinate4D(const double& xArg, const double& yArg,const double& zArg,const double& tArg) + Coordinate Coordinate::createCoordinate4D(const coord_t& xArg, const coord_t& yArg,const coord_t& zArg,const coord_t& tArg) { - return coordinate(xArg, yArg, zArg, tArg); + return Coordinate(xArg, yArg, zArg, tArg); } /** Default Constructor */ - coordinate::coordinate() + Coordinate::Coordinate() : m_x(0),m_y(0),m_z(0),m_t(0) { } /** Constructor * - * @param coords :: array of coordinates + * @param coords :: array of Coordinates * @param numdims :: number of dimensions in array */ - coordinate::coordinate(Mantid::MDEvents::coord_t * coords, size_t numdims) + Coordinate::Coordinate(Mantid::coord_t * coords, size_t numdims) : m_x(0),m_y(0),m_z(0),m_t(0) { if (numdims > 0) m_x = coords[0]; @@ -49,32 +49,32 @@ namespace Geometry } - coordinate::coordinate(const double& xArg) + Coordinate::Coordinate(const coord_t& xArg) : m_x(xArg),m_y(0),m_z(0),m_t(0) { } - coordinate::coordinate(const double& xArg, const double& yArg) + Coordinate::Coordinate(const coord_t& xArg, const coord_t& yArg) : m_x(xArg),m_y(yArg),m_z(0),m_t(0) { } - coordinate::coordinate(const double& xArg, const double& yArg, const double& zArg) + Coordinate::Coordinate(const coord_t& xArg, const coord_t& yArg, const coord_t& zArg) : m_x(xArg),m_y(yArg),m_z(zArg),m_t(0) { } - coordinate::coordinate(const double& xArg, const double& yArg,const double& zArg,const double& tArg) + Coordinate::Coordinate(const coord_t& xArg, const coord_t& yArg,const coord_t& zArg,const coord_t& tArg) : m_x(xArg),m_y(yArg),m_z(zArg),m_t(tArg) { } - coordinate::coordinate(const coordinate & other) + Coordinate::Coordinate(const Coordinate & other) : m_x(other.m_x),m_y(other.m_y),m_z(other.m_z),m_t(other.m_t) { } - coordinate & coordinate::operator= (const coordinate & other) + Coordinate & Coordinate::operator= (const Coordinate & other) { if(this != &other) { @@ -86,19 +86,19 @@ namespace Geometry return *this; } - double coordinate::getX() const + coord_t Coordinate::getX() const { return m_x; } - double coordinate::getY() const + coord_t Coordinate::getY() const { return m_y; } - double coordinate::getZ() const + coord_t Coordinate::getZ() const { return m_z; } - double coordinate::gett() const + coord_t Coordinate::gett() const { return m_t; } diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDCell.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDCell.cpp index 099fea035dcb93c02948a2421abfa672faa6ba31..b540c68361b09995f17885876f7ba1cc7eabea6e 100644 --- a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDCell.cpp +++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDCell.cpp @@ -6,7 +6,7 @@ namespace Mantid namespace Geometry { - MDCell::MDCell(std::vector<boost::shared_ptr<Mantid::Geometry::MDPoint> > pContributingPoints, std::vector<coordinate> vertexes) + MDCell::MDCell(std::vector<boost::shared_ptr<Mantid::Geometry::MDPoint> > pContributingPoints, std::vector<Coordinate> vertexes) : m_cachedSignal(0), m_cachedError(0), m_vertexes(vertexes), @@ -17,7 +17,7 @@ namespace Mantid calculateCachedValues(); } - MDCell::MDCell(const double& signal,const double& error, const std::vector<coordinate>& vertexes) + MDCell::MDCell(const double& signal,const double& error, const std::vector<Coordinate>& vertexes) : m_cachedSignal(signal), m_cachedError(error), m_vertexes(vertexes) @@ -27,16 +27,16 @@ namespace Mantid - std::vector<coordinate> MDCell::getVertexes() const + std::vector<Coordinate> MDCell::getVertexes() const { return this->m_vertexes; } - double MDCell::getSignal() const + signal_t MDCell::getSignal() const { return this->m_cachedSignal; } - double MDCell::getError() const + signal_t MDCell::getError() const { return this->m_cachedError; } diff --git a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDPoint.cpp b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDPoint.cpp index 918fdc30d3cd66d9e0f01e795a7c6b6d8040bc2c..0be14c36a424dd6f3a315471707d08feced0b963 100644 --- a/Code/Mantid/Framework/Geometry/src/MDGeometry/MDPoint.cpp +++ b/Code/Mantid/Framework/Geometry/src/MDGeometry/MDPoint.cpp @@ -4,7 +4,8 @@ namespace Mantid { namespace Geometry { - MDPoint::MDPoint(double signal, double error,const std::vector<coordinate>& vertexes, IDetector_sptr detector, IInstrument_sptr instrument, + MDPoint::MDPoint(signal_t signal, signal_t error, + const std::vector<Coordinate>& vertexes, IDetector_sptr detector, IInstrument_sptr instrument, const int runId) : m_signal(signal), m_error(error), @@ -15,17 +16,17 @@ namespace Mantid { } - std::vector<coordinate> MDPoint::getVertexes() const + std::vector<Coordinate> MDPoint::getVertexes() const { return this->m_vertexes; } - double MDPoint::getSignal() const + signal_t MDPoint::getSignal() const { return this->m_signal; } - double MDPoint::getError() const + signal_t MDPoint::getError() const { return this->m_error; } diff --git a/Code/Mantid/Framework/Geometry/src/Math/Matrix.cpp b/Code/Mantid/Framework/Geometry/src/Math/Matrix.cpp index db5baca16b36d22e9a66a1c90a53c7e956d1c0e9..d8f9ecac0692a874073cf2803507e029ffb32aaf 100644 --- a/Code/Mantid/Framework/Geometry/src/Math/Matrix.cpp +++ b/Code/Mantid/Framework/Geometry/src/Math/Matrix.cpp @@ -1660,9 +1660,11 @@ Matrix<T>::str() const ///\cond TEMPLATE template class DLLExport Matrix<double>; +template class DLLExport Matrix<float>; template class DLLExport Matrix<int>; template DLLExport std::ostream& operator<<(std::ostream&,const Geometry::Matrix<double>&); +template DLLExport std::ostream& operator<<(std::ostream&,const Geometry::Matrix<float>&); template DLLExport std::ostream& operator<<(std::ostream&,const Geometry::Matrix<int>&); ///\endcond TEMPLATE diff --git a/Code/Mantid/Framework/Geometry/src/Math/mathSupport.cpp b/Code/Mantid/Framework/Geometry/src/Math/mathSupport.cpp index f62f172479867f7611fa80296816d5bb33f79955..1c63a4e258c629a27feeb2639683e598cd37cd1a 100644 --- a/Code/Mantid/Framework/Geometry/src/Math/mathSupport.cpp +++ b/Code/Mantid/Framework/Geometry/src/Math/mathSupport.cpp @@ -208,6 +208,7 @@ template template DLLExport void indexSort(const std::vector<double>&,std::vector<int>&); +template DLLExport void indexSort(const std::vector<float>&,std::vector<int>&); template DLLExport void indexSort(const std::vector<int>&,std::vector<int>&); diff --git a/Code/Mantid/Framework/Geometry/test/CoordinateTest.h b/Code/Mantid/Framework/Geometry/test/CoordinateTest.h index 5a190a2b1b7277c79d0966df1ad3ba934d7502fb..257ae62c8fff99277652ded9908602d21bc2252a 100644 --- a/Code/Mantid/Framework/Geometry/test/CoordinateTest.h +++ b/Code/Mantid/Framework/Geometry/test/CoordinateTest.h @@ -1,16 +1,15 @@ -#ifndef MANTID_GEOMETRY_COORDINATETEST_H_ -#define MANTID_GEOMETRY_COORDINATETEST_H_ +#ifndef MANTID_GEOMETRY_CoordinateTEST_H_ +#define MANTID_GEOMETRY_CoordinateTEST_H_ -#include <cxxtest/TestSuite.h> -#include "MantidKernel/Timer.h" +#include "MantidGeometry/MDGeometry/Coordinate.h" #include "MantidKernel/System.h" -#include <iostream> +#include "MantidKernel/Timer.h" +#include <cxxtest/TestSuite.h> #include <iomanip> - -#include "MantidGeometry/MDGeometry/Coordinate.h" +#include <iostream> using namespace Mantid::Geometry; -using namespace Mantid::MDEvents; +using namespace Mantid; class CoordinateTest : public CxxTest::TestSuite { @@ -18,7 +17,7 @@ public: void test_constructor1() { - coordinate c = coordinate::createCoordinate1D(1); + Coordinate c = Coordinate::createCoordinate1D(1); TS_ASSERT_EQUALS( c.getX(), 1); TS_ASSERT_EQUALS( c.getY(), 0); TS_ASSERT_EQUALS( c.getZ(), 0); @@ -27,7 +26,7 @@ public: void test_constructor2() { - coordinate c = coordinate::createCoordinate2D(1,2); + Coordinate c = Coordinate::createCoordinate2D(1,2); TS_ASSERT_EQUALS( c.getX(), 1); TS_ASSERT_EQUALS( c.getY(), 2); TS_ASSERT_EQUALS( c.getZ(), 0); @@ -36,7 +35,7 @@ public: void test_constructor3() { - coordinate c = coordinate::createCoordinate3D(1,2,3); + Coordinate c = Coordinate::createCoordinate3D(1,2,3); TS_ASSERT_EQUALS( c.getX(), 1); TS_ASSERT_EQUALS( c.getY(), 2); TS_ASSERT_EQUALS( c.getZ(), 3); @@ -45,7 +44,7 @@ public: void test_constructor4() { - coordinate c = coordinate::createCoordinate4D(1,2,3,4); + Coordinate c = Coordinate::createCoordinate4D(1,2,3,4); TS_ASSERT_EQUALS( c.getX(), 1); TS_ASSERT_EQUALS( c.getY(), 2); TS_ASSERT_EQUALS( c.getZ(), 3); @@ -54,8 +53,8 @@ public: void test_copy_constructor() { - coordinate c0 = coordinate::createCoordinate4D(1,2,3,4); - coordinate c(c0); + Coordinate c0 = Coordinate::createCoordinate4D(1,2,3,4); + Coordinate c(c0); TS_ASSERT_EQUALS( c.getX(), 1); TS_ASSERT_EQUALS( c.getY(), 2); TS_ASSERT_EQUALS( c.getZ(), 3); @@ -65,7 +64,7 @@ public: void test_constructFromArray4() { coord_t coords[4] = {1,2,3,4}; - coordinate c(coords, 4); + Coordinate c(coords, 4); TS_ASSERT_EQUALS( c.getX(), 1); TS_ASSERT_EQUALS( c.getY(), 2); TS_ASSERT_EQUALS( c.getZ(), 3); @@ -75,7 +74,7 @@ public: void test_constructFromArray1() { coord_t coords[1] = {1}; - coordinate c(coords, 1); + Coordinate c(coords, 1); TS_ASSERT_EQUALS( c.getX(), 1); TS_ASSERT_EQUALS( c.getY(), 0); TS_ASSERT_EQUALS( c.getZ(), 0); @@ -85,5 +84,5 @@ public: }; -#endif /* MANTID_GEOMETRY_COORDINATETEST_H_ */ +#endif /* MANTID_GEOMETRY_CoordinateTEST_H_ */ diff --git a/Code/Mantid/Framework/Geometry/test/MDCellTest.h b/Code/Mantid/Framework/Geometry/test/MDCellTest.h index 20e113988476cc9d7045ca6f9b49ce7f49b97ee8..38970523a03780b9752e871db4b34b4b69a3a2e3 100644 --- a/Code/Mantid/Framework/Geometry/test/MDCellTest.h +++ b/Code/Mantid/Framework/Geometry/test/MDCellTest.h @@ -5,6 +5,9 @@ #include "MantidGeometry/MDGeometry/MDPoint.h" #include "MantidGeometry/MDGeometry/MDCell.h" #include <boost/scoped_ptr.hpp> +#include "MantidKernel/System.h" + +using namespace Mantid; class MDCellTest : public CxxTest::TestSuite { @@ -15,12 +18,12 @@ private: { public: - double getSignal() const + signal_t getSignal() const { return 1; } - double getError() const + signal_t getError() const { return 0.1; } @@ -30,8 +33,8 @@ private: static Mantid::Geometry::MDCell* constructMDCell() { using namespace Mantid::Geometry; - std::vector<coordinate> vertexes; - coordinate c = coordinate::createCoordinate4D(4, 3, 2, 1); + std::vector<Coordinate> vertexes; + Coordinate c = Coordinate::createCoordinate4D(4, 3, 2, 1); vertexes.push_back(c); std::vector<boost::shared_ptr<MDPoint> > points; @@ -72,9 +75,9 @@ public: // { // using namespace Mantid::Geometry; // boost::scoped_ptr<MDCell> cell(constructMDCell()); -// std::vector<coordinate> vertexes = cell->getVertexes(); +// std::vector<Coordinate> vertexes = cell->getVertexes(); // TSM_ASSERT_EQUALS("A single vertex should be present.", 1, vertexes.size()); -// coordinate v1 = vertexes.at(0); +// Coordinate v1 = vertexes.at(0); // TSM_ASSERT_EQUALS("Vertex x value incorrect", 4, v1.getX()); // TSM_ASSERT_EQUALS("Vertex y value incorrect", 3, v1.getY()); // TSM_ASSERT_EQUALS("Vertex z value incorrect", 2, v1.getZ()); diff --git a/Code/Mantid/Framework/Geometry/test/MDPointTest.h b/Code/Mantid/Framework/Geometry/test/MDPointTest.h index 877dc934e852e8b566cca1ecc67c6b887af34dc1..57a0345a3ce0cfc806118b0caba356ab1b2c0c49 100644 --- a/Code/Mantid/Framework/Geometry/test/MDPointTest.h +++ b/Code/Mantid/Framework/Geometry/test/MDPointTest.h @@ -34,8 +34,8 @@ private: static Mantid::Geometry::MDPoint* constructMDPoint() { using namespace Mantid::Geometry; - std::vector<coordinate> vertexes; - coordinate c = coordinate::createCoordinate4D(1, 2, 3, 4); + std::vector<Coordinate> vertexes; + Coordinate c = Coordinate::createCoordinate4D(1, 2, 3, 4); vertexes.push_back(c); IDetector_sptr detector = IDetector_sptr(new DummyDetector("dummydetector")); IInstrument_sptr instrument = IInstrument_sptr(new DummyInstrument("dummyinstrument")); @@ -83,9 +83,9 @@ public: // { // using namespace Mantid::Geometry; // boost::scoped_ptr<MDPoint> point(constructMDPoint()); -// std::vector<coordinate> vertexes = point->getVertexes(); +// std::vector<Coordinate> vertexes = point->getVertexes(); // TSM_ASSERT_EQUALS("A single vertex should be present.", 1, vertexes.size()); -// coordinate v1 = vertexes.at(0); +// Coordinate v1 = vertexes.at(0); // TSM_ASSERT_EQUALS("Vertex x value incorrect", 1, v1.getX()); // TSM_ASSERT_EQUALS("Vertex y value incorrect", 2, v1.getY()); // TSM_ASSERT_EQUALS("Vertex z value incorrect", 3, v1.getZ()); diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/System.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/System.h index e6a007fe9c9308a1cc9466fdd474e0e7fd741ca7..f4e1a6613a087c0052dd831973858d72e98124f0 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/System.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/System.h @@ -102,30 +102,29 @@ typedef unsigned long uint64_t; namespace Mantid { - namespace MDEvents - { - /** Typedef for the data type to use for coordinate axes. - * This could be a float or a double, depending on requirements. - * We can change this in order to compare - * performance/memory/accuracy requirements. - */ - typedef double coord_t; - - /// Minimum value (large negative number) that a coordinate can take - static const coord_t coord_t_min = -std::numeric_limits<double>::max(); - - /// Maximum value (large positive number) that a coordinate can take - static const coord_t coord_t_max = std::numeric_limits<double>::max(); - - /** Typedef for the data type to use for the signal and error - * integrated in a MDBin or MDBox. - * - * This could be a float or a double, depending on requirements/platform. - * We can change this in order to compare performance/memory/accuracy requirements. - */ - typedef double signal_t; - } + /** Typedef for the data type to use for coordinate axes in MD objects such + * as MDBox, MDEventWorkspace, etc. + * + * This could be a float or a double, depending on requirements. + * We can change this in order to compare + * performance/memory/accuracy requirements. + */ + typedef double coord_t; + + /// Minimum value (large negative number) that a coordinate can take + static const coord_t coord_t_min = -std::numeric_limits<coord_t>::max(); + + /// Maximum value (large positive number) that a coordinate can take + static const coord_t coord_t_max = std::numeric_limits<coord_t>::max(); + + /** Typedef for the data type to use for the signal and error + * integrated in MDWorkspaces, MDBoxes, MDEventWorkspace etc. + * + * This could be a float or a double, depending on requirements/platform. + * We can change this in order to compare performance/memory/accuracy requirements. + */ + typedef double signal_t; } diff --git a/Code/Mantid/Framework/MDAlgorithms/src/CreateMDFitWorkspace.cpp b/Code/Mantid/Framework/MDAlgorithms/src/CreateMDFitWorkspace.cpp index a531740585a4a9728325326b14f05ee1051a3337..29eb7cb0abd3eec2335ab4dd188c528e01429a6f 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/CreateMDFitWorkspace.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/CreateMDFitWorkspace.cpp @@ -89,10 +89,10 @@ namespace Mantid for(int i = 1; i < n; ++i) { double s = double(rand()) / RAND_MAX * signal * 0.75; - points[i].reset(new MDPoint(s,error,std::vector<coordinate>(),IDetector_sptr(),IInstrument_sptr())); + points[i].reset(new MDPoint(s,error,std::vector<Coordinate>(),IDetector_sptr(),IInstrument_sptr())); signal -= s; } - points[0].reset(new MDPoint(signal,error,std::vector<coordinate>(),IDetector_sptr(),IInstrument_sptr())); + points[0].reset(new MDPoint(signal,error,std::vector<Coordinate>(),IDetector_sptr(),IInstrument_sptr())); size_t i = it->getPointer(); ws->setCell(i,points); } diff --git a/Code/Mantid/Framework/MDAlgorithms/src/QuadEnBackground.cpp b/Code/Mantid/Framework/MDAlgorithms/src/QuadEnBackground.cpp index ba6e9ca61d278500ba108a90bf3c7c199cd29065..5f58a82617f470aded5fea32189f409574afc341 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/QuadEnBackground.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/QuadEnBackground.cpp @@ -38,7 +38,7 @@ namespace Mantid // assume that the first point in the vertexes array is the centre point anf that the gett getter // returns a energy value in the appropriate units. for(size_t i=0; i<points.size();i++){ - std::vector<Mantid::Geometry::coordinate> vertexes = points[i]->getVertexes(); + std::vector<Mantid::Geometry::Coordinate> vertexes = points[i]->getVertexes(); eps=vertexes[0].gett(); //int run=points[i]->getRunId(); // testing bgSignal+=constant+eps*(linear+eps*quadratic); diff --git a/Code/Mantid/Framework/MDAlgorithms/src/SimulateMDD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/SimulateMDD.cpp index ece7c0b269fcc2303fb097770157f5212733042f..01af4da843a9f904df3ca2e72d2a0389d4c3de6a 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/SimulateMDD.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/SimulateMDD.cpp @@ -111,14 +111,14 @@ namespace Mantid if( ! bgmodel.compare("QuadEnTrans")) { for(size_t j=0; j<myPoints.size(); j++){ // TO DO: this is expensive way to get eps, should use pointer - std::vector<Mantid::Geometry::coordinate> vertexes = myPoints[j]->getVertexes(); + std::vector<Mantid::Geometry::Coordinate> vertexes = myPoints[j]->getVertexes(); eps=vertexes[0].gett(); bgsum+=bgparaP1+eps*(bgparaP2+eps*bgparaP3); } } else if( ! bgmodel.compare("ExpEnTrans")) { for(size_t j=0; j<myPoints.size(); j++){ - std::vector<Mantid::Geometry::coordinate> vertexes = myPoints[j]->getVertexes(); + std::vector<Mantid::Geometry::Coordinate> vertexes = myPoints[j]->getVertexes(); eps=vertexes[0].gett(); bgsum+=bgparaP1+bgparaP2*exp(-eps/bgparaP3); } @@ -126,7 +126,7 @@ namespace Mantid else if( ! bgmodel.compare("QuadEnTransAndPhi")) { double dphi,deps; for(size_t j=0; j<myPoints.size(); j++){ - std::vector<Mantid::Geometry::coordinate> vertexes = myPoints[j]->getVertexes(); + std::vector<Mantid::Geometry::Coordinate> vertexes = myPoints[j]->getVertexes(); eps=vertexes[0].gett(); deps=eps-bgparaP1; phi=0.; // TO DO: get phi of detector @@ -136,7 +136,7 @@ namespace Mantid } else if( ! bgmodel.compare("ExpEnTransAndPhi")) { for(size_t j=0; j<myPoints.size(); j++){ - std::vector<Mantid::Geometry::coordinate> vertexes = myPoints[j]->getVertexes(); + std::vector<Mantid::Geometry::Coordinate> vertexes = myPoints[j]->getVertexes(); eps=vertexes[0].gett(); phi=0.; // TO DO: get phi of detector bgsum+=bgparaP3*exp(-(eps-bgparaP1)/bgparaP4 - (phi-bgparaP2)/bgparaP5 ); diff --git a/Code/Mantid/Framework/MDAlgorithms/src/SimulateResolution.cpp b/Code/Mantid/Framework/MDAlgorithms/src/SimulateResolution.cpp index 924ca331a1869cbe45a52eb4e0632d4cd50d2ea9..dd355cd5e917936667e6c74ff87e020b2fb3a33f 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/SimulateResolution.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/SimulateResolution.cpp @@ -64,7 +64,7 @@ namespace Mantid double answer=0.,error=0.; // loop over each MDPoint in current MDCell for(size_t j=0; j<cellPoints.size(); j++){ - std::vector<Mantid::Geometry::coordinate> vertexes = cellPoints[j]->getVertexes(); + std::vector<Mantid::Geometry::Coordinate> vertexes = cellPoints[j]->getVertexes(); double eps=vertexes[0].gett(); sqwConvolution(cellPoints[j],answer,error); } diff --git a/Code/Mantid/Framework/MDAlgorithms/src/TobyFitSimulate.cpp b/Code/Mantid/Framework/MDAlgorithms/src/TobyFitSimulate.cpp index 51469ef9bd80cb9c7ab843e06d8beeb5ccf8f50b..a84b7bd420fb322547c8cf0e77e567ba97b4b93f 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/TobyFitSimulate.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/TobyFitSimulate.cpp @@ -55,7 +55,7 @@ namespace Mantid double answer=0.,error=0.; // loop over each MDPoint in current MDCell for(size_t j=0; j<cellPoints.size(); j++){ - std::vector<Mantid::Geometry::coordinate> vertexes = cellPoints[j]->getVertexes(); + std::vector<Mantid::Geometry::Coordinate> vertexes = cellPoints[j]->getVertexes(); //double eps=vertexes[0].gett(); sqwConvolution(cellPoints[j],answer,error); } diff --git a/Code/Mantid/Framework/MDAlgorithms/test/CobaltSWDTest.h b/Code/Mantid/Framework/MDAlgorithms/test/CobaltSWDTest.h index 4cc3395c3fae539835b6265c6ff068d9bb1fb5a6..3e8c349d937eff67af00a5a72e89d9ba6cb4a3c0 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/CobaltSWDTest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/CobaltSWDTest.h @@ -244,31 +244,31 @@ private: static Mantid::Geometry::MDCell constructMDCell(int npnts) { using namespace Mantid::Geometry; - std::vector<coordinate> vertices; + std::vector<Coordinate> vertices; std::vector<boost::shared_ptr<MDPoint> > points; - coordinate c; + Coordinate c; if(npnts==1) { points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(16,4,1,2,3,0)) ); - c = coordinate::createCoordinate4D(1, 2, 3, 0); + c = Coordinate::createCoordinate4D(1, 2, 3, 0); } else if(npnts==2) { points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(25,5,1,2,3,1)) ); points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(36,6,1,2,3,2)) ); - c = coordinate::createCoordinate4D(1, 2, 3, 1.5); + c = Coordinate::createCoordinate4D(1, 2, 3, 1.5); } else if(npnts==3) { points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(49,7,1,2,3,3)) ); points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(49,7,1,2,3,4)) ); points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(64,8,1,2,3,5)) ); - c = coordinate::createCoordinate4D(1, 2, 3, 4); + c = Coordinate::createCoordinate4D(1, 2, 3, 4); } else if(npnts==4) { points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(81,9,1,2,3,6)) ); points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(81,9,1,2,3,6.5)) ); points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(100,10,1,2,3,7)) ); points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(100,10,1,2,3,7.5)) ); - c = coordinate::createCoordinate4D(1, 2, 3, 6); + c = Coordinate::createCoordinate4D(1, 2, 3, 6); } vertices.push_back(c); @@ -295,8 +295,8 @@ private: static Mantid::Geometry::MDPoint* constructMDPoint(double s, double e, double x, double y, double z, double t) { using namespace Mantid::Geometry; - std::vector<coordinate> vertices; - coordinate c = coordinate::createCoordinate4D(x, y, z, t); + std::vector<Coordinate> vertices; + Coordinate c = Coordinate::createCoordinate4D(x, y, z, t); vertices.push_back(c); IDetector_sptr detector = IDetector_sptr(new DummyDetector("dummydetector")); IInstrument_sptr instrument = IInstrument_sptr(new DummyInstrument("dummyinstrument")); @@ -326,7 +326,7 @@ public: TS_ASSERT_EQUALS(myCut->getXDimension()->getNBins(),4); std::vector<boost::shared_ptr<Mantid::Geometry::MDPoint> > contributingPoints; - std::vector<Mantid::Geometry::coordinate> vertices; + std::vector<Mantid::Geometry::Coordinate> vertices; // test that cells and points are as expected int firstCell = 0; diff --git a/Code/Mantid/Framework/MDAlgorithms/test/QuadEnBackgroundTest.h b/Code/Mantid/Framework/MDAlgorithms/test/QuadEnBackgroundTest.h index 7e65ad6c06da0948db0d6c19798f470bd0cfa43f..e2162717f1f1d515cb5e46e069557dcd4f236bc4 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/QuadEnBackgroundTest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/QuadEnBackgroundTest.h @@ -242,31 +242,31 @@ private: static Mantid::Geometry::MDCell constructMDCell(int npnts) { using namespace Mantid::Geometry; - std::vector<coordinate> vertices; + std::vector<Coordinate> vertices; std::vector<boost::shared_ptr<MDPoint> > points; - coordinate c; + Coordinate c; if(npnts==1) { points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(16,4,1,2,3,0)) ); - c = coordinate::createCoordinate4D(1, 2, 3, 0); + c = Coordinate::createCoordinate4D(1, 2, 3, 0); } else if(npnts==2) { points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(25,5,1,2,3,1)) ); points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(36,6,1,2,3,2)) ); - c = coordinate::createCoordinate4D(1, 2, 3, 1.5); + c = Coordinate::createCoordinate4D(1, 2, 3, 1.5); } else if(npnts==3) { points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(49,7,1,2,3,3)) ); points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(49,7,1,2,3,4)) ); points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(64,8,1,2,3,5)) ); - c = coordinate::createCoordinate4D(1, 2, 3, 4); + c = Coordinate::createCoordinate4D(1, 2, 3, 4); } else if(npnts==4) { points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(81,9,1,2,3,6)) ); points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(81,9,1,2,3,6.5)) ); points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(100,10,1,2,3,7)) ); points.push_back(boost::shared_ptr<MDPoint>( constructMDPoint(100,10,1,2,3,7.5)) ); - c = coordinate::createCoordinate4D(1, 2, 3, 6); + c = Coordinate::createCoordinate4D(1, 2, 3, 6); } vertices.push_back(c); @@ -293,8 +293,8 @@ private: static Mantid::Geometry::MDPoint* constructMDPoint(double s, double e, double x, double y, double z, double t) { using namespace Mantid::Geometry; - std::vector<coordinate> vertices; - coordinate c = coordinate::createCoordinate4D(x, y, z, t); + std::vector<Coordinate> vertices; + Coordinate c = Coordinate::createCoordinate4D(x, y, z, t); vertices.push_back(c); IDetector_sptr detector = IDetector_sptr(new DummyDetector("dummydetector")); IInstrument_sptr instrument = IInstrument_sptr(new DummyInstrument("dummyinstrument")); @@ -324,7 +324,7 @@ public: TS_ASSERT_EQUALS(myCut->getXDimension()->getNBins(),4); std::vector<boost::shared_ptr<Mantid::Geometry::MDPoint> > contributingPoints; - std::vector<Mantid::Geometry::coordinate> vertices; + std::vector<Mantid::Geometry::Coordinate> vertices; // test that cells and points are as expected int firstCell = 0; diff --git a/Code/Mantid/Framework/MDAlgorithms/test/SimulateMDDataTest.h b/Code/Mantid/Framework/MDAlgorithms/test/SimulateMDDataTest.h index 056eba5fae7438d1c3b4bbd8c226ba93b6d7ce2b..c098c724ce224fa31e97d0d015deef0baa5ccaaf 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/SimulateMDDataTest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/SimulateMDDataTest.h @@ -176,8 +176,8 @@ private: static Mantid::Geometry::MDCell constructMDCell(int npnts) { using namespace Mantid::Geometry; - std::vector<coordinate> vertices; - coordinate c = coordinate::createCoordinate4D(4, 3, 2, 1); + std::vector<Coordinate> vertices; + Coordinate c = Coordinate::createCoordinate4D(4, 3, 2, 1); vertices.push_back(c); std::vector<boost::shared_ptr<MDPoint> > points; @@ -212,8 +212,8 @@ private: static Mantid::Geometry::MDPoint* constructMDPoint(double s, double e, double x, double y, double z, double t) { using namespace Mantid::Geometry; - std::vector<coordinate> vertices; - coordinate c = coordinate::createCoordinate4D(x, y, z, t); + std::vector<Coordinate> vertices; + Coordinate c = Coordinate::createCoordinate4D(x, y, z, t); vertices.push_back(c); IDetector_sptr detector = IDetector_sptr(new DummyDetector("dummydetector")); IInstrument_sptr instrument = IInstrument_sptr(new DummyInstrument("dummyinstrument")); @@ -242,7 +242,7 @@ public: TS_ASSERT_EQUALS(myCut->getXDimension()->getNBins(),2); std::vector<boost::shared_ptr<Mantid::Geometry::MDPoint> > contributingPoints; - std::vector<Mantid::Geometry::coordinate> vertices; + std::vector<Mantid::Geometry::Coordinate> vertices; // test that cells and points are as expected int firstCell = 0; diff --git a/Code/Mantid/Framework/MDAlgorithms/test/TobyFitSimulateTest.h b/Code/Mantid/Framework/MDAlgorithms/test/TobyFitSimulateTest.h index 118f6e17f8d9ed3103cb783da5fdff3f370cb887..dd2fe5522467be9628fe34e4f9d4d06718131e41 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/TobyFitSimulateTest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/TobyFitSimulateTest.h @@ -175,8 +175,8 @@ private: static Mantid::Geometry::MDCell constructMDCell(int npnts) { using namespace Mantid::Geometry; - std::vector<coordinate> vertices; - coordinate c = coordinate::createCoordinate4D(4, 3, 2, 1); + std::vector<Coordinate> vertices; + Coordinate c = Coordinate::createCoordinate4D(4, 3, 2, 1); vertices.push_back(c); std::vector<boost::shared_ptr<MDPoint> > points; @@ -211,8 +211,8 @@ private: static Mantid::Geometry::MDPoint* constructMDPoint(double s, double e, double x, double y, double z, double t) { using namespace Mantid::Geometry; - std::vector<coordinate> vertices; - coordinate c = coordinate::createCoordinate4D(x, y, z, t); + std::vector<Coordinate> vertices; + Coordinate c = Coordinate::createCoordinate4D(x, y, z, t); vertices.push_back(c); IDetector_sptr detector = IDetector_sptr(new DummyDetector("dummydetector")); IInstrument_sptr instrument = IInstrument_sptr(new DummyInstrument("dummyinstrument")); @@ -241,7 +241,7 @@ public: TS_ASSERT_EQUALS(myCut->getXDimension()->getNBins(),2); std::vector<boost::shared_ptr<Mantid::Geometry::MDPoint> > contributingPoints; - std::vector<Mantid::Geometry::coordinate> vertices; + std::vector<Mantid::Geometry::Coordinate> vertices; // test that cells and points are as expected int firstCell = 0; diff --git a/Code/Mantid/Framework/MDDataObjects/inc/MDDataObjects/MDWorkspace.h b/Code/Mantid/Framework/MDDataObjects/inc/MDDataObjects/MDWorkspace.h index 7d1c67bef8e153ef16227fcf9890d4446529d1b2..6ae3f153aa04adf7b307c0eada1c0e5b01b0466b 100644 --- a/Code/Mantid/Framework/MDDataObjects/inc/MDDataObjects/MDWorkspace.h +++ b/Code/Mantid/Framework/MDDataObjects/inc/MDDataObjects/MDWorkspace.h @@ -183,16 +183,16 @@ namespace Mantid Mantid::Geometry::VecIMDDimension_const_sptr getNonIntegratedDimensions() const; /// Getter for normalized signal 4D. - double getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const; + signal_t getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const; /// Getter for normalized signal 3D. - double getSignalNormalizedAt(size_t index1, size_t index2, size_t index3) const; + signal_t getSignalNormalizedAt(size_t index1, size_t index2, size_t index3) const; /// Getter for normalized signal 2D. - double getSignalNormalizedAt(size_t index1, size_t index2) const; + signal_t getSignalNormalizedAt(size_t index1, size_t index2) const; /// Getter for normalized signal 1D. - double getSignalNormalizedAt(size_t index1) const; + signal_t getSignalNormalizedAt(size_t index1) const; protected: diff --git a/Code/Mantid/Framework/MDDataObjects/src/MDFitWorkspace.cpp b/Code/Mantid/Framework/MDDataObjects/src/MDFitWorkspace.cpp index 680aeea83542069b43e782b49f704182583231ae..b9abc2a1a1b21447523d561b16f1fb3814bc81a7 100644 --- a/Code/Mantid/Framework/MDDataObjects/src/MDFitWorkspace.cpp +++ b/Code/Mantid/Framework/MDDataObjects/src/MDFitWorkspace.cpp @@ -471,7 +471,7 @@ namespace Mantid{ std::out_of_range("Cell index is out of range"); } MDCell& cell = m_cells[index]; - cell = MDCell(points,std::vector<coordinate>()); + cell = MDCell(points,std::vector<Coordinate>()); } diff --git a/Code/Mantid/Framework/MDDataObjects/src/MDWorkspace.cpp b/Code/Mantid/Framework/MDDataObjects/src/MDWorkspace.cpp index 855ac4fffac9da20e282b2064dd2f8ba568d84e5..039610d0c0f04dddbc0ada840481ad72386ba96d 100644 --- a/Code/Mantid/Framework/MDDataObjects/src/MDWorkspace.cpp +++ b/Code/Mantid/Framework/MDDataObjects/src/MDWorkspace.cpp @@ -194,7 +194,7 @@ MDWorkspace::MDWorkspace(unsigned int nDimensions, unsigned int nRecDims) double signal = *(MDDataPoint+base+signal_shift); double error= *(MDDataPoint+base+signal_shift+1); - std::vector<coordinate> vertexes; + std::vector<Coordinate> vertexes; IDetector_sptr detector; //TODO determine detector. @@ -328,7 +328,7 @@ MDWorkspace::MDWorkspace(unsigned int nDimensions, unsigned int nRecDims) @parameter index1 : 3rd dimension index. @parameter index1 : 4th dimension index. */ - double MDWorkspace::getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const + signal_t MDWorkspace::getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const { return this->getSignalAt(index1, index2, index3, index4); } @@ -339,7 +339,7 @@ MDWorkspace::MDWorkspace(unsigned int nDimensions, unsigned int nRecDims) @parameter index1 : 2nd dimension index. @parameter index1 : 3rd dimension index. */ - double MDWorkspace::getSignalNormalizedAt(size_t index1, size_t index2, size_t index3) const + signal_t MDWorkspace::getSignalNormalizedAt(size_t index1, size_t index2, size_t index3) const { return this->getSignalAt(index1, index2, index3); } @@ -349,7 +349,7 @@ MDWorkspace::MDWorkspace(unsigned int nDimensions, unsigned int nRecDims) @parameter index1 : 1st dimension index. @parameter index1 : 2nd dimension index. */ - double MDWorkspace::getSignalNormalizedAt(size_t index1, size_t index2) const + signal_t MDWorkspace::getSignalNormalizedAt(size_t index1, size_t index2) const { return this->getSignalAt(index1, index2); } @@ -358,7 +358,7 @@ MDWorkspace::MDWorkspace(unsigned int nDimensions, unsigned int nRecDims) Getter for signal normalized by volume. @parameter index1 : 1st dimension index. */ - double MDWorkspace::getSignalNormalizedAt(size_t index1) const + signal_t MDWorkspace::getSignalNormalizedAt(size_t index1) const { return this->getSignalAt(index1); } @@ -441,22 +441,22 @@ MDWorkspace::MDWorkspace(unsigned int nDimensions, unsigned int nRecDims) double delta_t = (tDimension->getMaximum() - tDimension->getMinimum()) / double(tDimension->getNBins()); //Make two Hexahedrons at each time interval. VecCoordinate vertexes(16); - vertexes[0] = coordinate::createCoordinate4D(dim1Increment * delta_x, dim2Increment * delta_y, dim3Increment * delta_z,dim4Increment); - vertexes[1] = coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, dim2Increment * delta_y, dim3Increment* delta_z, dim4Increment); - vertexes[2] = coordinate::createCoordinate4D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y, dim3Increment* delta_z, dim4Increment); - vertexes[3] = coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y, dim3Increment* delta_z, dim4Increment); - vertexes[4] = coordinate::createCoordinate4D(dim1Increment * delta_x, dim2Increment * delta_y, (dim3Increment + 1)* delta_z, dim4Increment); - vertexes[5] = coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, dim2Increment * delta_y, (dim3Increment + 1)* delta_z, dim4Increment); - vertexes[6] = coordinate::createCoordinate4D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y, (dim3Increment + 1)* delta_z, dim4Increment); - vertexes[7] = coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y, (dim3Increment+ 1) * delta_z, dim4Increment); - vertexes[8] = coordinate::createCoordinate4D(dim1Increment * delta_x, dim2Increment * delta_y, dim3Increment * delta_z,delta_t + dim4Increment); - vertexes[9] = coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, dim2Increment * delta_y, dim3Increment* delta_z, delta_t + dim4Increment); - vertexes[10] = coordinate::createCoordinate4D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y, dim3Increment* delta_z, delta_t + dim4Increment); - vertexes[11] = coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y, dim3Increment* delta_z, delta_t + dim4Increment); - vertexes[12] = coordinate::createCoordinate4D(dim1Increment * delta_x, dim2Increment * delta_y, (dim3Increment + 1)* delta_z, delta_t + dim4Increment); - vertexes[13] = coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, dim2Increment * delta_y, (dim3Increment + 1)* delta_z, delta_t + dim4Increment); - vertexes[14] = coordinate::createCoordinate4D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y, (dim3Increment + 1)* delta_z, delta_t + dim4Increment); - vertexes[15] = coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y, (dim3Increment+ 1) * delta_z, delta_t + dim4Increment); + vertexes[0] = Coordinate::createCoordinate4D(dim1Increment * delta_x, dim2Increment * delta_y, dim3Increment * delta_z,dim4Increment); + vertexes[1] = Coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, dim2Increment * delta_y, dim3Increment* delta_z, dim4Increment); + vertexes[2] = Coordinate::createCoordinate4D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y, dim3Increment* delta_z, dim4Increment); + vertexes[3] = Coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y, dim3Increment* delta_z, dim4Increment); + vertexes[4] = Coordinate::createCoordinate4D(dim1Increment * delta_x, dim2Increment * delta_y, (dim3Increment + 1)* delta_z, dim4Increment); + vertexes[5] = Coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, dim2Increment * delta_y, (dim3Increment + 1)* delta_z, dim4Increment); + vertexes[6] = Coordinate::createCoordinate4D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y, (dim3Increment + 1)* delta_z, dim4Increment); + vertexes[7] = Coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y, (dim3Increment+ 1) * delta_z, dim4Increment); + vertexes[8] = Coordinate::createCoordinate4D(dim1Increment * delta_x, dim2Increment * delta_y, dim3Increment * delta_z,delta_t + dim4Increment); + vertexes[9] = Coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, dim2Increment * delta_y, dim3Increment* delta_z, delta_t + dim4Increment); + vertexes[10] = Coordinate::createCoordinate4D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y, dim3Increment* delta_z, delta_t + dim4Increment); + vertexes[11] = Coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y, dim3Increment* delta_z, delta_t + dim4Increment); + vertexes[12] = Coordinate::createCoordinate4D(dim1Increment * delta_x, dim2Increment * delta_y, (dim3Increment + 1)* delta_z, delta_t + dim4Increment); + vertexes[13] = Coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, dim2Increment * delta_y, (dim3Increment + 1)* delta_z, delta_t + dim4Increment); + vertexes[14] = Coordinate::createCoordinate4D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y, (dim3Increment + 1)* delta_z, delta_t + dim4Increment); + vertexes[15] = Coordinate::createCoordinate4D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y, (dim3Increment+ 1) * delta_z, delta_t + dim4Increment); return vertexes; } @@ -473,14 +473,14 @@ VecCoordinate createPolyhedron( double delta_z = (zDimension->getMaximum() - zDimension->getMinimum()) /double( zDimension->getNBins()); //Make a Hexahedron VecCoordinate vertexes(8); - vertexes[0] = coordinate::createCoordinate3D(dim1Increment * delta_x, dim2Increment * delta_y, dim3Increment * delta_z); - vertexes[1] = coordinate::createCoordinate3D((dim1Increment + 1) * delta_x, dim2Increment * delta_y, dim3Increment* delta_z); - vertexes[2] = coordinate::createCoordinate3D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y, dim3Increment* delta_z); - vertexes[3] = coordinate::createCoordinate3D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y, dim3Increment* delta_z); - vertexes[4] = coordinate::createCoordinate3D(dim1Increment * delta_x, dim2Increment * delta_y, (dim3Increment + 1)* delta_z); - vertexes[5] = coordinate::createCoordinate3D((dim1Increment + 1) * delta_x, dim2Increment * delta_y, (dim3Increment + 1)* delta_z); - vertexes[6] = coordinate::createCoordinate3D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y, (dim3Increment + 1)* delta_z); - vertexes[7] = coordinate::createCoordinate3D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y, (dim3Increment+ 1) * delta_z); + vertexes[0] = Coordinate::createCoordinate3D(dim1Increment * delta_x, dim2Increment * delta_y, dim3Increment * delta_z); + vertexes[1] = Coordinate::createCoordinate3D((dim1Increment + 1) * delta_x, dim2Increment * delta_y, dim3Increment* delta_z); + vertexes[2] = Coordinate::createCoordinate3D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y, dim3Increment* delta_z); + vertexes[3] = Coordinate::createCoordinate3D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y, dim3Increment* delta_z); + vertexes[4] = Coordinate::createCoordinate3D(dim1Increment * delta_x, dim2Increment * delta_y, (dim3Increment + 1)* delta_z); + vertexes[5] = Coordinate::createCoordinate3D((dim1Increment + 1) * delta_x, dim2Increment * delta_y, (dim3Increment + 1)* delta_z); + vertexes[6] = Coordinate::createCoordinate3D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y, (dim3Increment + 1)* delta_z); + vertexes[7] = Coordinate::createCoordinate3D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y, (dim3Increment+ 1) * delta_z); return vertexes; } @@ -494,10 +494,10 @@ VecCoordinate createPolygon( double delta_y = (yDimension->getMaximum() - yDimension->getMinimum()) /double( yDimension->getNBins()); //Make a square VecCoordinate vertexes(4); - vertexes[0] = coordinate::createCoordinate2D(dim1Increment * delta_x, dim2Increment * delta_y); - vertexes[1] = coordinate::createCoordinate2D((dim1Increment + 1) * delta_x, dim2Increment * delta_y); - vertexes[2] = coordinate::createCoordinate2D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y); - vertexes[3] = coordinate::createCoordinate2D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y); + vertexes[0] = Coordinate::createCoordinate2D(dim1Increment * delta_x, dim2Increment * delta_y); + vertexes[1] = Coordinate::createCoordinate2D((dim1Increment + 1) * delta_x, dim2Increment * delta_y); + vertexes[2] = Coordinate::createCoordinate2D(dim1Increment * delta_x, (dim2Increment + 1) * delta_y); + vertexes[3] = Coordinate::createCoordinate2D((dim1Increment + 1) * delta_x, (dim2Increment + 1) * delta_y); return vertexes; } @@ -508,8 +508,8 @@ VecCoordinate createLine( double delta_x = (xDimension->getMaximum() - xDimension->getMinimum()) / double(xDimension->getNBins()); VecCoordinate vertexes(2); //Make a line - vertexes[0] = coordinate::createCoordinate1D(dim1Increment * delta_x); - vertexes[1] = coordinate::createCoordinate1D((dim1Increment + 1) * delta_x); + vertexes[0] = Coordinate::createCoordinate1D(dim1Increment * delta_x); + vertexes[1] = Coordinate::createCoordinate1D((dim1Increment + 1) * delta_x); return vertexes; } diff --git a/Code/Mantid/Framework/MDDataObjects/test/MDFitWorkspaceTest.h b/Code/Mantid/Framework/MDDataObjects/test/MDFitWorkspaceTest.h index abec45462b7c82acf90cddd8db5597b11d9d473c..40258b5e8733e19579bcf703301624bbf59d19ab 100644 --- a/Code/Mantid/Framework/MDDataObjects/test/MDFitWorkspaceTest.h +++ b/Code/Mantid/Framework/MDDataObjects/test/MDFitWorkspaceTest.h @@ -31,8 +31,8 @@ public: do { std::vector<boost::shared_ptr<Mantid::Geometry::MDPoint> > points(2); - points[0].reset(new MDPoint(double(rand() % 100),1.0,std::vector<coordinate>(),IDetector_sptr(),IInstrument_sptr())); - points[1].reset(new MDPoint(double(rand() % 100),1.0,std::vector<coordinate>(),IDetector_sptr(),IInstrument_sptr())); + points[0].reset(new MDPoint(double(rand() % 100),1.0,std::vector<Coordinate>(),IDetector_sptr(),IInstrument_sptr())); + points[1].reset(new MDPoint(double(rand() % 100),1.0,std::vector<Coordinate>(),IDetector_sptr(),IInstrument_sptr())); size_t i = it->getPointer(); ws.setCell(i,points); } diff --git a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/IMDBox.h b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/IMDBox.h index 369daa238bc62e8b09f329ad8df79763afac607b..04fc70a5bb9ca049170436303412e6fe79784626 100644 --- a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/IMDBox.h +++ b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/IMDBox.h @@ -70,7 +70,7 @@ namespace MDEvents /// Return a copy of contained events virtual std::vector< MDE > * getEventsCopy() = 0; - virtual std::vector<Mantid::Geometry::coordinate> getVertexes() const + virtual std::vector<Mantid::Geometry::Coordinate> getVertexes() const { throw std::runtime_error("Not implemented."); } @@ -226,7 +226,7 @@ namespace MDEvents /** Sets the integrated signal from all points within (mostly used for testing) * @param signal :: new Signal amount. */ - virtual void setSignal(const double signal) + virtual void setSignal(const signal_t signal) { m_signal = signal; } @@ -235,7 +235,7 @@ namespace MDEvents /** Sets the integrated error squared from all points within (mostly used for testing) * @param ErrorSquared :: new squared error. */ - virtual void setErrorSquared(const double ErrorSquared) + virtual void setErrorSquared(const signal_t ErrorSquared) { m_errorSquared = ErrorSquared; } diff --git a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDDimensionStats.h b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDDimensionStats.h index 4a7fe2baf2de15dbc43ff623bdfcd6a8cfe90313..f6e2ae9d41c939081a3b57053f721ae271745eac 100644 --- a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDDimensionStats.h +++ b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDDimensionStats.h @@ -33,11 +33,11 @@ namespace MDEvents //--------------------------------------------------------------------------------------- /** Returns the mean position of events in this dimension */ coord_t getMean() const - { return total / double(numPoints); } + { return total / coord_t(numPoints); } /** Returns the approximate standard deviation of the position of events in this dimension */ coord_t getApproxVariance() const - { return totalApproxVariance / double(numPoints); } + { return totalApproxVariance / coord_t(numPoints); } //--------------------------------------------------------------------------------------- @@ -48,7 +48,7 @@ namespace MDEvents { total += x; numPoints++; - coord_t diff = (x - total/double(numPoints)); + coord_t diff = (x - total/coord_t(numPoints)); totalApproxVariance += diff * diff; } diff --git a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDHistoWorkspace.h b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDHistoWorkspace.h index 3fab3bea1c7d40fa2940dd513ac1811c7b6c721e..cd10283fad622239e6de7d72967603b6888c9e9d 100644 --- a/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDHistoWorkspace.h +++ b/Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDHistoWorkspace.h @@ -112,13 +112,13 @@ namespace MDEvents /// Sets the signal at the specified index. - void setSignalAt(size_t index, double value) + void setSignalAt(size_t index, signal_t value) { m_signals[index] = value; } /// Sets the error at the specified index. - void setErrorAt(size_t index, double value) + void setErrorAt(size_t index, signal_t value) { m_errors[index] = value; } @@ -127,25 +127,25 @@ namespace MDEvents /// Get the error of the signal at the specified index. - virtual double getErrorAt(size_t index) const + virtual signal_t getErrorAt(size_t index) const { return m_errors[index]; } /// Get the error at the specified index given in 4 dimensions (typically X,Y,Z,t) - virtual double getErrorAt(size_t index1, size_t index2) const + virtual signal_t getErrorAt(size_t index1, size_t index2) const { return m_errors[index1 + indexMultiplier[0]*index2]; } /// Get the error at the specified index given in 4 dimensions (typically X,Y,Z,t) - virtual double getErrorAt(size_t index1, size_t index2, size_t index3) const + virtual signal_t getErrorAt(size_t index1, size_t index2, size_t index3) const { return m_errors[index1 + indexMultiplier[0]*index2 + indexMultiplier[1]*index3]; } /// Get the error at the specified index given in 4 dimensions (typically X,Y,Z,t) - virtual double getErrorAt(size_t index1, size_t index2, size_t index3, size_t index4) const + virtual signal_t getErrorAt(size_t index1, size_t index2, size_t index3, size_t index4) const { return m_errors[index1 + indexMultiplier[0]*index2 + indexMultiplier[1]*index3 + indexMultiplier[2]*index4]; } @@ -153,25 +153,25 @@ namespace MDEvents /// Get the signal at the specified index. - virtual double getSignalAt(size_t index) const + virtual signal_t getSignalAt(size_t index) const { return m_signals[index]; } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t) - virtual double getSignalAt(size_t index1, size_t index2) const + virtual signal_t getSignalAt(size_t index1, size_t index2) const { return m_signals[index1 + indexMultiplier[0]*index2]; } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t) - virtual double getSignalAt(size_t index1, size_t index2, size_t index3) const + virtual signal_t getSignalAt(size_t index1, size_t index2, size_t index3) const { return m_signals[index1 + indexMultiplier[0]*index2 + indexMultiplier[1]*index3]; } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t) - virtual double getSignalAt(size_t index1, size_t index2, size_t index3, size_t index4) const + virtual signal_t getSignalAt(size_t index1, size_t index2, size_t index3, size_t index4) const { return m_signals[index1 + indexMultiplier[0]*index2 + indexMultiplier[1]*index3 + indexMultiplier[2]*index4]; } @@ -180,25 +180,25 @@ namespace MDEvents /// Get the signal at the specified index, normalized by cell volume - virtual double getSignalNormalizedAt(size_t index) const + virtual signal_t getSignalNormalizedAt(size_t index) const { return m_signals[index] * m_inverseVolume; } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getSignalNormalizedAt(size_t index1, size_t index2) const + virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2) const { return getSignalAt(index1,index2) * m_inverseVolume; } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getSignalNormalizedAt(size_t index1, size_t index2, size_t index3) const + virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2, size_t index3) const { return getSignalAt(index1,index2,index3) * m_inverseVolume; } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const + virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const { return getSignalAt(index1,index2,index3,index4) * m_inverseVolume; } @@ -206,33 +206,33 @@ namespace MDEvents /// Get the error of the signal at the specified index, normalized by cell volume - virtual double getErrorNormalizedAt(size_t index) const + virtual signal_t getErrorNormalizedAt(size_t index) const { return m_errors[index] * m_inverseVolume; } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getErrorNormalizedAt(size_t index1, size_t index2) const + virtual signal_t getErrorNormalizedAt(size_t index1, size_t index2) const { return getErrorAt(index1,index2) * m_inverseVolume; } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getErrorNormalizedAt(size_t index1, size_t index2, size_t index3) const + virtual signal_t getErrorNormalizedAt(size_t index1, size_t index2, size_t index3) const { return getErrorAt(index1,index2,index3) * m_inverseVolume; } /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getErrorNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const + virtual signal_t getErrorNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const { return getErrorAt(index1,index2,index3,index4) * m_inverseVolume; } /// Return a vector containing a copy of the signal data in the workspace. TODO: Make this more efficient if needed. - virtual std::vector<double> getSignalDataVector() const; - virtual std::vector<double> getErrorDataVector() const; + virtual std::vector<signal_t> getSignalDataVector() const; + virtual std::vector<signal_t> getErrorDataVector() const; /// Getter for collapsed dimensions. Mantid::Geometry::VecIMDDimension_const_sptr getNonIntegratedDimensions() const; @@ -301,10 +301,10 @@ namespace MDEvents size_t numDimensions; /// Linear array of signals for each bin - double * m_signals; + signal_t * m_signals; /// Linear array of errors for each bin - double * m_errors; + signal_t * m_errors; /// Length of the m_signals / m_errors arrays. size_t m_length; @@ -316,7 +316,7 @@ namespace MDEvents size_t * indexMultiplier; /// Inverse of the volume of EACH cell - double m_inverseVolume; + coord_t m_inverseVolume; }; diff --git a/Code/Mantid/Framework/MDEvents/src/MDCentroidPeaks.cpp b/Code/Mantid/Framework/MDEvents/src/MDCentroidPeaks.cpp index 63a98bb2f8f322c83fdccb2f373af0e8be3075cd..31b1a9750bf82a7b2e52ed121a872aa65108696d 100644 --- a/Code/Mantid/Framework/MDEvents/src/MDCentroidPeaks.cpp +++ b/Code/Mantid/Framework/MDEvents/src/MDCentroidPeaks.cpp @@ -133,7 +133,7 @@ namespace MDEvents CoordTransformDistance sphere(nd, center, dimensionsUsed); // Initialize the centroid to 0.0 - double signal = 0; + signal_t signal = 0; coord_t centroid[nd]; for (size_t d=0; d<nd; d++) centroid[d] = 0.0; diff --git a/Code/Mantid/Framework/MDEvents/src/MDEWPeakIntegration.cpp b/Code/Mantid/Framework/MDEvents/src/MDEWPeakIntegration.cpp index f9879adbe22a82400a7f7e1c975e9aa775a24f8b..a1ad10a9d756061c10177ef59afa21ff5c73be4e 100644 --- a/Code/Mantid/Framework/MDEvents/src/MDEWPeakIntegration.cpp +++ b/Code/Mantid/Framework/MDEvents/src/MDEWPeakIntegration.cpp @@ -135,13 +135,13 @@ namespace MDEvents CoordTransformDistance sphere(nd, center, dimensionsUsed); // Perform the integration into whatever box is contained within. - double signal = 0; - double errorSquared = 0; + signal_t signal = 0; + signal_t errorSquared = 0; ws->getBox()->integrateSphere(sphere, PeakRadius*PeakRadius, signal, errorSquared); // Integrate around the background radius - double bgSignal = 0; - double bgErrorSquared = 0; + signal_t bgSignal = 0; + signal_t bgErrorSquared = 0; if (BackgroundRadius > PeakRadius) { ws->getBox()->integrateSphere(sphere, BackgroundRadius*BackgroundRadius, bgSignal, bgErrorSquared); diff --git a/Code/Mantid/Framework/MDEvents/src/MDHistoWorkspace.cpp b/Code/Mantid/Framework/MDEvents/src/MDHistoWorkspace.cpp index 4cd24f038d6c7ad52a929f61b696f5da76496e18..4730744a01caa2764dadfc0efe647598ab5240ec 100644 --- a/Code/Mantid/Framework/MDEvents/src/MDHistoWorkspace.cpp +++ b/Code/Mantid/Framework/MDEvents/src/MDHistoWorkspace.cpp @@ -68,11 +68,11 @@ namespace MDEvents indexMultiplier[d] = 0; // Allocate the linear arrays - m_signals = new double[m_length]; - m_errors = new double[m_length]; + m_signals = new signal_t[m_length]; + m_errors = new signal_t[m_length]; // Initialize them to NAN (quickly) - double nan = std::numeric_limits<double>::quiet_NaN(); + signal_t nan = std::numeric_limits<signal_t>::quiet_NaN(); for (size_t i=0; i < m_length; i++) { m_signals[i] = nan; @@ -80,7 +80,7 @@ namespace MDEvents } // Compute the volume of each cell. - double volume = 1.0; + coord_t volume = 1.0; for (size_t i=0; i < m_dimensions.size(); ++i) volume *= m_dimensions[i]->getBinWidth(); m_inverseVolume = 1.0 / volume; @@ -101,15 +101,15 @@ namespace MDEvents /** Return the memory used, in bytes */ size_t MDHistoWorkspace::getMemorySize() const { - return m_length * 2 * sizeof(double); + return m_length * 2 * sizeof(signal_t); } //---------------------------------------------------------------------------------------------- /// @return a vector containing a copy of the signal data in the workspace. - std::vector<double> MDHistoWorkspace::getSignalDataVector() const + std::vector<signal_t> MDHistoWorkspace::getSignalDataVector() const { // TODO: Make this more efficient if needed. - std::vector<double> out; + std::vector<signal_t> out; out.resize(m_length, 0.0); for (size_t i=0; i<m_length; ++i) out[i] = m_signals[i]; @@ -118,10 +118,10 @@ namespace MDEvents } /// @return a vector containing a copy of the error data in the workspace. - std::vector<double> MDHistoWorkspace::getErrorDataVector() const + std::vector<signal_t> MDHistoWorkspace::getErrorDataVector() const { // TODO: Make this more efficient if needed. - std::vector<double> out; + std::vector<signal_t> out; out.resize(m_length, 0.0); for (size_t i=0; i<m_length; ++i) out[i] = m_errors[i]; diff --git a/Code/Mantid/Framework/MDEvents/test/CoordTransformDistanceTest.h b/Code/Mantid/Framework/MDEvents/test/CoordTransformDistanceTest.h index 213a116b17ad51867d41b3b75ed813cf15ee3bd6..40207d72382df7f8a9b3000c446c404056041e39 100644 --- a/Code/Mantid/Framework/MDEvents/test/CoordTransformDistanceTest.h +++ b/Code/Mantid/Framework/MDEvents/test/CoordTransformDistanceTest.h @@ -1,14 +1,14 @@ #ifndef MANTID_MDEVENTS_COORDTRANSFORMDISTANCETEST_H_ #define MANTID_MDEVENTS_COORDTRANSFORMDISTANCETEST_H_ -#include <cxxtest/TestSuite.h> -#include "MantidKernel/Timer.h" #include "MantidKernel/System.h" -#include <iostream> -#include <iomanip> - +#include "MantidKernel/Timer.h" #include "MantidMDEvents/CoordTransformDistance.h" +#include <cxxtest/TestSuite.h> +#include <iomanip> +#include <iostream> +using namespace Mantid; using namespace Mantid::MDEvents; class CoordTransformDistanceTest : public CxxTest::TestSuite diff --git a/Code/Mantid/Framework/MDEvents/test/CoordTransformTest.h b/Code/Mantid/Framework/MDEvents/test/CoordTransformTest.h index d16a1519e46e07c25126ae7389151e3d8e316e9b..1b28b500c89b696420a621a6be79f3d164e57afd 100644 --- a/Code/Mantid/Framework/MDEvents/test/CoordTransformTest.h +++ b/Code/Mantid/Framework/MDEvents/test/CoordTransformTest.h @@ -1,15 +1,15 @@ #ifndef MANTID_MDEVENTS_COORDTRANSFORMTEST_H_ #define MANTID_MDEVENTS_COORDTRANSFORMTEST_H_ -#include <cxxtest/TestSuite.h> -#include "MantidKernel/Timer.h" #include "MantidKernel/System.h" -#include <iostream> -#include <iomanip> - +#include "MantidKernel/Timer.h" #include "MantidMDEvents/CoordTransform.h" #include "MantidMDEvents/MDEventFactory.h" +#include <cxxtest/TestSuite.h> +#include <iomanip> +#include <iostream> +using namespace Mantid; using namespace Mantid::MDEvents; class CoordTransformTest : public CxxTest::TestSuite diff --git a/Code/Mantid/Framework/MDEvents/test/IMDBoxTest.h b/Code/Mantid/Framework/MDEvents/test/IMDBoxTest.h index 47b3116be86c02867fc519d59ecdcff18cbc2d45..aac92f373b04a424355224ce5368db8fa181ff9e 100644 --- a/Code/Mantid/Framework/MDEvents/test/IMDBoxTest.h +++ b/Code/Mantid/Framework/MDEvents/test/IMDBoxTest.h @@ -1,14 +1,14 @@ #ifndef MANTID_MDEVENTS_IMDBOXTEST_H_ #define MANTID_MDEVENTS_IMDBOXTEST_H_ -#include <cxxtest/TestSuite.h> -#include "MantidKernel/Timer.h" #include "MantidKernel/System.h" -#include <iostream> -#include <iomanip> - +#include "MantidKernel/Timer.h" #include "MantidMDEvents/IMDBox.h" +#include <cxxtest/TestSuite.h> +#include <iomanip> +#include <iostream> +using namespace Mantid; using namespace Mantid::MDEvents; @@ -79,6 +79,7 @@ public: box.setErrorSquared(456.0); TS_ASSERT_EQUALS( box.getSignal(), 123.0); TS_ASSERT_EQUALS( box.getErrorSquared(), 456.0); + TS_ASSERT_DELTA( box.getError(), sqrt(456.0), 1e-4); } /** Setting and getting the extents; diff --git a/Code/Mantid/Framework/MDEvents/test/MDBinTest.h b/Code/Mantid/Framework/MDEvents/test/MDBinTest.h index b2c811f47bea4c7e9a6e70236a8db08c77017b31..e2c91cba0aca962b1e6d5a9c18d7ac8514e09750 100644 --- a/Code/Mantid/Framework/MDEvents/test/MDBinTest.h +++ b/Code/Mantid/Framework/MDEvents/test/MDBinTest.h @@ -1,15 +1,15 @@ #ifndef MANTID_MDEVENTS_MDBINTEST_H_ #define MANTID_MDEVENTS_MDBINTEST_H_ -#include <cxxtest/TestSuite.h> -#include "MantidKernel/Timer.h" #include "MantidKernel/System.h" -#include <iostream> -#include <iomanip> - +#include "MantidKernel/Timer.h" #include "MantidMDEvents/MDBin.h" #include "MantidMDEvents/MDEventFactory.h" +#include <cxxtest/TestSuite.h> +#include <iomanip> +#include <iostream> +using namespace Mantid; using namespace Mantid::MDEvents; class MDBinTest : public CxxTest::TestSuite diff --git a/Code/Mantid/Framework/MDEvents/test/MDBoxTest.h b/Code/Mantid/Framework/MDEvents/test/MDBoxTest.h index cb5d4978fbd3372ef1cebbfb4d4d8073e2127761..57111a523e9cb79804a6bbcf0d83e9eaf408c023 100644 --- a/Code/Mantid/Framework/MDEvents/test/MDBoxTest.h +++ b/Code/Mantid/Framework/MDEvents/test/MDBoxTest.h @@ -334,7 +334,7 @@ public: // Set up the data for the centroid coord_t centroid[2] = {0,0}; - double signal = 0.0; + signal_t signal = 0.0; b.centroidSphere(sphere, 400., centroid, signal); for (size_t d=0; d<2; d++) centroid[d] /= signal; diff --git a/Code/Mantid/Framework/MDEvents/test/MDEventWorkspaceTest.h b/Code/Mantid/Framework/MDEvents/test/MDEventWorkspaceTest.h index cbca35e58557ac9d7584710ea0b900d3531ade46..8c8d6703358da61f515e813fbd3a603cee694b5c 100644 --- a/Code/Mantid/Framework/MDEvents/test/MDEventWorkspaceTest.h +++ b/Code/Mantid/Framework/MDEvents/test/MDEventWorkspaceTest.h @@ -132,7 +132,7 @@ public: { for (size_t i=0; i < num_repeat; i++) { - double centers[2] = {x, y}; + coord_t centers[2] = {x, y}; events.push_back( MDEvent<2>(2.0, 2.0, centers) ); } } @@ -329,8 +329,8 @@ public: bool dimensionsUsed[3] = {true,true,true}; CoordTransformDistance sphere(3, center, dimensionsUsed); - double signal = 0; - double errorSquared = 0; + signal_t signal = 0; + signal_t errorSquared = 0; ws->getBox()->integrateSphere(sphere, 1.0, signal, errorSquared); //TODO: diff --git a/Code/Mantid/Framework/MDEvents/test/MDGridBoxTest.h b/Code/Mantid/Framework/MDEvents/test/MDGridBoxTest.h index e94e2f60e94a0a94ead9da4dfb06287c7f160f3e..67d2ed8f6c7c2a84f6268130796ac10d7dc96a52 100644 --- a/Code/Mantid/Framework/MDEvents/test/MDGridBoxTest.h +++ b/Code/Mantid/Framework/MDEvents/test/MDGridBoxTest.h @@ -122,7 +122,7 @@ public: while (!allDone) { // Generate the position from the counter - double centers[nd]; + coord_t centers[nd]; for (size_t d=0;d<nd;d++) centers[d] = double(counters[d])*step + start; @@ -391,15 +391,15 @@ public: TS_ASSERT_EQUALS( superbox->getNPoints(), 0 ); { // One event in 0th box of the 0th box. - double centers[2] = {0.05, 0.05}; + coord_t centers[2] = {0.05, 0.05}; superbox->addEvent( MDEvent<2>(2.0, 2.0, centers) ); } { // One event in 1st box of the 0th box. - double centers[2] = {0.15, 0.05}; + coord_t centers[2] = {0.15, 0.05}; superbox->addEvent( MDEvent<2>(2.0, 2.0, centers) ); } { // One event in 99th box. - double centers[2] = {9.5, 9.5}; + coord_t centers[2] = {9.5, 9.5}; superbox->addEvent( MDEvent<2>(2.0, 2.0, centers) ); } @@ -461,7 +461,7 @@ public: { for (size_t i=0; i<num_to_repeat; i++) { - double centers[2] = {x,y}; + coord_t centers[2] = {x,y}; box->addEvent( MDEvent<2>(2.0, 2.0, centers) ); } } @@ -491,7 +491,7 @@ public: for (double x=0.5; x < 10; x += 1.0) for (double y=0.5; y < 10; y += 1.0) { - double centers[2] = {x,y}; + coord_t centers[2] = {x,y}; events.push_back( MDEvent<2>(2.0, 2.0, centers) ); } @@ -523,7 +523,7 @@ public: for (double x=-5.0; x < 20; x += 20.0) for (double y=-5.0; y < 20; y += 20.0) { - double centers[2] = {x,y}; + coord_t centers[2] = {x,y}; events.push_back( MDEvent<2>(2.0, 2.0, centers) ); } // Get the right totals again @@ -550,7 +550,7 @@ public: for (double x=0.5; x < 10; x += 1.0) for (double y=0.5; y < 10; y += 1.0) { - double centers[2] = {x,y}; + coord_t centers[2] = {x,y}; events.push_back( MDEvent<2>(2.0, 2.0, centers) ); } @@ -581,7 +581,7 @@ public: for (double x=0.5; x < 10; x += 1.0) for (double y=0.5; y < 10; y += 1.0) { - double centers[2] = {x,y}; + coord_t centers[2] = {x,y}; events.push_back( MDEvent<2>(2.0, 2.0, centers) ); } TS_ASSERT_THROWS_NOTHING( b->addEvents( events ); ); @@ -629,7 +629,7 @@ public: for (size_t i=0; i < num_repeat; i++) { // Make an event in the middle of each box - double centers[2] = {1e-10, 1e-10}; + coord_t centers[2] = {1e-10, 1e-10}; events.push_back( MDEvent<2>(2.0, 2.0, centers) ); } TS_ASSERT_THROWS_NOTHING( b->addEvents( events ); ); @@ -695,7 +695,7 @@ public: for (double x=0.5; x < 10; x += 1.0) for (double y=0.5; y < 10; y += 1.0) { - double centers[2] = {x,y}; + coord_t centers[2] = {x,y}; for (size_t i=0; i < num_repeat; i++) { // Make an event in the middle of each box @@ -829,8 +829,8 @@ public: coord_t center[2] = {x,y}; CoordTransformDistance sphere(2, center, dimensionsUsed); - double signal = 0; - double errorSquared = 0; + signal_t signal = 0; + signal_t errorSquared = 0; box.integrateSphere(sphere, radius*radius, signal, errorSquared); TSM_ASSERT_DELTA( message, signal, 1.0*numExpected, 1e-5); TSM_ASSERT_DELTA( message, errorSquared, 1.0*numExpected, 1e-5); @@ -924,8 +924,8 @@ public: coord_t center[3] = {x,y,z}; CoordTransformDistance sphere(3, center, dimensionsUsed); - double signal = 0; - double errorSquared = 0; + signal_t signal = 0; + signal_t errorSquared = 0; box.integrateSphere(sphere, radius*radius, signal, errorSquared); TSM_ASSERT_DELTA( message, signal, 1.0*numExpected, 1e-5); TSM_ASSERT_DELTA( message, errorSquared, 1.0*numExpected, 1e-5); @@ -975,7 +975,7 @@ public: coord_t center[2] = {x,y}; CoordTransformDistance sphere(2, center, dimensionsUsed); - double signal = 0; + signal_t signal = 0; coord_t centroid[2] = {0., 0.}; box.centroidSphere(sphere, radius*radius, centroid, signal); // Normalized @@ -1123,7 +1123,7 @@ public: CoordTransformDistance sphere(3, center, dimensionsUsed); // Repeat the integration a lot - double signal, errorSquared; + signal_t signal, errorSquared; for (size_t i=0; i < 1000; i++) { signal = 0; @@ -1174,7 +1174,7 @@ public: CoordTransformDistance sphere(3, center, dimensionsUsed); // Repeat the integration a lot - double signal; + signal_t signal; coord_t centroid[3]; for (size_t i=0; i < 100; i++) { diff --git a/Code/Mantid/Framework/MDEvents/test/MDHistoWorkspaceTest.h b/Code/Mantid/Framework/MDEvents/test/MDHistoWorkspaceTest.h index fc52e2164cb7f2e92f80e735b79ec488e4ad0721..de5d462b84cc77581e58c6be3097d8840af17fba 100644 --- a/Code/Mantid/Framework/MDEvents/test/MDHistoWorkspaceTest.h +++ b/Code/Mantid/Framework/MDEvents/test/MDHistoWorkspaceTest.h @@ -1,18 +1,18 @@ #ifndef MANTID_MDEVENTS_MDHISTOWORKSPACETEST_H_ #define MANTID_MDEVENTS_MDHISTOWORKSPACETEST_H_ -#include <cxxtest/TestSuite.h> -#include <iostream> -#include <iomanip> -#include <boost/math/special_functions/fpclassify.hpp> - #include "MantidGeometry/MDGeometry/MDHistoDimension.h" #include "MantidKernel/System.h" #include "MantidKernel/Timer.h" #include "MantidMDEvents/MDHistoWorkspace.h" +#include <boost/math/special_functions/fpclassify.hpp> +#include <cxxtest/TestSuite.h> +#include <iomanip> +#include <iostream> using namespace Mantid::MDEvents; using namespace Mantid::Geometry; +using namespace Mantid; class MDHistoWorkspaceTest : public CxxTest::TestSuite { @@ -58,15 +58,15 @@ public: TS_ASSERT_DELTA( ws.getErrorAt(5), 1.234, 1e-5); TS_ASSERT_DELTA( ws.getErrorNormalizedAt(5), 1.234 / 256.0, 1e-5); // Cell volume is 256 - std::vector<double> data = ws.getSignalDataVector(); + std::vector<signal_t> data = ws.getSignalDataVector(); TS_ASSERT_EQUALS(data.size(), 5*5*5*5); TS_ASSERT_DELTA( data[5], 2.3456, 1e-5); // Set a different value at every point for (size_t i=0; i < ws.getNPoints(); ++i) { - ws.setSignalAt(i, (double) i); - ws.setErrorAt(i, (double) i); + ws.setSignalAt(i, (signal_t) i); + ws.setErrorAt(i, (signal_t) i); } // Test the 4 overloads of each method. Phew! @@ -113,7 +113,7 @@ public: ws.setErrorAt(5,1.234); TS_ASSERT_DELTA( ws.getErrorAt(5), 1.234, 1e-5); - std::vector<double> data = ws.getSignalDataVector(); + std::vector<signal_t> data = ws.getSignalDataVector(); TS_ASSERT_EQUALS(data.size(), 5*5); TS_ASSERT_DELTA( data[5], 2.3456, 1e-5); } @@ -141,7 +141,7 @@ public: ws.setErrorAt(5,1.234); TS_ASSERT_DELTA( ws.getErrorAt(5), 1.234, 1e-5); - std::vector<double> data = ws.getSignalDataVector(); + std::vector<signal_t> data = ws.getSignalDataVector(); TS_ASSERT_EQUALS(data.size(), 3*3*3*3*3*3*3); TS_ASSERT_DELTA( data[5], 2.3456, 1e-5); } diff --git a/Code/Mantid/Framework/MDEvents/test/MDSplitBoxTest.h b/Code/Mantid/Framework/MDEvents/test/MDSplitBoxTest.h index 569e3eb27dace1ec9cf32238bc606f391792a153..217f5c3aa8b4ad3a9b2a980a8962e931c2e4042b 100644 --- a/Code/Mantid/Framework/MDEvents/test/MDSplitBoxTest.h +++ b/Code/Mantid/Framework/MDEvents/test/MDSplitBoxTest.h @@ -62,7 +62,7 @@ public: for (double x=40; x<60; x++) //20 for (double y=20; y<80; y++) //60 { - double centers[2] = {x*0.1,y*0.1 + 0.05}; + coord_t centers[2] = {x*0.1,y*0.1 + 0.05}; mdbox->addEvent( MDEvent<2>(2.0, 2.0, centers) ); } TS_ASSERT_EQUALS(mdbox->getNPoints(), 20*60); diff --git a/Code/Mantid/Framework/Nexus/src/LoadNexusLogs.cpp b/Code/Mantid/Framework/Nexus/src/LoadNexusLogs.cpp index a5782053f7f8dbf481e1ce54c7a96cc7bb2d76f9..a9a21ea57f74519a5cc29c95fc4d69327ad3fec3 100644 --- a/Code/Mantid/Framework/Nexus/src/LoadNexusLogs.cpp +++ b/Code/Mantid/Framework/Nexus/src/LoadNexusLogs.cpp @@ -343,7 +343,7 @@ namespace Mantid // Now the actual data ::NeXus::Info info = file.getInfo(); // Check the size - if( info.dims[0] != time_double.size() ) + if( size_t(info.dims[0]) != time_double.size() ) { file.closeData(); throw ::NeXus::Exception("Invalid value entry for time series"); diff --git a/Code/Mantid/Framework/TestHelpers/inc/MantidTestHelpers/MDEventsTestHelper.h b/Code/Mantid/Framework/TestHelpers/inc/MantidTestHelpers/MDEventsTestHelper.h index c5f53d3e8c175eaff87491d9cc959d8fb181be28..1cc3f200c3a9320ebff628af004d3b674734cd44 100644 --- a/Code/Mantid/Framework/TestHelpers/inc/MantidTestHelpers/MDEventsTestHelper.h +++ b/Code/Mantid/Framework/TestHelpers/inc/MantidTestHelpers/MDEventsTestHelper.h @@ -67,7 +67,7 @@ namespace MDEventsTestHelper for (size_t i=0; i < numEventsPerBox; i++) { // Put an event in the middle of each box - Mantid::MDEvents::coord_t centers[nd]; + Mantid::coord_t centers[nd]; for (size_t d=0; d<nd; d++) centers[d] = min + (double(index[d])+0.5)*(max-min)/double(splitInto); out->addEvent( Mantid::MDEvents::MDEvent<nd>(1.0, 1.0, centers) ); diff --git a/Code/Mantid/Vates/VatesAPI/inc/MantidVatesAPI/IMDWorkspaceProxy.h b/Code/Mantid/Vates/VatesAPI/inc/MantidVatesAPI/IMDWorkspaceProxy.h index d1c808a973e8a63b70bd4227a179b9cc6e348ce9..0bdb8aae9cca458c5276ec3f9145b06385a07358 100644 --- a/Code/Mantid/Vates/VatesAPI/inc/MantidVatesAPI/IMDWorkspaceProxy.h +++ b/Code/Mantid/Vates/VatesAPI/inc/MantidVatesAPI/IMDWorkspaceProxy.h @@ -106,10 +106,10 @@ public: virtual size_t getMemorySize() const; /// Get the signal at the specified index. - virtual double getSignalAt(size_t index1, size_t index2, size_t index3, size_t index4) const; + virtual signal_t getSignalAt(size_t index1, size_t index2, size_t index3, size_t index4) const; /// Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume - virtual double getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const; + virtual signal_t getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const; virtual Mantid::Geometry::VecIMDDimension_const_sptr getNonIntegratedDimensions() const; diff --git a/Code/Mantid/Vates/VatesAPI/src/IMDWorkspaceProxy.cpp b/Code/Mantid/Vates/VatesAPI/src/IMDWorkspaceProxy.cpp index 66cc572bcf079fdae19bf891fd9e0276cba8cf33..c068b5351c4392bc1a9c08431333a4601c249189 100644 --- a/Code/Mantid/Vates/VatesAPI/src/IMDWorkspaceProxy.cpp +++ b/Code/Mantid/Vates/VatesAPI/src/IMDWorkspaceProxy.cpp @@ -179,13 +179,13 @@ Mantid::Geometry::IMDDimension_const_sptr IMDWorkspaceProxy::getTDimension(void) } -double IMDWorkspaceProxy::getSignalAt(size_t index1, size_t index2, size_t index3, size_t index4) const +signal_t IMDWorkspaceProxy::getSignalAt(size_t index1, size_t index2, size_t index3, size_t index4) const { return m_function(index1, index2, index3, index4); } -double IMDWorkspaceProxy::getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const +signal_t IMDWorkspaceProxy::getSignalNormalizedAt(size_t index1, size_t index2, size_t index3, size_t index4) const { return m_function(index1, index2, index3, index4); //TODO: need to divide by cell volume at this point. } diff --git a/Code/Mantid/Vates/VatesAPI/test/IMDWorkspaceProxyTest.h b/Code/Mantid/Vates/VatesAPI/test/IMDWorkspaceProxyTest.h index 920f8b409aa153d92e41a847cabe8fcd4b314bda..42c6cbe169554ad05dfcc3dcd55ccc5f135fda84 100644 --- a/Code/Mantid/Vates/VatesAPI/test/IMDWorkspaceProxyTest.h +++ b/Code/Mantid/Vates/VatesAPI/test/IMDWorkspaceProxyTest.h @@ -7,6 +7,8 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" +using namespace Mantid; + class IMDWorkspaceProxyTest: public CxxTest::TestSuite { private: @@ -91,7 +93,7 @@ private: { throw std::runtime_error("Not Implemented"); } - double getSignalAt(size_t index1, size_t index2, size_t index3, size_t index4) const + signal_t getSignalAt(size_t index1, size_t index2, size_t index3, size_t index4) const { uniqueArgumentCombination unique; //Creates a unique return value based on the inputs. Used to determine the arranagement of input arguments after remapping. return unique(index1, index2, index3, index4); diff --git a/Code/Mantid/Vates/VatesAPI/test/vtkStructuredGridFactoryTest.h b/Code/Mantid/Vates/VatesAPI/test/vtkStructuredGridFactoryTest.h index 94bf5c5ed3adb511a78c4c396cdd3cfd5d5d1850..c9e5605e3832e6260142f129a5e045f4ca6afee8 100644 --- a/Code/Mantid/Vates/VatesAPI/test/vtkStructuredGridFactoryTest.h +++ b/Code/Mantid/Vates/VatesAPI/test/vtkStructuredGridFactoryTest.h @@ -7,6 +7,7 @@ #include "MantidVatesAPI/vtkStructuredGridFactory.h" #include "MantidVatesAPI/TimeStepToTimeStep.h" +using namespace Mantid; //===================================================================================== // Test Helpers Types @@ -59,7 +60,7 @@ namespace MOCK_CONST_METHOD0(getDimensionIDs,const std::vector<std::string>()); MOCK_CONST_METHOD0(getNPoints, uint64_t()); MOCK_CONST_METHOD0(getNumDims, size_t()); - MOCK_CONST_METHOD4(getSignalAt, double(size_t index1, size_t index2, size_t index3, size_t index4)); + MOCK_CONST_METHOD4(getSignalAt, signal_t(size_t index1, size_t index2, size_t index3, size_t index4)); MOCK_CONST_METHOD0(getNonIntegratedDimensions, Mantid::Geometry::VecIMDDimension_const_sptr()); const Mantid::Geometry::SignalAggregate& getCell(...) const diff --git a/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingHexahedronFactoryTest.h b/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingHexahedronFactoryTest.h index 234f0b495d8d8e981cbbca37138008f3b570a176..77bf7e65a4fc973baf9c1da1647ea3b9bc2ba7bb 100644 --- a/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingHexahedronFactoryTest.h +++ b/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingHexahedronFactoryTest.h @@ -6,6 +6,8 @@ #include <cxxtest/TestSuite.h> #include "MantidVatesAPI/vtkThresholdingHexahedronFactory.h" +using namespace Mantid; + //===================================================================================== // Helper types common to Functional and Performance tests //===================================================================================== @@ -57,7 +59,7 @@ public: MOCK_CONST_METHOD0(getDimensionIDs,const std::vector<std::string>()); MOCK_CONST_METHOD0(getNPoints, uint64_t()); MOCK_CONST_METHOD0(getNumDims, size_t()); - MOCK_CONST_METHOD3(getSignalNormalizedAt, double(size_t index1, size_t index2, size_t index3)); + MOCK_CONST_METHOD3(getSignalNormalizedAt, signal_t(size_t index1, size_t index2, size_t index3)); MOCK_CONST_METHOD0(getNonIntegratedDimensions, Mantid::Geometry::VecIMDDimension_const_sptr()); const Mantid::Geometry::SignalAggregate& getCell(...) const { diff --git a/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingLineFactoryTest.h b/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingLineFactoryTest.h index 3d240883bfe7e83cbb2b266fae99deb8e0e8d153..a5c0b35e7027eab77f3e262a5911e102505d0e25 100644 --- a/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingLineFactoryTest.h +++ b/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingLineFactoryTest.h @@ -9,6 +9,7 @@ #include "MantidGeometry/MDGeometry/MDPoint.h" #include "MDDataObjects/MDIndexCalculator.h" +using namespace Mantid; //===================================================================================== // Test Helper Types @@ -104,7 +105,7 @@ public: MOCK_CONST_METHOD0(getDimensionIDs,const std::vector<std::string>()); MOCK_CONST_METHOD0(getNPoints, uint64_t()); MOCK_CONST_METHOD0(getNumDims, size_t()); - MOCK_CONST_METHOD1(getSignalNormalizedAt, double(size_t index1)); + MOCK_CONST_METHOD1(getSignalNormalizedAt, signal_t(size_t index1)); MOCK_CONST_METHOD0(getNonIntegratedDimensions, Mantid::Geometry::VecIMDDimension_const_sptr()); virtual Mantid::API::IMDIterator* createIterator() const diff --git a/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingQuadFactoryTest.h b/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingQuadFactoryTest.h index 28fb6d0aa2f6d7a1b84eaf5765ef035770b10925..1bf22a81edafc8b99cadb17e9d220f3f2a53ebf1 100644 --- a/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingQuadFactoryTest.h +++ b/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingQuadFactoryTest.h @@ -9,6 +9,8 @@ #include "MantidGeometry/MDGeometry/MDPoint.h" #include "MDDataObjects/MDIndexCalculator.h" +using namespace Mantid; + //===================================================================================== // Test helper types //===================================================================================== @@ -22,15 +24,15 @@ class FakeCell : public Mantid::Geometry::SignalAggregate { public: FakeCell(){} - virtual std::vector<Mantid::Geometry::coordinate> getVertexes() const + virtual std::vector<Mantid::Geometry::Coordinate> getVertexes() const { - return std::vector<Mantid::Geometry::coordinate>(4); + return std::vector<Mantid::Geometry::Coordinate>(4); } - virtual double getSignal() const + virtual signal_t getSignal() const { return 1; //Hard-coded signal value. Required for threshold checking in tests that follow. } - virtual double getError() const + virtual signal_t getError() const { throw std::runtime_error("Not implemented"); } @@ -127,7 +129,7 @@ public: MOCK_CONST_METHOD0(getDimensionIDs,const std::vector<std::string>()); MOCK_CONST_METHOD0(getNPoints, uint64_t()); MOCK_CONST_METHOD0(getNumDims, size_t()); - MOCK_CONST_METHOD2(getSignalNormalizedAt, double(size_t index1, size_t index2)); + MOCK_CONST_METHOD2(getSignalNormalizedAt, signal_t(size_t index1, size_t index2)); MOCK_CONST_METHOD0(getNonIntegratedDimensions, Mantid::Geometry::VecIMDDimension_const_sptr()); virtual Mantid::API::IMDIterator* createIterator() const { diff --git a/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingUnstructuredGridFactoryTest.h b/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingUnstructuredGridFactoryTest.h index 268be599b16c6d1c12e1d56c9055d0c512b2f7b5..3a54f35d64e80c0ebb9f6ba968ae934abbb9f323 100644 --- a/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingUnstructuredGridFactoryTest.h +++ b/Code/Mantid/Vates/VatesAPI/test/vtkThresholdingUnstructuredGridFactoryTest.h @@ -7,6 +7,8 @@ #include "MantidVatesAPI/vtkThresholdingUnstructuredGridFactory.h" #include "MantidVatesAPI/TimeStepToTimeStep.h" +using namespace Mantid; + //===================================================================================== // Test Helpers Types //===================================================================================== @@ -58,7 +60,7 @@ namespace MOCK_CONST_METHOD0(getDimensionIDs,const std::vector<std::string>()); MOCK_CONST_METHOD0(getNPoints, uint64_t()); MOCK_CONST_METHOD0(getNumDims, size_t()); - MOCK_CONST_METHOD4(getSignalNormalizedAt, double(size_t index1, size_t index2, size_t index3, size_t index4)); + MOCK_CONST_METHOD4(getSignalNormalizedAt, signal_t(size_t index1, size_t index2, size_t index3, size_t index4)); MOCK_CONST_METHOD0(getNonIntegratedDimensions, Mantid::Geometry::VecIMDDimension_const_sptr()); const Mantid::Geometry::SignalAggregate& getCell(...) const