powered by
This function generates the \(d\)-dimensional unit hypercube \([-1,1]^d\) in H- or V-representation.
gen_cube(dimension, representation = "H")
A polytope class representing the unit \(d\)-dimensional hypercube in H- or V-representation.
The dimension of the hypercube
A string to declare the representation. It has to be 'H' for H-representation or 'V' for V-representation. Default valus is 'H'.
'H'
'V'
# generate a 10-dimensional hypercube in H-representation P = gen_cube(10, 'H') # generate a 15-dimension hypercube in V-representation P = gen_cube(5, 'V')
Run the code above in your browser using DataLab