You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix review comments on R package
* update R interface in volume and sample_points
* update Rcpp modules and S4 classes
* replace modules with R classes
* update R documentation
* fix R tests
* fix R bugs
* add hpoly new generator, fix bugs in rounding with biw
* update the Rd files
* fix c++ tests and a bug in volume.coo
* fix c++ test
* update polytope random generators in R, update rd files
* fix bugs in R interface
* seperate sdp functions
#' 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}.
4
+
#'
5
+
#' \describe{
6
+
#' \item{A}{An \eqn{m\times d} numerical matrix.}
7
+
#'
8
+
#' \item{b}{An \eqn{m}-dimensional vector b.}
9
+
#'
10
+
#' \item{volume}{The volume of the polytope if it is known, \eqn{NaN} otherwise by default.}
11
+
#'
12
+
#' \item{type}{A character with default value 'Hpolytope', to declare the representation of the polytope.}
13
+
#' }
14
+
#'
15
+
#' @examples
16
+
#' A = matrix(c(-1,0,0,-1,1,1), ncol=2, nrow=3, byrow=TRUE)
#' \item{\code{type} }{ A string that declares the type of the body for the exact sampling: a) \code{'unit_simplex'} for the unit simplex, b) \code{'canonical_simplex'} for the canonical simplex, c) \code{'hypersphere'} for the boundary of a hypersphere centered at the origin, d) \code{'ball'} for the interior of a hypersphere centered at the origin.}
47
47
#' \item{\code{dimension} }{ An integer that declares the dimension when exact sampling is enabled for a simplex or a hypersphere.}
48
48
#' \item{\code{radius} }{ The radius of the \eqn{d}-dimensional hypersphere. The default value is \eqn{1}.}
49
+
#' \item{\code{seed} }{ A fixed seed for the number generator.}
49
50
#' }
50
51
#' @param n The number of points that the function is going to sample.
51
-
#' @param seed Optional. A fixed seed for the number generator.
52
52
#'
53
53
#' @references \cite{R.Y. Rubinstein and B. Melamed,
54
54
#' \dQuote{Modern simulation and modeling} \emph{ Wiley Series in Probability and Statistics,} 1998.}
#' Compute the exact volume of (a) a zonotope (b) an arbitrary simplex in V-representation or (c) if the volume is known and declared by the input object.
#' Internal rcpp function for the rounding of a convex polytope
175
190
#'
176
191
#' @param P A convex polytope (H- or V-representation or zonotope).
192
+
#' @param settings A list to set the random walk and its walk length
177
193
#' @param seed Optional. A fixed seed for the number generator.
178
194
#'
179
195
#' @keywords internal
180
196
#'
181
197
#' @return A numerical matrix that describes the rounded polytope, a numerical matrix of the inverse linear transofmation that is applied on the input polytope, the numerical vector the the input polytope is shifted and the determinant of the matrix of the linear transformation that is applied on the input polytope.
182
-
rounding<-function(P, seed=NULL) {
183
-
.Call(`_volesti_rounding`, P, seed)
198
+
rounding<-function(P, settings=NULL, seed=NULL) {
199
+
.Call(`_volesti_rounding`, P, settings, seed)
184
200
}
185
201
186
202
#' Sample uniformly or normally distributed points from a convex Polytope (H-polytope, V-polytope, zonotope or intersection of two V-polytopes).
#' @param random_walk Optional. A list that declares the random walk and some related parameters as follows:
193
209
#' \itemize{
194
210
#' \item{\code{walk} }{ A string to declare the random walk: i) \code{'CDHR'} for Coordinate Directions Hit-and-Run, ii) \code{'RDHR'} for Random Directions Hit-and-Run, iii) \code{'BaW'} for Ball Walk, iv) \code{'BiW'} for Billiard walk, v) \code{'BCDHR'} boundary sampling by keeping the extreme points of CDHR or vi) \code{'BRDHR'} boundary sampling by keeping the extreme points of RDHR. The default walk is \code{'BiW'} for the uniform distribution or \code{'CDHR'} for the Gaussian distribution.}
195
-
#' \item{\code{walk_length} }{ The number of the steps per generated point for the random walk. The default value is \eqn{5} for \code{'BiW'} and \eqn{\lfloor 10 + d/10\rfloor} otherwise.}
211
+
#' \item{\code{walk_length} }{ The number of the steps per generated point for the random walk. The default value is 1.}
196
212
#' \item{\code{nburns} }{ The number of points to burn before start sampling.}
197
213
#' \item{\code{starting_point} }{ A \eqn{d}-dimensional numerical vector that declares a starting point in the interior of the polytope for the random walk. The default choice is the center of the ball as that one computed by the function \code{inner_ball()}.}
198
214
#' \item{\code{BaW_rad} }{ The radius for the ball walk.}
199
215
#' \item{\code{L} }{ The maximum length of the billiard trajectory.}
216
+
#' \item{\code{seed} }{ A fixed seed for the number generator.}
200
217
#' }
201
218
#' @param distribution Optional. A list that declares the target density and some related parameters as follows:
202
219
#' \itemize{
203
220
#' \item{\code{density} }{ A string: (a) \code{'uniform'} for the uniform distribution or b) \code{'gaussian'} for the multidimensional spherical distribution. The default target distribution is uniform.}
204
221
#' \item{\code{variance} }{ The variance of the multidimensional spherical gaussian. The default value is 1.}
205
222
#' \item{\code{mode} }{ A \eqn{d}-dimensional numerical vector that declares the mode of the Gaussian distribution. The default choice is the center of the as that one computed by the function \code{inner_ball()}.}
206
223
#' }
207
-
#' @param seed Optional. A fixed seed for the number generator.
208
224
#'
209
225
#' @return A \eqn{d\times n} matrix that contains, column-wise, the sampled points from the convex polytope P.
#' @param P A convex polytope. It is an object from class a) Hpolytope or b) Vpolytope or c) Zonotope or d) VpolytopeIntersection.
271
251
#' @param settings Optional. A list that declares which algorithm, random walk and values of parameters to use, as follows:
272
252
#' \itemize{
273
-
#' \item{\code{algorithm} }{ A string to set the algorithm to use: a) \code{'CB'} for CB algorithm, b) \code{'SoB'} for SOB algorithm or b) \code{'CG'} for CG algorithm. The defalut algorithm for H-polytopes is \code{'CB'} when \eqn{d\leq 200} and \code{'CG'} when \eqn{d>200}. For the other representations the default algorithm is \code{'CB'}.}
253
+
#' \item{\code{algorithm} }{ A string to set the algorithm to use: a) \code{'CB'} for CB algorithm, b) \code{'SoB'} for SOB algorithm or b) \code{'CG'} for CG algorithm. The defalut algorithm is \code{'CB'}.}
274
254
#' \item{\code{error} }{ A numeric value to set the upper bound for the approximation error. The default value is \eqn{1} for SOB algorithm and \eqn{0.1} otherwise.}
275
255
#' \item{\code{random_walk} }{ A string that declares the random walk method: a) \code{'CDHR'} for Coordinate Directions Hit-and-Run, b) \code{'RDHR'} for Random Directions Hit-and-Run, c) \code{'BaW'} for Ball Walk, or \code{'BiW'} for Billiard walk. For CB and SOB algorithms the default walk is \code{'CDHR'} for H-polytopes and \code{'BiW'} for the other representations. For CG algorithm the default walk is \code{'CDHR'} for H-polytopes and \code{'RDHR'} for the other representations.}
276
256
#' \item{\code{walk_length} }{ An integer to set the number of the steps for the random walk. The default value is \eqn{\lfloor 10 + d/10\rfloor} for \code{'SOB'} and \eqn{1} otherwise.}
277
257
#' \item{\code{win_len} }{ The length of the sliding window for CB or CG algorithm. The default value is \eqn{400+3d^2} for CB or \eqn{500+4d^2} for CG.}
278
258
#' \item{\code{hpoly} }{ A boolean parameter to use H-polytopes in MMC of CB algorithm when the input polytope is a zonotope. The default value is \code{TRUE} when the order of the zonotope is \eqn{<5}, otherwise it is \code{FALSE}.}
259
+
#' \item{\code{seed} }{ A fixed seed for the number generator.}
279
260
#' }
280
-
#' @param rounding Optional. A boolean parameter for rounding. The default value is \code{TRUE} for V-polytopes and \code{FALSE} otherwise.
281
-
#' @param seed Optional. A fixed seed for the number generator.
261
+
#' @param rounding A boolean parameter for rounding. The default value is \code{FALSE}.
282
262
#'
283
263
#' @references \cite{I.Z.Emiris and V. Fisikopoulos,
0 commit comments