- Install package-dependencies:
Rcpp
,RcppEigen
,BH
,lpSolveAPI
.
- Then use devtools package to install
volesti
Rcpp package. In folder /root/R-proj Run:
Rcpp::compileAttributes()
library(devtools)
devtools::build()
devtools::install()
library(volesti)
- You can use Rstudio as well to open
volesti.Rproj
and then clickbuild source Package
and thenInstall and Restart
inBuild
at the menu bar.
To generate the CRAN version of the R package follow the instructions below:
- From the command line navigate to folder
/cran_gen
. Then Run:
source('genCRANpkg.R')
- Open genCRANpkg.R script with
Rstudio
and run it.
- The main function is
volume()
. It can be used to approximate the volume of a convex polytope given as a set of linear inequalities or a set of vertices (d-dimensional points) or as a Minkowski sum of segments (zonotope). There are two algorithms that can be used. The first isSequenceOfBalls
and the second isCoolingGaussian
(see References). - The function
sample_points()
can be used to sample points from a convex polytope with uniform or spherical gaussian target distribution. - The function
round_polytope()
can be used to round a convex polytope. - The function
rand_rotate()
can be used to apply a random rotation to a convex polytope.
For more details you can read the documentation in folder /inst/doc
.
- Install volesti library.
- In
R
mode (or in Rstudio) Run
pack = "volesti"
path = find.package(pack)
system(paste(shQuote(file.path(R.home("bin"), "R")),
"CMD", "Rd2pdf", shQuote(path)))
- The pdf will be created and saved in R-proj folder.
- We give such a documentation in /R-proj/doc folder.