# NOT RUN {
# uniform distribution from the 3d unit cube in V-representation using ball walk
P = GenCube(3, 'V')
points = sample_points(P, WalkType = "BW", walk_step = 5)
# gaussian distribution from the 2d unit simplex in H-representation with variance = 2
A = matrix(c(-1,0,0,-1,1,1), ncol=2, nrow=3, byrow=TRUE)
b = c(0,0,1)
P = Hpolytope$new(A,b)
points = sample_points(P, distribution = "gaussian", Parameters = list("variance" = 2))
# uniform points from the boundary of a 10-dimensional hypersphere
points = sample_points(exact = TRUE, body = "hypersphere", Parameters = list("dimension" = 10))
# 10000 uniform points from a 2-d arbitrary simplex
V = matrix(c(2,3,-1,7,0,0),ncol = 2, nrow = 3, byrow = TRUE)
P = Vpolytope$new(V)
points = sample_points(P, N = 10000, exact = TRUE)
# }
Run the code above in your browser using DataLab