is.inCH
returns TRUE
if and only if
p
is contained in the convex hull of the points given as
the rows of M
.is.inCH(p, M)
M
is a
$d$-dimensional vector.p
is in the closed convex hull of the points
in M
.Rglpk
to solve a constrained
linear optimization problem in order to determine an answer.
The question of whether p
is in a closed convex set S
may be formulated as the question of whether there exists a separating
hyperplane between p
and S
, which may in turn be formulated
as the question of whether the maximum possible value of a linear function,
subject to constraints, has a strictly positive solution.
Note that the answer given could be incorrect simply due to rounding error if the
true maximum is close to zero. For this reason, the
package rcdd
, which produces exact rational-number
solutions to linear programs, could be used instead of Rglpk
.
However, this approach would require more computing and would therefore
be slower.