gen_rand_vpoly: Generator function for random V-polytopes

Description Usage Arguments Value Examples

View source: R/gen_rand_vpoly.R

Description

This function generates a d-dimensional polytope in V-representation with m vertices. We pick m random points from the boundary of the d-dimensional unit hypersphere as vertices.

Usage

1
gen_rand_vpoly(dimension, nvertices, generator = list(body = "sphere"))

Arguments

dimension

The dimension of the convex polytope.

nvertices

The number of the vertices.

generator

A list that could contain two elements.

  • body the body that the generator samples uniformly the vertices from: (i) 'cube' or (ii) 'sphere', the default value is 'sphere'.

  • seed Optional. A fixed seed for the number generator.

Value

A polytope class representing a V-polytope.

Examples

1
2
# generate a 10-dimensional polytope defined as the convex hull of 25 random vertices
P = gen_rand_vpoly(10, 25)

Example output

Loading required package: Rcpp

volesti documentation built on July 14, 2021, 5:11 p.m.