10#include <gsl/gsl_linalg.h>
24MDPlane::MDPlane(
const std::vector<coord_t> &normal,
const std::vector<coord_t> &point) {
27 throw std::invalid_argument(
"MDPlane::ctor(): Invalid number of dimensions in the normal vector !");
28 if (point.size() != normal.size())
29 throw std::invalid_argument(
"MDPlane::ctor(): Inconsistent number of "
30 "dimensions in the normal/point vectors!");
44 throw std::invalid_argument(
"MDPlane::ctor(): Invalid number of dimensions in the normal vector !");
46 throw std::invalid_argument(
"MDPlane::ctor(): Inconsistent number of "
47 "dimensions in the normal/point vectors!");
61 throw std::invalid_argument(
"MDPlane::ctor(): Invalid number of dimensions in the workspace!");
73MDPlane::MDPlane(
const size_t nd,
const double *normal,
const double *point) : m_nd(nd) {
75 throw std::invalid_argument(
"MDPlane::ctor(): Invalid number of dimensions in the workspace!");
104 normal[
d] = -1.0f * normal[
d];
229 for (
size_t d = 0;
d <
m_nd;
d++)
246 for (
size_t d = 0;
d <
m_nd;
d++)
A generalized description of a N-dimensional hyperplane.
MDPlane(const Mantid::Kernel::VMD &normal, const Mantid::Kernel::VMD &point)
Constructor with normal and point.
coord_t m_inequality
Right-hand side of the linear equation. aka b in : a1*x1 + a2*x2 + ... < b.
void construct(IterableType normal, IterableType point)
Templated method for constructing the MDPlane.
size_t m_nd
Number of dimensions in the MDEventWorkspace.
bool isPointBounded(const coord_t *coords) const
Is a point in MDimensions bounded by this hyperplane, that is, is (a1*x1 + a2*x2 + ....
coord_t * m_normal
Coefficients to multiply each coordinate, sized m_nd.
MDPlane & operator=(const MDPlane &other)
Assignment operator.
size_t getNumDims() const
static VMDBase getNormalVector(const std::vector< VMDBase > &vectors)
Given N-1 vectors defining a N-1 dimensional hyperplane in N dimensions, returns a vector that is nor...
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...