Commit cfdffa7e authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony
Browse files

Refs #3175. Sorry for the huge commit but certain things require Matrix to be...

Refs #3175. Sorry for the huge commit but certain things require Matrix to be in Kernel. Given how Quat, V3D and Matrix inter cooperate it seemed sensible for them to be in the same place and arguably this is where they belong anyway.
parent 87b024e4
......@@ -3,8 +3,8 @@
#include "MantidAPI/DllConfig.h"
#include "MantidGeometry/IInstrument.h"
#include "MantidGeometry/Math/Matrix.h"
#include "MantidGeometry/V3D.h"
#include "MantidKernel/Matrix.h"
#include "MantidKernel/V3D.h"
#include "MantidKernel/PhysicalConstants.h"
//#include "MantidKernel/System.h"
......@@ -38,18 +38,18 @@ namespace API
virtual double getH() const = 0;
virtual double getK() const = 0;
virtual double getL() const = 0;
virtual Mantid::Geometry::V3D getHKL() = 0;
virtual Mantid::Kernel::V3D getHKL() = 0;
virtual void setH(double m_H) = 0;
virtual void setK(double m_K) = 0;
virtual void setL(double m_L) = 0;
virtual void setHKL(double H, double K, double L) = 0;
virtual void setHKL(Mantid::Geometry::V3D HKL) = 0;
virtual void setHKL(Mantid::Kernel::V3D HKL) = 0;
virtual Mantid::Geometry::V3D getQLabFrame() const = 0;
virtual Mantid::Geometry::V3D getQSampleFrame() const = 0;
virtual Mantid::Kernel::V3D getQLabFrame() const = 0;
virtual Mantid::Kernel::V3D getQSampleFrame() const = 0;
virtual void setQSampleFrame(Mantid::Geometry::V3D QSampleFrame, double detectorDistance=1.0) = 0;
virtual void setQLabFrame(Mantid::Geometry::V3D QLabFrame, double detectorDistance=1.0) = 0;
virtual void setQSampleFrame(Mantid::Kernel::V3D QSampleFrame, double detectorDistance=1.0) = 0;
virtual void setQLabFrame(Mantid::Kernel::V3D QLabFrame, double detectorDistance=1.0) = 0;
virtual void setWavelength(double wavelength) = 0;
virtual double getWavelength() const = 0;
......@@ -70,14 +70,14 @@ namespace API
virtual double getBinCount() const = 0;
virtual void setBinCount(double m_BinCount) = 0;
virtual Mantid::Geometry::Matrix<double> getGoniometerMatrix() const = 0;
virtual void setGoniometerMatrix(Mantid::Geometry::Matrix<double> m_GoniometerMatrix) = 0;
virtual Mantid::Kernel::Matrix<double> getGoniometerMatrix() const = 0;
virtual void setGoniometerMatrix(Mantid::Kernel::Matrix<double> m_GoniometerMatrix) = 0;
virtual std::string getBankName() const = 0;
virtual int getRow() const = 0;
virtual int getCol() const = 0;
virtual Mantid::Geometry::V3D getDetPos() const = 0;
virtual Mantid::Kernel::V3D getDetPos() const = 0;
virtual double getL1() const = 0;
virtual double getL2() const = 0;
......
......@@ -85,7 +85,7 @@ namespace API
* @param detectorDistance :: distance between the sample and the detector.
* @return a pointer to a new Peak object.
*/
virtual IPeak* createPeak(Mantid::Geometry::V3D QLabFrame, double detectorDistance=1.0) = 0;
virtual IPeak* createPeak(Mantid::Kernel::V3D QLabFrame, double detectorDistance=1.0) = 0;
};
......
......@@ -7,7 +7,7 @@
#include "MantidAPI/Workspace.h"
#include "MantidAPI/Column.h"
#include "MantidGeometry/V3D.h"
#include "MantidKernel/V3D.h"
#include <boost/shared_ptr.hpp>
#include <boost/lexical_cast.hpp>
......@@ -61,7 +61,7 @@ public:
- "double" for double
- "bool" for bool
- "str" for std::string
- "V3D" for Mantid::Geometry::V3D
- "V3D" for Mantid::Kernel::V3D
User defined types can be used after declaring them with DECLARE_TABLECOLUMN macro:
DECLARE_TABLECOLUMN(typeName, UserDefinedType)
......@@ -276,8 +276,8 @@ public:
virtual void find(API::Boolean value,int& row,const int & col)=0;
/// find method to get the index of cellstd::string value in a table workspace
virtual void find(std::string value,int& row,const int & col)=0;
/// find method to get the index of Mantid::Geometry::V3D cell value in a table workspace
virtual void find(Mantid::Geometry::V3D value,int& row,const int & col)=0;
/// find method to get the index of Mantid::Kernel::V3D cell value in a table workspace
virtual void find(Mantid::Kernel::V3D value,int& row,const int & col)=0;
void modified();
......
......@@ -5,7 +5,7 @@
// Includes
//-----------------------------------------------------------------------------
#include "MantidAPI/DllConfig.h"
#include "MantidGeometry/Math/Matrix.h"
#include "MantidKernel/Matrix.h"
#include "MantidKernel/PropertyWithValue.h"
#include "MantidKernel/NullValidator.h"
......@@ -35,10 +35,10 @@ namespace Mantid
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
template<class TYPE = double>
class DLLExport MatrixProperty : public Kernel::PropertyWithValue<Geometry::Matrix<TYPE> >
class DLLExport MatrixProperty : public Kernel::PropertyWithValue<Kernel::Matrix<TYPE> >
{
/// Typedef the held type
typedef Geometry::Matrix<TYPE> HeldType;
typedef Kernel::Matrix<TYPE> HeldType;
public:
/// Constructor
......
......@@ -6,7 +6,7 @@
#include "MantidKernel/PropertyManager.h"
#include "MantidKernel/TimeSplitter.h"
#include <vector>
#include "MantidGeometry/Math/Matrix.h"
#include "MantidKernel/Matrix.h"
namespace Mantid
......@@ -112,7 +112,7 @@ namespace Mantid
{ return m_goniometer; }
// Retrieve the goniometer rotation matrix
Mantid::Geometry::DblMatrix getGoniometerMatrix();
Mantid::Kernel::DblMatrix getGoniometerMatrix();
/**
* Add a log entry
......
......@@ -5,7 +5,7 @@
// Includes
//------------------------------------------------------------------------------
#include "MantidAPI/DllConfig.h"
#include "MantidGeometry/V3D.h"
#include "MantidKernel/V3D.h"
#include "MantidGeometry/Objects/Object.h"
#include "MantidGeometry/Objects/Material.h"
#include <MantidGeometry/Crystal/OrientedLattice.h>
......
......@@ -55,7 +55,7 @@ namespace Mantid
/// shape
int add(IComponent* comp);
/// Is the point given a valid point within the environment
bool isValid(const Geometry::V3D & point) const;
bool isValid(const Kernel::V3D & point) const;
/// Update the given track with intersections within the environment
void interceptSurfaces(Geometry::Track & track) const;
......
......@@ -51,9 +51,9 @@ namespace Mantid
* IPropertyManager::getValue definitions so that algorithm.getProperty will work
*/
///@cond
DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Geometry::DblMatrix);
DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Geometry::IntMatrix);
DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Geometry::Matrix<float>);
DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::DblMatrix);
DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::IntMatrix);
DEFINE_IPROPERTYMANAGER_GETVALUE(Mantid::Kernel::Matrix<float>);
///@endcond
......@@ -29,6 +29,7 @@ namespace Mantid
{
using std::size_t;
using namespace Geometry;
using Kernel::V3D;
Kernel::Logger& MatrixWorkspace::g_log = Kernel::Logger::get("MatrixWorkspace");
const std::string MatrixWorkspace::xDimensionId = "xDimension";
......@@ -531,8 +532,8 @@ namespace Mantid
throw Kernel::Exception::InstrumentDefinitionError("Instrument not sufficiently defined: failed to get source and/or sample");
}
const Geometry::V3D samplePos = sample->getPos();
const Geometry::V3D beamLine = samplePos - source->getPos();
const Kernel::V3D samplePos = sample->getPos();
const Kernel::V3D beamLine = samplePos - source->getPos();
return det->getTwoTheta(samplePos,beamLine);
}
......@@ -1173,8 +1174,8 @@ namespace Mantid
/// Get coordinate for index;
virtual double getX(size_t ind)const {return m_axis(ind);}
// Mess; TODO: clear
virtual Geometry::V3D getDirection(void)const {throw std::runtime_error("Not implemented");}
virtual Geometry::V3D getDirectionCryst(void)const {throw std::runtime_error("Not implemented");}
virtual Kernel::V3D getDirection(void)const {throw std::runtime_error("Not implemented");}
virtual Kernel::V3D getDirectionCryst(void)const {throw std::runtime_error("Not implemented");}
/// the function returns the center points of the axis bins; There are nBins of such points
/// (when axis has nBins+1 points with point 0 equal rMin and nBins+1 equal rMax)
......
......@@ -312,7 +312,7 @@ Kernel::Logger& Run::g_log = Kernel::Logger::get("Run");
*
* @return 3x3 double rotation matrix
*/
Mantid::Geometry::DblMatrix Run::getGoniometerMatrix()
Mantid::Kernel::DblMatrix Run::getGoniometerMatrix()
{
for (size_t i=0; i < m_goniometer.getNumberAxes(); ++i)
{
......
......@@ -13,7 +13,7 @@ namespace Mantid
using Geometry::Object;
using Geometry::Material;
using Geometry::V3D;
using Kernel::V3D;
/**
* Default constructor
......
......@@ -13,7 +13,7 @@ namespace Mantid
using Geometry::IComponent;
using Geometry::IObjComponent;
using Geometry::V3D;
using Kernel::V3D;
using Geometry::Track;
//------------------------------------------------------------------------------
......
......@@ -8,8 +8,8 @@
#include <cxxtest/TestSuite.h>
using Mantid::API::MatrixProperty;
using Mantid::Geometry::DblMatrix;
using Mantid::Geometry::IntMatrix;
using Mantid::Kernel::DblMatrix;
using Mantid::Kernel::IntMatrix;
class MatrixPropertyTest : public CxxTest::TestSuite
{
......
......@@ -5,10 +5,10 @@
#include "MantidAPI/Run.h"
#include "MantidKernel/Exception.h"
#include "MantidKernel/Property.h"
#include "MantidGeometry/Math/Matrix.h"
#include "MantidKernel/Matrix.h"
#include "MantidKernel/TimeSeriesProperty.h"
#include "MantidTestHelpers/WorkspaceCreationHelper.h"
#include "MantidGeometry/V3D.h"
#include "MantidKernel/V3D.h"
using namespace Mantid::Kernel;
using namespace Mantid::API;
......
......@@ -83,10 +83,10 @@ protected:
API::MatrixWorkspace_const_sptr m_inputWS; ///< A pointer to the input workspace
const Geometry::Object* m_sampleObject; ///< Local cache of sample object.
Geometry::V3D m_beamDirection; ///< The direction of the beam.
Kernel::V3D m_beamDirection; ///< The direction of the beam.
std::vector<double> m_L1s, ///< Cached L1 distances
m_elementVolumes; ///< Cached element volumes
std::vector<Geometry::V3D> m_elementPositions; ///< Cached element positions
std::vector<Kernel::V3D> m_elementPositions; ///< Cached element positions
size_t m_numVolumeElements; ///< The number of volume elements
double m_sampleVolume; ///< The total volume of the sample
......
......@@ -2,7 +2,7 @@
#define MANTID_ALGORITHM_DETECTEFFICIENCYCOR_H_
#include "MantidAPI/Algorithm.h"
#include "MantidGeometry/V3D.h"
#include "MantidKernel/V3D.h"
#include <climits>
#include <string>
#include <vector>
......@@ -103,9 +103,9 @@ class DLLExport DetectorEfficiencyCor : public API::Algorithm
/// Calculate one over the wave vector for 2 bin bounds
double calculateOneOverK(double loBinBound, double uppBinBound) const;
/// Sets the detector geometry cache if necessary
void getDetectorGeometry(boost::shared_ptr<Geometry::IDetector> det, double & detRadius, Geometry::V3D & detAxis);
void getDetectorGeometry(boost::shared_ptr<Geometry::IDetector> det, double & detRadius, Kernel::V3D & detAxis);
/// Computes the distance to the given shape from a starting point
double distToSurface(const Geometry::V3D start, const Geometry::Object *shape) const;
double distToSurface(const Kernel::V3D start, const Geometry::Object *shape) const;
/// Computes the detector efficiency for a given paramater
double detectorEfficiency(const double alpha) const;
/// Computes an approximate expansion of a Chebysev polynomial
......@@ -128,9 +128,9 @@ private:
double m_ki;
/// A lookup of previously seen shape objects used to save calculation time as most detectors have the same shape
std::map<const Geometry::Object *, std::pair<double, Geometry::V3D> > m_shapeCache;
std::map<const Geometry::Object *, std::pair<double, Kernel::V3D> > m_shapeCache;
/// Sample position
Geometry::V3D m_samplePos;
Kernel::V3D m_samplePos;
/// The spectra numbers that were skipped
std::vector<int64_t> m_spectraSkipped;
......
......@@ -40,7 +40,7 @@ namespace Algorithms
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport DiffractionEventReadDetCal: public API::Algorithm, public Geometry::Quat
class DLLExport DiffractionEventReadDetCal: public API::Algorithm, public Kernel::Quat
{
public:
/// Default constructor
......
......@@ -42,9 +42,9 @@ namespace Mantid
private:
/// coordinates of the sample
Geometry::V3D m_samplePos;
Kernel::V3D m_samplePos;
/// the displacement from the source to the sample
Geometry::V3D m_beamLine;
Kernel::V3D m_beamLine;
/// twice the distance from the source to the sample
double m_beamLineNorm;
......@@ -53,11 +53,11 @@ namespace Mantid
/// the drop is proportional to the wavelength squared, storing this drop increases calculation speed a lot
double m_dropPerAngstrom2;
/// the location that the neutron would have been detected at if it continued in a straight line, without gravity
mutable Geometry::V3D m_cachedLineOfSight;
mutable Kernel::V3D m_cachedLineOfSight;
/// the drop that was last caclulated, this allows m_cachedDetLoc to be recalculated each time without its original value being stored
mutable double m_cachedDrop;
const Geometry::V3D & getDetLoc(const double wav) const;
const Kernel::V3D & getDetLoc(const double wav) const;
/** Calculates the drop very much faster than running the workspace's gravitationalDrop function assuming
* the drop is proportional to the wavelength squared
* @param wav :: the wave length in Angstrom
......
......@@ -2,7 +2,7 @@
#define MANTID_ALGORITHM_HE3TUBEEFFICIENCY_H_
#include "MantidAPI/Algorithm.h"
#include "MantidGeometry/V3D.h"
#include "MantidKernel/V3D.h"
#include <map>
#include <vector>
......@@ -75,9 +75,9 @@ private:
void correctForEfficiency(int spectraIndex);
/// Sets the detector geometry cache if necessary
void getDetectorGeometry(boost::shared_ptr<Geometry::IDetector> det,
double & detRadius, Geometry::V3D & detAxis);
double & detRadius, Kernel::V3D & detAxis);
/// Computes the distance to the given shape from a starting point
double distToSurface(const Geometry::V3D start,
double distToSurface(const Kernel::V3D start,
const Geometry::Object *shape) const;
/// Calculate the detector efficiency
double detectorEfficiency(const double alpha,
......@@ -95,9 +95,9 @@ private:
/// Map that stores additional properties for detectors
const Geometry::ParameterMap *paraMap;
/// A lookup of previously seen shape objects used to save calculation time as most detectors have the same shape
std::map<const Geometry::Object *, std::pair<double, Geometry::V3D> > shapeCache;
std::map<const Geometry::Object *, std::pair<double, Kernel::V3D> > shapeCache;
/// Sample position
Geometry::V3D samplePos;
Kernel::V3D samplePos;
/// The spectra numbers that were skipped
std::vector<int> spectraSkipped;
/// Algorithm progress keeper
......
......@@ -72,13 +72,13 @@ namespace Mantid
const double lambda, double & attenFactor, double & error);
/// Randomly select the location initial point within the beam from a square
/// distribution
Geometry::V3D sampleBeamProfile() const;
Kernel::V3D sampleBeamProfile() const;
/// Select a random location within the sample + container environment
Geometry::V3D selectScatterPoint() const;
Kernel::V3D selectScatterPoint() const;
/// Calculate the attenuation factor for the given single scatter setup
double attenuationFactor(const Geometry::V3D & startPos,
const Geometry::V3D & scatterPoint,
const Geometry::V3D & finalPos, const double lambda);
double attenuationFactor(const Kernel::V3D & startPos,
const Kernel::V3D & scatterPoint,
const Kernel::V3D & finalPos, const double lambda);
/// Calculate the attenuation for a given length, material and wavelength
double attenuation(const double length, const Geometry::Material& material,
const double lambda) const;
......@@ -108,9 +108,9 @@ namespace Mantid
/** @name Cached values */
//@{
/// The sample position
Geometry::V3D m_samplePos;
Kernel::V3D m_samplePos;
/// The source position
Geometry::V3D m_sourcePos;
Kernel::V3D m_sourcePos;
/// Bounding box length
double m_bbox_length;
/// Half the bounding box length
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment