Learn R Programming

volesti (version 1.1.2-9)

gen_rand_hpoly: Generator function for random H-polytopes

Description

This function generates a \(d\)-dimensional polytope in H-representation with \(m\) facets. We pick \(m\) random hyperplanes tangent on the \(d\)-dimensional unit hypersphere as facets.

Usage

gen_rand_hpoly(dimension, nfacets, generator = list(constants = "sphere"))

Value

A polytope class representing a H-polytope.

Arguments

dimension

The dimension of the convex polytope.

nfacets

The number of the facets.

generator

A list that could contain two elements.

constants

To declare how to set the constants \(b_i\) for each facets: (i) 'sphere', each hyperplane is tangent to the hypersphere of radius 10, (ii) 'uniform' for each \(b_i\) the generator picks a uniform number from \((0,1)\). The defalut value is 'sphere'.

seed

Optional. A fixed seed for the number generator.

Examples

Run this code
# generate a 10-dimensional polytope with 50 facets
P = gen_rand_hpoly(10, 50)

Run the code above in your browser using DataLab