Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organized R Package from Volesti v1.1.2-6 #1

Merged
merged 10 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "volesti_cran_include"]
path = src/include
url = https://github.com/GeomScale/volesti.git
Soumya624 marked this conversation as resolved.
Show resolved Hide resolved
branch = cran_include
24 changes: 24 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Package: volesti
Type: Package
License: LGPL-3
Title: Volume Approximation and Sampling of Convex Polytopes
Author: Vissarion Fisikopoulos <[email protected]> [aut, cph, cre],
Apostolos Chalkis <[email protected]> [cph, aut],
contributors in file inst/AUTHORS
Copyright: file inst/COPYRIGHTS
Description: Provides an R interface for 'volesti' C++ package. 'volesti' computes estimations of volume
of polytopes given by (i) a set of points, (ii) linear inequalities or (iii) Minkowski sum of segments
(a.k.a. zonotopes). There are three algorithms for volume estimation as well as algorithms
for sampling, rounding and rotating polytopes. Moreover, 'volesti' provides algorithms for
estimating copulas useful in computational finance. Methods implemented in 'volesti' are described
in A. Chalkis and V. Fisikopoulos (2022) <doi:10.32614/RJ-2021-077> and references therein.
Version: 1.1.2-6
Date: 2023-04-11
Maintainer: Vissarion Fisikopoulos <[email protected]>
Depends: Rcpp (>= 0.12.17)
Imports: methods, stats
LinkingTo: Rcpp, RcppEigen, BH
Suggests: testthat
Encoding: UTF-8
RoxygenNote: 7.1.1
BugReports: https://github.com/GeomScale/volesti/issues
35 changes: 35 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Generated by roxygen2: do not edit by hand

export(compute_indicators)
export(copula)
export(direct_sampling)
export(exact_vol)
export(frustum_of_simplex)
export(gen_cross)
export(gen_cube)
export(gen_prod_simplex)
export(gen_rand_hpoly)
export(gen_rand_vpoly)
export(gen_rand_zonotope)
export(gen_simplex)
export(gen_skinny_cube)
export(inner_ball)
export(read_sdpa_format_file)
export(rotate_polytope)
export(round_polytope)
export(sample_points)
export(volume)
export(write_sdpa_format_file)
export(zonotope_approximation)
exportClasses(Hpolytope)
exportClasses(Spectrahedron)
exportClasses(Vpolytope)
exportClasses(VpolytopeIntersection)
exportClasses(Zonotope)
exportPattern("^[[:alpha:]]+")
importFrom("methods","new")
importFrom("stats","cov")
importFrom("utils","read.csv")
importFrom(Rcpp,evalCpp)
importFrom(Rcpp,loadModule)
useDynLib(volesti, .registration=TRUE)
52 changes: 52 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# volesti 1.0.0

* This is the first release of volesti R-Package.

# volesti 1.0.1

* Fix some bugs for solaris os.

# volesti 1.0.2

* Remove r-striper to avoid CRAN policy violation.

# volesti 1.0.3

* Fix CRAN warnings.

# volesti 1.1.0

* New volume computation algorithm.
* Billiard walk for uniform sampling.
* Modified exact volume computation function.
* Implementation and evaluation of PCA method for zonotope approximation.
* Boundary sampling.
* Improved functionality for finance applications.
* Improved names for functions and input variables.
* Use exclusively Eigen/BH library for linear algebra.

# volesti 1.1.1

* Fix CRAN warnings about deprecated use of ftime

# volesti 1.1.2

- Improve functionality of R function.
- Use lower case and "_" separated names for the volesti's functions.
- Use R classes for the convex polytopes

# volesti 1.1.2-2

- Remove `loadSdpaFormatFile()` and `readSdpaFormatFile()` functions.

# volesti 1.1.2-3

- Remove unneeded-internal-declaration warning in clang-15

# volesti 1.1.2-4

- Remove uninitialized warning in clang-16 (lp_presolve)

# volesti 1.1.2-6

- Fix UBSAN issues (lp_presolve)
42 changes: 42 additions & 0 deletions R/HpolytopeClass.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#' An R class to represent an H-polytope
#'
#' An H-polytope is a convex polytope defined by a set of linear inequalities or equivalently a \eqn{d}-dimensional H-polytope with \eqn{m} facets is defined by a \eqn{m\times d} matrix A and a \eqn{m}-dimensional vector b, s.t.: \eqn{Ax\leq b}.
#'
#' \describe{
#' \item{A}{An \eqn{m\times d} numerical matrix.}
#'
#' \item{b}{An \eqn{m}-dimensional vector b.}
#'
#' \item{volume}{The volume of the polytope if it is known, \eqn{NaN} otherwise by default.}
#'
#' \item{type}{A character with default value 'Hpolytope', to declare the representation of the polytope.}
#' }
#'
#' @examples
#' A = matrix(c(-1,0,0,-1,1,1), ncol=2, nrow=3, byrow=TRUE)
#' b = c(0,0,1)
#' P = Hpolytope(A = A, b = b)
#'
#' @name Hpolytope-class
#' @rdname Hpolytope-class
#' @exportClass Hpolytope
Hpolytope <- setClass (
# Class name
"Hpolytope",

# Defining slot type
representation (
A = "matrix",
b = "numeric",
volume = "numeric",
type = "character"
),

# Initializing slots
prototype = list(
A = as.matrix(0),
b = as.numeric(NULL),
volume = as.numeric(NaN),
type = "Hpolytope"
)
)
Loading