11#include <gsl/gsl_linalg.h>
25MDPlane::MDPlane(
const std::vector<coord_t> &normal,
const std::vector<coord_t> &point) {
28 throw std::invalid_argument(
"MDPlane::ctor(): Invalid number of dimensions in the normal vector !");
29 if (point.size() != normal.size())
30 throw std::invalid_argument(
"MDPlane::ctor(): Inconsistent number of "
31 "dimensions in the normal/point vectors!");
45 throw std::invalid_argument(
"MDPlane::ctor(): Invalid number of dimensions in the normal vector !");
47 throw std::invalid_argument(
"MDPlane::ctor(): Inconsistent number of "
48 "dimensions in the normal/point vectors!");
62 throw std::invalid_argument(
"MDPlane::ctor(): Invalid number of dimensions in the workspace!");
74MDPlane::MDPlane(
const size_t nd,
const double *normal,
const double *point) : m_nd(nd) {
76 throw std::invalid_argument(
"MDPlane::ctor(): Invalid number of dimensions in the workspace!");
105 normal[
d] = -1.0f * normal[
d];
230 for (
size_t d = 0;
d <
m_nd;
d++)
247 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,...