Learn R Programming

volesti (version 1.0.0)

exact_vol: Compute the exact volume of (a) a zonotope (b) an arbitrary simplex (c) a unit simplex (d) a cross polytope (e) a hypercube

Description

Given a zonotope (as an object of class Zonotope), this function computes the sum of the absolute values of the determinants of all the \(d \times d\) submatrices of the \(m\times d\) matrix \(G\) that contains row-wise the \(m\) \(d\)-dimensional segments that define the zonotope. For an arbitrary simplex that is given in V-representation this function computes the absolute value of the determinant formed by the simplex's points assuming it is shifted to the origin. For a \(d\)-dimensional unit simplex, hypercube or cross polytope this function computes the exact well known formulas.

Usage

exact_vol(P = NULL, body = NULL, Parameters = NULL)

Arguments

P

A zonotope or a simplex in V-representation.

body

A string that declares the type of the body for the exact sampling: a) 'simplex' for the unit simplex, b) 'cross' for the cross polytope, c) 'hypersphere' for the hypersphere, d) 'cube' for the unit cube.

Parameters

A list for the parameters of the methods:

  • dimension An integer that declares the dimension when exact sampling is enabled for a simplex or a hypersphere.

  • radius The radius of the \(d\)-dimensional hypersphere. Default value is \(1\).

Value

The exact volume of the zonotope

Examples

Run this code
# NOT RUN {
# compute the exact volume of a 5-dimensional zonotope defined by the Minkowski sum of 10 segments
Z = GenZonotope(5, 10)
vol = exact_vol(Z)

# }
# NOT RUN {
# compute the exact volume of a 2-d arbitrary simplex
V = matrix(c(2,3,-1,7,0,0),ncol = 2, nrow = 3, byrow = TRUE)
P = Vpolytope$new(V)
vol = exact_vol(P)
# }
# NOT RUN {
# compute the exact volume the 10-dimensional cross polytope
vol = exact_vol(body = "cross", Parameters = list("dimension" = 10))
# }

Run the code above in your browser using DataLab