% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/round_polytope.R
\name{round_polytope}
\alias{round_polytope}
\title{Apply rounding to a convex polytope (H-polytope, V-polytope or a zonotope)}
\usage{
round_polytope(P, seed = NULL)
}
\arguments{
\item{P}{A convex polytope. It is an object from class (a) Hpolytope or (b) Vpolytope or (c) Zonotope.}

\item{seed}{Optional. A fixed seed for the number generator.}
}
\value{
A list with 4 elements: (a) a polytope of the same class as the input polytope class and (b) the element "T" which is the matrix of the inverse linear transformation that is applied on the input polytope, (c)  the element "shift" which is the opposite vector of that which has shifted the input polytope, (d) the element "round_value" which is the determinant of the square matrix of the linear transformation that is applied on the input polytope.
}
\description{
Given a convex H or V polytope or a zonotope as input this function brings the polytope in rounded position based on minimum volume enclosing ellipsoid of a pointset.
}
\examples{
# rotate a H-polytope (2d unit simplex)
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)
listHpoly = round_polytope(P)

# rotate a V-polytope (3d unit cube) using Random Directions HnR with step equal to 50
P = gen_cube(3, 'V')
ListVpoly = round_polytope(P)

# round a 2-dimensional zonotope defined by 6 generators using ball walk
Z = gen_rand_zonotope(2,6)
ListZono = round_polytope(Z)
}
\references{
\cite{I.Z.Emiris and V. Fisikopoulos,
\dQuote{Practical polytope volume approximation,} \emph{ACM Trans. Math. Soft.,} 2018.},

\cite{Michael J. Todd and E. Alper Yildirim,
\dQuote{On Khachiyan’s Algorithm for the Computation of Minimum Volume Enclosing Ellipsoids,} \emph{Discrete Applied Mathematics,} 2007.}
}
