createSeedPoint {hitandrun}R Documentation

Generate a seed point

Description

Generate a seed point inside a polytope given by a set of linear constraints.

Usage

createSeedPoint(constr, homogeneous=FALSE, randomize=FALSE, method="slacklp")

Arguments

constr

Constraint definition

homogeneous

Whether constr is given in homogeneous coordinate representation

randomize

If TRUE, randomize the starting point

method

How to obtain the starting point: "slacklp" for a linear program that maximizes the minimum slack, or "vertices" for a weighted average of the vertices of the polytope

Details

See har for a description of the constraint definition and the homogeneous coordinate representation.

Value

A coordinate vector in the appropriate coordinate system.

Author(s)

Gert van Valkenhoef

See Also

har

findExtremePoints findVertices

Examples

# constraints: x_1 >= 0, x_2 >= 0, x_1 + x_2 <= 1
A <- rbind(c(-1, 0), c(0, -1), c(1, 1))
b <- c(0, 0, 1)
d <- c("<=", "<=", "<=")
constr <- list(constr=A, rhs=b, dir=d)

x0 <- createSeedPoint(constr)
stopifnot(x0 >= 0)
stopifnot(sum(x0) <= 1)

[Package hitandrun version 0.5-6 Index]