From 31a35b0d7042e2a60d57bc12597a2d929f6c9a42 Mon Sep 17 00:00:00 2001 From: vfisikop Date: Wed, 9 Oct 2024 19:16:12 +0300 Subject: [PATCH 1/5] Fix issues in documentation --- DESCRIPTION | 2 +- R/RcppExports.R | 62 +++++++++---------- R/compute_indicators.R | 16 ++--- R/gen_rand_hpoly.R | 8 +-- R/gen_rand_vpoly.R | 8 +-- R/gen_rand_zonotope.R | 8 +-- R/rotate_polytope.R | 4 +- R/round_polytope.R | 6 +- R/zonotope_approximation.R | 12 ++-- man/compute_indicators.Rd | 14 ++--- man/direct_sampling.Rd | 8 +-- man/examples/data/samples_hnr_iAB_PLT_283.txt | 24 +++++++ man/gen_rand_hpoly.Rd | 6 +- man/gen_rand_vpoly.Rd | 6 +- man/gen_rand_zonotope.Rd | 6 +- man/rotate_polytope.Rd | 2 +- man/round_polytope.Rd | 6 +- man/sample_points.Rd | 36 +++++------ man/uniform_sample_correlation_matrices.Rd | 8 ++- man/volume.Rd | 16 ++--- man/zonotope_approximation.Rd | 12 ++-- src/direct_sampling.cpp | 8 +-- src/sample_points.cpp | 36 +++++------ src/volume.cpp | 16 ++--- 24 files changed, 179 insertions(+), 151 deletions(-) create mode 100644 man/examples/data/samples_hnr_iAB_PLT_283.txt diff --git a/DESCRIPTION b/DESCRIPTION index 453cd81e..4cf9add0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,5 +20,5 @@ Imports: methods, stats, Matrix LinkingTo: Rcpp, RcppEigen, BH Suggests: testthat Encoding: UTF-8 -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 BugReports: https://github.com/GeomScale/Rvolesti/issues diff --git a/R/RcppExports.R b/R/RcppExports.R index f6a02f5a..f15ee2f2 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -42,10 +42,10 @@ copula <- function(r1, r2 = NULL, sigma = NULL, m = NULL, n = NULL, seed = NULL) #' The \eqn{d}-dimensional unit simplex is the set of points \eqn{\vec{x}\in \R^d}, s.t.: \eqn{\sum_i x_i\leq 1}, \eqn{x_i\geq 0}. The \eqn{d}-dimensional canonical simplex is the set of points \eqn{\vec{x}\in \R^d}, s.t.: \eqn{\sum_i x_i = 1}, \eqn{x_i\geq 0}. #' #' @param body A list to request exact uniform sampling from special well known convex bodies through the following input parameters: -#' \itemize{ -#' \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.} -#' \item{\code{dimension} }{ An integer that declares the dimension when exact sampling is enabled for a simplex or a hypersphere.} -#' \item{\code{radius} }{ The radius of the \eqn{d}-dimensional hypersphere. The default value is \eqn{1}.} +#' \describe{ +#' \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.} +#' \item{\code{dimension}}{An integer that declares the dimension when exact sampling is enabled for a simplex or a hypersphere.} +#' \item{\code{radius}}{The radius of the \eqn{d}-dimensional hypersphere. The default value is \eqn{1}.} #' } #' @param n The number of points that the function is going to sample. #' @param seed Optional. A fixed seed for the number generator. @@ -286,8 +286,8 @@ rounding <- function(P, method = NULL, seed = NULL) { #' @param P A convex polytope. It is an object from class (a) Hpolytope or (b) Vpolytope or (c) Zonotope or (d) VpolytopeIntersection. #' @param n The number of points that the function is going to sample from the convex polytope. #' @param random_walk Optional. A list that declares the random walk and some related parameters as follows: -#' \itemize{ -#' \item{\code{walk} }{ A string to declare the random walk: i) \code{'CDHR'} for Coordinate Directions Hit-and-Run, +#' \describe{ +#' \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{'dikin'} for dikin walk, vi) \code{'vaidya'} for vaidya walk, vii) \code{'john'} for john walk, #' viii) \code{'BCDHR'} boundary sampling by keeping the extreme points of CDHR or ix) \code{'BRDHR'} boundary sampling by keeping the extreme points of RDHR, @@ -298,24 +298,24 @@ rounding <- function(P, method = NULL, seed = NULL) { #' The default walk is \code{'aBiW'} for the uniform distribution, \code{'CDHR'} for the Gaussian distribution and H-polytopes and #' \code{'BiW'} or \code{'RDHR'} for the same distributions and V-polytopes and zonotopes. \code{'NUTS'} is the default sampler for logconcave densities and \code{'CRHMC'} #' for logconcave densities with H-polytope and sparse constrainted problems.} -#' \item{\code{walk_length} }{ The number of the steps per generated point for the random walk. The default value is \eqn{1}.} -#' \item{\code{nburns} }{ The number of points to burn before start sampling. The default value is \eqn{1}.} -#' \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()}.} -#' \item{\code{BaW_rad} }{ The radius for the ball walk.} -#' \item{\code{L} }{ The maximum length of the billiard trajectory or the radius for the step of dikin, vaidya or john walk.} -#' \item{\code{solver} }{ Specify ODE solver for logconcave sampling. Options are i) leapfrog, ii) euler iii) runge-kutta iv) richardson} -#' \item{\code{step_size} }{ Optionally chosen step size for logconcave sampling. Defaults to a theoretical value if not provided.} +#' \item{\code{walk_length}}{The number of the steps per generated point for the random walk. The default value is \eqn{1}.} +#' \item{\code{nburns}}{The number of points to burn before start sampling. The default value is \eqn{1}.} +#' \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()}.} +#' \item{\code{BaW_rad}}{The radius for the ball walk.} +#' \item{\code{L}}{The maximum length of the billiard trajectory or the radius for the step of dikin, vaidya or john walk.} +#' \item{\code{solver}}{Specify ODE solver for logconcave sampling. Options are i) leapfrog, ii) euler iii) runge-kutta iv) richardson} +#' \item{\code{step_size}}{Optionally chosen step size for logconcave sampling. Defaults to a theoretical value if not provided.} #' } #' @param distribution Optional. A list that declares the target density and some related parameters as follows: -#' \itemize{ -#' \item{\code{density} }{ A string: (a) \code{'uniform'} for the uniform distribution or b) \code{'gaussian'} for the multidimensional spherical distribution c) \code{logconcave} with form proportional to exp(-f(x)) where f(x) is L-smooth and m-strongly-convex d) \code{'exponential'} for the exponential distribution. The default target distribution is the uniform distribution.} -#' \item{\code{variance} }{ The variance of the multidimensional spherical gaussian or the exponential distribution. The default value is 1.} -#' \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()}.} -#' \item{\code{bias} }{ The bias vector for the exponential distribution. The default vector is \eqn{c_1 = 1} and \eqn{c_i = 0} for \eqn{i \neq 1}.} -#' \item{\code{L_} }{ Smoothness constant (for logconcave). } -#' \item{\code{m} }{ Strong-convexity constant (for logconcave). } -#' \item{\code{negative_logprob} }{ Negative log-probability (for logconcave). } -#' \item{\code{negative_logprob_gradient} }{ Negative log-probability gradient (for logconcave). } +#' \describe{ +#' \item{\code{density}}{A string: (a) \code{'uniform'} for the uniform distribution or b) \code{'gaussian'} for the multidimensional spherical distribution c) \code{logconcave} with form proportional to exp(-f(x)) where f(x) is L-smooth and m-strongly-convex d) \code{'exponential'} for the exponential distribution. The default target distribution is the uniform distribution.} +#' \item{\code{variance}}{The variance of the multidimensional spherical gaussian or the exponential distribution. The default value is 1.} +#' \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()}.} +#' \item{\code{bias}}{The bias vector for the exponential distribution. The default vector is \eqn{c_1 = 1} and \eqn{c_i = 0} for \eqn{i \neq 1}.} +#' \item{\code{L_}}{Smoothness constant (for logconcave). } +#' \item{\code{m}}{Strong-convexity constant (for logconcave). } +#' \item{\code{negative_logprob}}{Negative log-probability (for logconcave). } +#' \item{\code{negative_logprob_gradient}}{Negative log-probability gradient (for logconcave). } #' } #' @param seed Optional. A fixed seed for the number generator. #' @@ -369,8 +369,6 @@ sample_points <- function(P, n, random_walk = NULL, distribution = NULL, seed = #' @param validate Optional. Whether to validate the sampled matrices. Default is false. #' #' @return A list of sampled correlation matrices. -NULL - uniform_sample_correlation_matrices <- function(n, num_matrices = 1000L, walk_length = 1L, nburns = 0L, validate = FALSE) { .Call(`_volesti_uniform_sample_correlation_matrices`, n, num_matrices, walk_length, nburns, validate) } @@ -381,14 +379,14 @@ uniform_sample_correlation_matrices <- function(n, num_matrices = 1000L, walk_le #' #' @param P A convex polytope. It is an object from class a) Hpolytope or b) Vpolytope or c) Zonotope or d) VpolytopeIntersection. #' @param settings Optional. A list that declares which algorithm, random walk and values of parameters to use, as follows: -#' \itemize{ -#' \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'}.} -#' \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.} -#' \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 algorithm the default walk is \code{'BiW'}. For CG and SOB algorithms the default walk is \code{'CDHR'} for H-polytopes and \code{'RDHR'} for the other representations.} -#' \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.} -#' \item{\code{win_len} }{ The length of the sliding window for CB or CG algorithm. The default value is \eqn{250} for CB with BiW and \eqn{400+3d^2} for CB and any other random walk and \eqn{500+4d^2} for CG.} -#' \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}.} -#' \item{\code{seed} }{ A fixed seed for the number generator.} +#' \describe{ +#' \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'}.} +#' \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.} +#' \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 algorithm the default walk is \code{'BiW'}. For CG and SOB algorithms the default walk is \code{'CDHR'} for H-polytopes and \code{'RDHR'} for the other representations.} +#' \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.} +#' \item{\code{win_len}}{The length of the sliding window for CB or CG algorithm. The default value is \eqn{250} for CB with BiW and \eqn{400+3d^2} for CB and any other random walk and \eqn{500+4d^2} for CG.} +#' \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}.} +#' \item{\code{seed}}{A fixed seed for the number generator.} #' } #' @param rounding Optional. A string parameter to request a rounding method to be applied in the input polytope before volume computation: a) \code{'min_ellipsoid'}, b) \code{'svd'}, c) \code{'max_ellipsoid'} and d) \code{'none'} for no rounding. #' diff --git a/R/compute_indicators.R b/R/compute_indicators.R index 695bb191..ad17934b 100644 --- a/R/compute_indicators.R +++ b/R/compute_indicators.R @@ -6,13 +6,13 @@ #' #' @param returns A \eqn{d}-dimensional vector that describes the direction of the first family of parallel hyperplanes. #' @param parameters A list to set a parameterization. -#' \itemize{ -#' \item{win_length }{ The length of the sliding window. The default value is 60.} -#' \item{m } { The number of slices for the copula. The default value is 100.} -#' \item{n }{ The number of points to sample. The default value is \eqn{5\cdot 10^5}.} -#' \item{nwarning }{ The number of consecutive indicators larger than 1 required to declare a warning period. The default value is 60.} -#' \item{ncrisis }{ The number of consecutive indicators larger than 1 required to declare a crisis period. The default value is 100.} -#' \item{seed }{ A fixed seed for the number generator.} +#' \describe{ +#' \item{win_length}{The length of the sliding window. The default value is 60.} +#' \item{m}{The number of slices for the copula. The default value is 100.} +#' \item{n}{The number of points to sample. The default value is \eqn{5\cdot 10^5}.} +#' \item{nwarning}{The number of consecutive indicators larger than 1 required to declare a warning period. The default value is 60.} +#' \item{ncrisis}{The number of consecutive indicators larger than 1 required to declare a crisis period. The default value is 100.} +#' \item{seed}{A fixed seed for the number generator.} #' } #' #' @references \cite{L. Cales, A. Chalkis, I.Z. Emiris, V. Fisikopoulos, @@ -130,4 +130,4 @@ compute_indicators <- function(returns, parameters = list("win_length" = 60, "m" return(list("indicators" = indicators, market_states = col)) -} \ No newline at end of file +} diff --git a/R/gen_rand_hpoly.R b/R/gen_rand_hpoly.R index a7208b82..2e341f8f 100644 --- a/R/gen_rand_hpoly.R +++ b/R/gen_rand_hpoly.R @@ -5,9 +5,9 @@ #' @param dimension The dimension of the convex polytope. #' @param nfacets The number of the facets. #' @param generator A list that could contain two elements. -#' \itemize{ -#' \item{constants }{ To declare how to set the constants \eqn{b_i} for each facets: (i) 'sphere', each hyperplane is tangent to the hypersphere of radius 10, (ii) 'uniform' for each \eqn{b_i} the generator picks a uniform number from \eqn{(0,1)}. The defalut value is 'sphere'.} -#' \item{seed }{ Optional. A fixed seed for the number generator.} +#' \describe{ +#' \item{constants}{To declare how to set the constants \eqn{b_i} for each facets: (i) 'sphere', each hyperplane is tangent to the hypersphere of radius 10, (ii) 'uniform' for each \eqn{b_i} the generator picks a uniform number from \eqn{(0,1)}. The defalut value is 'sphere'.} +#' \item{seed}{Optional. A fixed seed for the number generator.} #' } #' #' @return A polytope class representing a H-polytope. @@ -42,4 +42,4 @@ gen_rand_hpoly <- function(dimension, nfacets, generator = list('constants' = 's P = Hpolytope(A = Mat, b = b) return(P) -} \ No newline at end of file +} diff --git a/R/gen_rand_vpoly.R b/R/gen_rand_vpoly.R index e67f93aa..5e26d095 100644 --- a/R/gen_rand_vpoly.R +++ b/R/gen_rand_vpoly.R @@ -5,9 +5,9 @@ #' @param dimension The dimension of the convex polytope. #' @param nvertices The number of the vertices. #' @param generator A list that could contain two elements. -#' \itemize{ -#' \item{body }{ the body that the generator samples uniformly the vertices from: (i) 'cube' or (ii) 'sphere', the default value is 'sphere'.} -#' \item{seed }{ Optional. A fixed seed for the number generator.} +#' \describe{ +#' \item{body}{the body that the generator samples uniformly the vertices from: (i) 'cube' or (ii) 'sphere', the default value is 'sphere'.} +#' \item{seed}{Optional. A fixed seed for the number generator.} #' } #' #' @return A polytope class representing a V-polytope. @@ -41,4 +41,4 @@ gen_rand_vpoly <- function(dimension, nvertices, generator = list('body' = 'sphe P = Vpolytope(V = Mat) return(P) -} \ No newline at end of file +} diff --git a/R/gen_rand_zonotope.R b/R/gen_rand_zonotope.R index a7286dc8..8cc7b7c8 100644 --- a/R/gen_rand_zonotope.R +++ b/R/gen_rand_zonotope.R @@ -6,9 +6,9 @@ #' @param dimension The dimension of the zonotope. #' @param nsegments The number of segments that generate the zonotope. #' @param generator A list that could contain two elements. -#' \itemize{ -#' \item{distribution }{ the distribution to pick the length of each segment from \eqn{[0,100]}: (i) 'uniform', (ii) 'gaussian' or (iii) 'exponential', the default value is 'uniform.} -#' \item {seed }{ Optional. A fixed seed for the number generator.} +#' \describe{ +#' \item{distribution}{ the distribution to pick the length of each segment from \eqn{[0,100]}: (i) 'uniform', (ii) 'gaussian' or (iii) 'exponential', the default value is 'uniform.} +#' \item {seed}{Optional. A fixed seed for the number generator.} #' } #' #' @return A polytope class representing a zonotope. @@ -45,4 +45,4 @@ gen_rand_zonotope <- function(dimension, nsegments, generator = list('distributi P = Zonotope(G = Mat) return(P) -} \ No newline at end of file +} diff --git a/R/rotate_polytope.R b/R/rotate_polytope.R index b901ee14..4d43d2dc 100644 --- a/R/rotate_polytope.R +++ b/R/rotate_polytope.R @@ -8,7 +8,7 @@ #' @return A list that contains the rotated polytope and the matrix \eqn{T} of the linear transformation. #' #' @details Let \eqn{P} be the given polytope and \eqn{Q} the rotated one and \eqn{T} be the matrix of the linear transformation. -#' \itemize{ +#' \describe{ #' \item{If \eqn{P} is in H-representation and \eqn{A} is the matrix that contains the normal vectors of the facets of \eqn{Q} then \eqn{AT} contains the normal vactors of the facets of \eqn{P}.} #' \item{If \eqn{P} is in V-representation and \eqn{V} is the matrix that contains column-wise the vertices of \eqn{Q} then \eqn{T^TV} contains the vertices of \eqn{P}.} #' \item{If \eqn{P} is a zonotope and \eqn{G} is the matrix that contains column-wise the generators of \eqn{Q} then \eqn{T^TG} contains the generators of \eqn{P}.} @@ -72,4 +72,4 @@ rotate_polytope <- function(P, rotation = list()) { PP = Hpolytope(A = A, b = b) } return(list("P" = PP, "T" = Tr)) -} \ No newline at end of file +} diff --git a/R/round_polytope.R b/R/round_polytope.R index e50ab7b9..b0f41310 100644 --- a/R/round_polytope.R +++ b/R/round_polytope.R @@ -4,9 +4,9 @@ #' #' @param P A convex polytope. It is an object from class (a) Hpolytope or (b) Vpolytope or (c) Zonotope. #' @param settings Optional. A list of settings. -#' \itemize{ -#' \item{\code{method} }{ The method to use for rounding, a) \code{'min_ellipsoid'} for the method based on mimimmum volume enclosing ellipsoid of a dataset, b) \code{'max_ellipsoid'} for the method based on maximum volume enclosed ellipsoid, (c) \code{'isotropy'} for the method based on svd decomposition. The default method is \code{'mee'} for all the representations.} -#' \item{\code{seed} }{ Optional. A fixed seed for the number generator.} +#' \describe{ +#' \item{\code{method}}{The method to use for rounding, a) \code{'min_ellipsoid'} for the method based on mimimmum volume enclosing ellipsoid of a dataset, b) \code{'max_ellipsoid'} for the method based on maximum volume enclosed ellipsoid, (c) \code{'isotropy'} for the method based on svd decomposition. The default method is \code{'mee'} for all the representations.} +#' \item{\code{seed}}{Optional. A fixed seed for the number generator.} #' } #' #' @return 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. diff --git a/R/zonotope_approximation.R b/R/zonotope_approximation.R index efbe73dc..bb17de2a 100644 --- a/R/zonotope_approximation.R +++ b/R/zonotope_approximation.R @@ -5,12 +5,12 @@ #' @param Z A zonotope. #' @param fit_ratio Optional. A boolean parameter to request the computation of the ratio of fitness. #' @param settings Optional. A list that declares the values of the parameters of CB algorithm as follows: -#' \itemize{ -#' \item{\code{error} }{ A numeric value to set the upper bound for the approximation error. The default value is \eqn{0.1}.} -#' \item{\code{walk_length} }{ An integer to set the number of the steps for the random walk. The default value is \eqn{1}.} -#' \item{\code{win_len} }{ The length of the sliding window for CB algorithm. The default value is \eqn{250}.} -#' \item{\code{hpoly} }{ A boolean parameter to use H-polytopes in MMC of CB algorithm. The default value is \code{TRUE} when the order of the zonotope is \eqn{<5}, otherwise it is \code{FALSE}.} -#' \item{\code{seed} }{ Optional. A fixed seed for the number generator.} +#' \describe{ +#' \item{\code{error}}{A numeric value to set the upper bound for the approximation error. The default value is \eqn{0.1}.} +#' \item{\code{walk_length}}{An integer to set the number of the steps for the random walk. The default value is \eqn{1}.} +#' \item{\code{win_len}}{The length of the sliding window for CB algorithm. The default value is \eqn{250}.} +#' \item{\code{hpoly}}{A boolean parameter to use H-polytopes in MMC of CB algorithm. The default value is \code{TRUE} when the order of the zonotope is \eqn{<5}, otherwise it is \code{FALSE}.} +#' \item{\code{seed}}{Optional. A fixed seed for the number generator.} #' } #' #' @return A list that contains the approximation body in H-representation and the ratio of fitness diff --git a/man/compute_indicators.Rd b/man/compute_indicators.Rd index d1d870a3..3c49f628 100644 --- a/man/compute_indicators.Rd +++ b/man/compute_indicators.Rd @@ -13,13 +13,13 @@ compute_indicators( \item{returns}{A \eqn{d}-dimensional vector that describes the direction of the first family of parallel hyperplanes.} \item{parameters}{A list to set a parameterization. -\itemize{ -\item{win_length }{ The length of the sliding window. The default value is 60.} -\item{m } { The number of slices for the copula. The default value is 100.} -\item{n }{ The number of points to sample. The default value is \eqn{5\cdot 10^5}.} -\item{nwarning }{ The number of consecutive indicators larger than 1 required to declare a warning period. The default value is 60.} -\item{ncrisis }{ The number of consecutive indicators larger than 1 required to declare a crisis period. The default value is 100.} -\item{seed }{ A fixed seed for the number generator.} +\describe{ +\item{win_length}{The length of the sliding window. The default value is 60.} +\item{m}{The number of slices for the copula. The default value is 100.} +\item{n}{The number of points to sample. The default value is \eqn{5\cdot 10^5}.} +\item{nwarning}{The number of consecutive indicators larger than 1 required to declare a warning period. The default value is 60.} +\item{ncrisis}{The number of consecutive indicators larger than 1 required to declare a crisis period. The default value is 100.} +\item{seed}{A fixed seed for the number generator.} }} } \value{ diff --git a/man/direct_sampling.Rd b/man/direct_sampling.Rd index 4609ec03..651bd1b2 100644 --- a/man/direct_sampling.Rd +++ b/man/direct_sampling.Rd @@ -8,10 +8,10 @@ direct_sampling(body, n, seed = NULL) } \arguments{ \item{body}{A list to request exact uniform sampling from special well known convex bodies through the following input parameters: -\itemize{ -\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.} -\item{\code{dimension} }{ An integer that declares the dimension when exact sampling is enabled for a simplex or a hypersphere.} -\item{\code{radius} }{ The radius of the \eqn{d}-dimensional hypersphere. The default value is \eqn{1}.} +\describe{ +\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.} +\item{\code{dimension}}{An integer that declares the dimension when exact sampling is enabled for a simplex or a hypersphere.} +\item{\code{radius}}{The radius of the \eqn{d}-dimensional hypersphere. The default value is \eqn{1}.} }} \item{n}{The number of points that the function is going to sample.} diff --git a/man/examples/data/samples_hnr_iAB_PLT_283.txt b/man/examples/data/samples_hnr_iAB_PLT_283.txt new file mode 100644 index 00000000..24d9135f --- /dev/null +++ b/man/examples/data/samples_hnr_iAB_PLT_283.txt @@ -0,0 +1,24 @@ +0.709274847554254 0.729511212113178 0.731734036233084 0.620360375939722 0.812216953773121 1.02608840967631 1.0237072386332 1.06559520670481 1.06046267240673 1.0569107366028 +0.182458590163604 -1.22475305544388 -1.17991864317306 -1.54931282469509 -1.61332993217548 -1.16899251561493 -1.15790494649078 -1.11782425432642 -1.12345013847686 -1.24815617759047 +0.334952569865785 1.34191877332595 1.27542018073363 0.992203939964284 1.602540968935 1.72293623885981 1.7194350584508 1.72722507568062 1.73926107759051 1.49104800443228 +0.773213221910355 1.21226587485828 1.17633637233767 1.24759887433784 1.24436580787947 0.613634873973802 0.619697034411809 0.644442849330836 0.638227910980089 0.614397684738775 +0.157695644252477 0.831606332209536 0.954458747128303 0.989508242567989 1.14704062546877 1.41287080562772 1.41465788048072 1.44290525918881 1.44908104055765 1.24093808503528 +-0.367425327928371 -0.490367707301393 -0.463957653741365 -0.412939578856433 -0.902391662899056 -1.11708727591467 -1.15163879331297 -1.12667764291667 -1.12774719983015 -1.04487392800358 +0.0564686270975242 -1.25563086194898 -1.22863105565299 -0.905952167766709 -0.635682042684126 -0.53558293040138 -0.510438234383334 -0.565217927077057 -0.564930040423518 -0.581664648418136 +-0.735494064590128 -0.990064517542818 -0.998323913685218 -0.821887580699033 -1.13068766438107 -0.945388781776607 -0.894205526650601 -0.822509206703203 -0.829191520409706 -0.558732842206666 +-0.759925658924666 -0.41952036742748 -0.457034272643664 -0.170877332428069 -0.286119999946662 -0.728741938943018 -0.706395524617996 -0.797127215789833 -0.794901345447222 -0.899708384793263 +0.809469140891111 0.712130217672277 0.739151428417235 1.18349896089541 1.3525783833394 1.80909763897834 1.77296765031639 1.77079762465976 1.7559239770448 1.6644890778111 +-0.279615709530532 -0.266302125023344 -0.248245493495012 -0.44388462596507 -0.938997009822713 -0.993468196307325 -1.01069700900015 -1.04436172016827 -1.03909846055975 -1.11458055374889 +0.219472623448322 0.298810110047574 0.35129859357009 0.645279251226755 0.89920801384592 0.437560618858189 0.366370859422322 0.360622539837838 0.362957867761872 0.362219956248373 +-0.0148985572030955 -0.592852913865532 -0.614404392351401 -0.609833089114702 -0.306668617062261 -0.557400098010281 -0.63271275570383 -0.690618475748283 -0.691954865694763 -0.853134266161666 +0.0863309568734968 -0.0880846484048549 -0.027765513334851 -0.121707150882572 -0.463366385883972 -0.138656096267497 -0.143149938831324 -0.187498427918204 -0.182286542490003 -0.285829028533051 +-0.582458297908748 -0.189679344212307 -0.275096905546179 -0.192626520530463 0.193323536898355 0.0508059872701994 0.0122245501126896 -0.0334469268020255 -0.0334107269205647 -0.220400527864513 +1.42318898856866 0.200655849426707 0.314636323050785 0.267687799022788 -0.410989689245133 -0.439374078351942 -0.457440140861489 -0.436174232117179 -0.432929133576299 -0.533260881180364 +0.895087321298557 0.370471762515099 0.34437702150947 0.0563131542200889 -0.078783604634911 0.154584889737911 0.111261429835802 0.0864919550851604 0.079807686294863 0.0538434494752301 +-0.42590744853158 -0.56651595561796 -0.527411759223521 -0.219639745944364 0.0933228788025667 -0.158213177729318 -0.0870340523096058 -0.0920246250036002 -0.10015663815986 -0.0978387137210064 +-0.155730542414295 0.0973501030163719 0.139175599919397 -0.0522408775308351 -0.341753032438201 -0.892096035609375 -0.888679956539727 -0.784251721603529 -0.787456645391049 -0.612518068975644 +0.36868431702886 0.329469879746421 0.33960437111423 0.534663079598227 -0.0228859180572016 0.119725762619894 0.0981372690134744 0.077786727668905 0.0850485495417251 0.120705790869887 +-0.233191679175121 -0.38768288230674 -0.505205140283786 -0.751717934446944 -0.926260082100348 -0.985954047415842 -1.01051008334866 -1.07787435379064 -1.08803806831643 -1.00476974015937 +-0.90857673493985 -1.4453441431181 -1.42041286754979 -1.14025775541391 -0.669798284512113 -0.534908954892646 -0.515712131624817 -0.518130103899142 -0.518568326816425 -0.504688715780515 +-0.341626071116722 -0.365473002019297 -0.31031554476527 -0.00169159241192543 0.11871963220725 0.248666383826002 0.227886947062952 0.164517235101444 0.157732576089913 0.138117362166492 +-0.341706220313599 -0.280958829638682 -0.352734455991675 -0.766780612219087 -0.986787272954293 -1.14486301361652 -1.13522501732564 -1.10927497214959 -1.1142291841213 -1.16922530073274 diff --git a/man/gen_rand_hpoly.Rd b/man/gen_rand_hpoly.Rd index 85dd1757..537c0bba 100644 --- a/man/gen_rand_hpoly.Rd +++ b/man/gen_rand_hpoly.Rd @@ -12,9 +12,9 @@ gen_rand_hpoly(dimension, nfacets, generator = list(constants = "sphere")) \item{nfacets}{The number of the facets.} \item{generator}{A list that could contain two elements. -\itemize{ -\item{constants }{ To declare how to set the constants \eqn{b_i} for each facets: (i) 'sphere', each hyperplane is tangent to the hypersphere of radius 10, (ii) 'uniform' for each \eqn{b_i} the generator picks a uniform number from \eqn{(0,1)}. The defalut value is 'sphere'.} -\item{seed }{ Optional. A fixed seed for the number generator.} +\describe{ +\item{constants}{To declare how to set the constants \eqn{b_i} for each facets: (i) 'sphere', each hyperplane is tangent to the hypersphere of radius 10, (ii) 'uniform' for each \eqn{b_i} the generator picks a uniform number from \eqn{(0,1)}. The defalut value is 'sphere'.} +\item{seed}{Optional. A fixed seed for the number generator.} }} } \value{ diff --git a/man/gen_rand_vpoly.Rd b/man/gen_rand_vpoly.Rd index e34125a5..e6d3a014 100644 --- a/man/gen_rand_vpoly.Rd +++ b/man/gen_rand_vpoly.Rd @@ -12,9 +12,9 @@ gen_rand_vpoly(dimension, nvertices, generator = list(body = "sphere")) \item{nvertices}{The number of the vertices.} \item{generator}{A list that could contain two elements. -\itemize{ -\item{body }{ the body that the generator samples uniformly the vertices from: (i) 'cube' or (ii) 'sphere', the default value is 'sphere'.} -\item{seed }{ Optional. A fixed seed for the number generator.} +\describe{ +\item{body}{the body that the generator samples uniformly the vertices from: (i) 'cube' or (ii) 'sphere', the default value is 'sphere'.} +\item{seed}{Optional. A fixed seed for the number generator.} }} } \value{ diff --git a/man/gen_rand_zonotope.Rd b/man/gen_rand_zonotope.Rd index 41497ef2..b0ab01c3 100644 --- a/man/gen_rand_zonotope.Rd +++ b/man/gen_rand_zonotope.Rd @@ -16,9 +16,9 @@ gen_rand_zonotope( \item{nsegments}{The number of segments that generate the zonotope.} \item{generator}{A list that could contain two elements. -\itemize{ -\item{distribution }{ the distribution to pick the length of each segment from \eqn{[0,100]}: (i) 'uniform', (ii) 'gaussian' or (iii) 'exponential', the default value is 'uniform.} -\item {seed }{ Optional. A fixed seed for the number generator.} +\describe{ +\item{distribution}{ the distribution to pick the length of each segment from \eqn{[0,100]}: (i) 'uniform', (ii) 'gaussian' or (iii) 'exponential', the default value is 'uniform.} +\item {seed}{Optional. A fixed seed for the number generator.} }} } \value{ diff --git a/man/rotate_polytope.Rd b/man/rotate_polytope.Rd index 1368e515..bc7cef10 100644 --- a/man/rotate_polytope.Rd +++ b/man/rotate_polytope.Rd @@ -19,7 +19,7 @@ Given a convex H- or V- polytope or a zonotope or an intersection of two V-polyt } \details{ Let \eqn{P} be the given polytope and \eqn{Q} the rotated one and \eqn{T} be the matrix of the linear transformation. -\itemize{ +\describe{ \item{If \eqn{P} is in H-representation and \eqn{A} is the matrix that contains the normal vectors of the facets of \eqn{Q} then \eqn{AT} contains the normal vactors of the facets of \eqn{P}.} \item{If \eqn{P} is in V-representation and \eqn{V} is the matrix that contains column-wise the vertices of \eqn{Q} then \eqn{T^TV} contains the vertices of \eqn{P}.} \item{If \eqn{P} is a zonotope and \eqn{G} is the matrix that contains column-wise the generators of \eqn{Q} then \eqn{T^TG} contains the generators of \eqn{P}.} diff --git a/man/round_polytope.Rd b/man/round_polytope.Rd index 04b91bf3..74371774 100644 --- a/man/round_polytope.Rd +++ b/man/round_polytope.Rd @@ -10,9 +10,9 @@ round_polytope(P, settings = list()) \item{P}{A convex polytope. It is an object from class (a) Hpolytope or (b) Vpolytope or (c) Zonotope.} \item{settings}{Optional. A list of settings. -\itemize{ -\item{\code{method} }{ The method to use for rounding, a) \code{'min_ellipsoid'} for the method based on mimimmum volume enclosing ellipsoid of a dataset, b) \code{'max_ellipsoid'} for the method based on maximum volume enclosed ellipsoid, (c) \code{'isotropy'} for the method based on svd decomposition. The default method is \code{'mee'} for all the representations.} -\item{\code{seed} }{ Optional. A fixed seed for the number generator.} +\describe{ +\item{\code{method}}{The method to use for rounding, a) \code{'min_ellipsoid'} for the method based on mimimmum volume enclosing ellipsoid of a dataset, b) \code{'max_ellipsoid'} for the method based on maximum volume enclosed ellipsoid, (c) \code{'isotropy'} for the method based on svd decomposition. The default method is \code{'mee'} for all the representations.} +\item{\code{seed}}{Optional. A fixed seed for the number generator.} }} } \value{ diff --git a/man/sample_points.Rd b/man/sample_points.Rd index ab633930..307d3444 100644 --- a/man/sample_points.Rd +++ b/man/sample_points.Rd @@ -12,8 +12,8 @@ sample_points(P, n, random_walk = NULL, distribution = NULL, seed = NULL) \item{n}{The number of points that the function is going to sample from the convex polytope.} \item{random_walk}{Optional. A list that declares the random walk and some related parameters as follows: -\itemize{ -\item{\code{walk} }{ A string to declare the random walk: i) \code{'CDHR'} for Coordinate Directions Hit-and-Run, +\describe{ +\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{'dikin'} for dikin walk, vi) \code{'vaidya'} for vaidya walk, vii) \code{'john'} for john walk, viii) \code{'BCDHR'} boundary sampling by keeping the extreme points of CDHR or ix) \code{'BRDHR'} boundary sampling by keeping the extreme points of RDHR, @@ -24,25 +24,25 @@ xiii) \code{'ExactHMC'} for exact Hamiltonian Monte Carlo with reflections (sphe The default walk is \code{'aBiW'} for the uniform distribution, \code{'CDHR'} for the Gaussian distribution and H-polytopes and \code{'BiW'} or \code{'RDHR'} for the same distributions and V-polytopes and zonotopes. \code{'NUTS'} is the default sampler for logconcave densities and \code{'CRHMC'} for logconcave densities with H-polytope and sparse constrainted problems.} -\item{\code{walk_length} }{ The number of the steps per generated point for the random walk. The default value is \eqn{1}.} -\item{\code{nburns} }{ The number of points to burn before start sampling. The default value is \eqn{1}.} -\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()}.} -\item{\code{BaW_rad} }{ The radius for the ball walk.} -\item{\code{L} }{ The maximum length of the billiard trajectory or the radius for the step of dikin, vaidya or john walk.} -\item{\code{solver} }{ Specify ODE solver for logconcave sampling. Options are i) leapfrog, ii) euler iii) runge-kutta iv) richardson} -\item{\code{step_size} }{ Optionally chosen step size for logconcave sampling. Defaults to a theoretical value if not provided.} +\item{\code{walk_length}}{The number of the steps per generated point for the random walk. The default value is \eqn{1}.} +\item{\code{nburns}}{The number of points to burn before start sampling. The default value is \eqn{1}.} +\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()}.} +\item{\code{BaW_rad}}{The radius for the ball walk.} +\item{\code{L}}{The maximum length of the billiard trajectory or the radius for the step of dikin, vaidya or john walk.} +\item{\code{solver}}{Specify ODE solver for logconcave sampling. Options are i) leapfrog, ii) euler iii) runge-kutta iv) richardson} +\item{\code{step_size}}{Optionally chosen step size for logconcave sampling. Defaults to a theoretical value if not provided.} }} \item{distribution}{Optional. A list that declares the target density and some related parameters as follows: -\itemize{ -\item{\code{density} }{ A string: (a) \code{'uniform'} for the uniform distribution or b) \code{'gaussian'} for the multidimensional spherical distribution c) \code{logconcave} with form proportional to exp(-f(x)) where f(x) is L-smooth and m-strongly-convex d) \code{'exponential'} for the exponential distribution. The default target distribution is the uniform distribution.} -\item{\code{variance} }{ The variance of the multidimensional spherical gaussian or the exponential distribution. The default value is 1.} -\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()}.} -\item{\code{bias} }{ The bias vector for the exponential distribution. The default vector is \eqn{c_1 = 1} and \eqn{c_i = 0} for \eqn{i \neq 1}.} -\item{\code{L_} }{ Smoothness constant (for logconcave). } -\item{\code{m} }{ Strong-convexity constant (for logconcave). } -\item{\code{negative_logprob} }{ Negative log-probability (for logconcave). } -\item{\code{negative_logprob_gradient} }{ Negative log-probability gradient (for logconcave). } +\describe{ +\item{\code{density}}{A string: (a) \code{'uniform'} for the uniform distribution or b) \code{'gaussian'} for the multidimensional spherical distribution c) \code{logconcave} with form proportional to exp(-f(x)) where f(x) is L-smooth and m-strongly-convex d) \code{'exponential'} for the exponential distribution. The default target distribution is the uniform distribution.} +\item{\code{variance}}{The variance of the multidimensional spherical gaussian or the exponential distribution. The default value is 1.} +\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()}.} +\item{\code{bias}}{The bias vector for the exponential distribution. The default vector is \eqn{c_1 = 1} and \eqn{c_i = 0} for \eqn{i \neq 1}.} +\item{\code{L_}}{Smoothness constant (for logconcave). } +\item{\code{m}}{Strong-convexity constant (for logconcave). } +\item{\code{negative_logprob}}{Negative log-probability (for logconcave). } +\item{\code{negative_logprob_gradient}}{Negative log-probability gradient (for logconcave). } }} \item{seed}{Optional. A fixed seed for the number generator.} diff --git a/man/uniform_sample_correlation_matrices.Rd b/man/uniform_sample_correlation_matrices.Rd index cf4e1ae9..d962218f 100644 --- a/man/uniform_sample_correlation_matrices.Rd +++ b/man/uniform_sample_correlation_matrices.Rd @@ -4,7 +4,13 @@ \alias{uniform_sample_correlation_matrices} \title{Uniformly sample correlation matrices} \usage{ -uniform_sample_correlation_matrices(n, num_matrices = 1000, walk_length = 1, nburns = 0, validate = FALSE) +uniform_sample_correlation_matrices( + n, + num_matrices = 1000L, + walk_length = 1L, + nburns = 0L, + validate = FALSE +) } \arguments{ \item{n}{The dimension of the correlation matrix.} diff --git a/man/volume.Rd b/man/volume.Rd index 71089bed..6ce86e9d 100644 --- a/man/volume.Rd +++ b/man/volume.Rd @@ -10,14 +10,14 @@ volume(P, settings = NULL, rounding = NULL) \item{P}{A convex polytope. It is an object from class a) Hpolytope or b) Vpolytope or c) Zonotope or d) VpolytopeIntersection.} \item{settings}{Optional. A list that declares which algorithm, random walk and values of parameters to use, as follows: -\itemize{ -\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'}.} -\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.} -\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 algorithm the default walk is \code{'BiW'}. For CG and SOB algorithms the default walk is \code{'CDHR'} for H-polytopes and \code{'RDHR'} for the other representations.} -\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.} -\item{\code{win_len} }{ The length of the sliding window for CB or CG algorithm. The default value is \eqn{250} for CB with BiW and \eqn{400+3d^2} for CB and any other random walk and \eqn{500+4d^2} for CG.} -\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}.} -\item{\code{seed} }{ A fixed seed for the number generator.} +\describe{ +\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'}.} +\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.} +\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 algorithm the default walk is \code{'BiW'}. For CG and SOB algorithms the default walk is \code{'CDHR'} for H-polytopes and \code{'RDHR'} for the other representations.} +\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.} +\item{\code{win_len}}{The length of the sliding window for CB or CG algorithm. The default value is \eqn{250} for CB with BiW and \eqn{400+3d^2} for CB and any other random walk and \eqn{500+4d^2} for CG.} +\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}.} +\item{\code{seed}}{A fixed seed for the number generator.} }} \item{rounding}{Optional. A string parameter to request a rounding method to be applied in the input polytope before volume computation: a) \code{'min_ellipsoid'}, b) \code{'svd'}, c) \code{'max_ellipsoid'} and d) \code{'none'} for no rounding.} diff --git a/man/zonotope_approximation.Rd b/man/zonotope_approximation.Rd index b06743a6..a90ec7d4 100644 --- a/man/zonotope_approximation.Rd +++ b/man/zonotope_approximation.Rd @@ -16,12 +16,12 @@ zonotope_approximation( \item{fit_ratio}{Optional. A boolean parameter to request the computation of the ratio of fitness.} \item{settings}{Optional. A list that declares the values of the parameters of CB algorithm as follows: -\itemize{ -\item{\code{error} }{ A numeric value to set the upper bound for the approximation error. The default value is \eqn{0.1}.} -\item{\code{walk_length} }{ An integer to set the number of the steps for the random walk. The default value is \eqn{1}.} -\item{\code{win_len} }{ The length of the sliding window for CB algorithm. The default value is \eqn{250}.} -\item{\code{hpoly} }{ A boolean parameter to use H-polytopes in MMC of CB algorithm. The default value is \code{TRUE} when the order of the zonotope is \eqn{<5}, otherwise it is \code{FALSE}.} -\item{\code{seed} }{ Optional. A fixed seed for the number generator.} +\describe{ +\item{\code{error}}{A numeric value to set the upper bound for the approximation error. The default value is \eqn{0.1}.} +\item{\code{walk_length}}{An integer to set the number of the steps for the random walk. The default value is \eqn{1}.} +\item{\code{win_len}}{The length of the sliding window for CB algorithm. The default value is \eqn{250}.} +\item{\code{hpoly}}{A boolean parameter to use H-polytopes in MMC of CB algorithm. The default value is \code{TRUE} when the order of the zonotope is \eqn{<5}, otherwise it is \code{FALSE}.} +\item{\code{seed}}{Optional. A fixed seed for the number generator.} }} } \value{ diff --git a/src/direct_sampling.cpp b/src/direct_sampling.cpp index c9695568..5f9d90a2 100644 --- a/src/direct_sampling.cpp +++ b/src/direct_sampling.cpp @@ -24,10 +24,10 @@ //' The \eqn{d}-dimensional unit simplex is the set of points \eqn{\vec{x}\in \R^d}, s.t.: \eqn{\sum_i x_i\leq 1}, \eqn{x_i\geq 0}. The \eqn{d}-dimensional canonical simplex is the set of points \eqn{\vec{x}\in \R^d}, s.t.: \eqn{\sum_i x_i = 1}, \eqn{x_i\geq 0}. //' //' @param body A list to request exact uniform sampling from special well known convex bodies through the following input parameters: -//' \itemize{ -//' \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.} -//' \item{\code{dimension} }{ An integer that declares the dimension when exact sampling is enabled for a simplex or a hypersphere.} -//' \item{\code{radius} }{ The radius of the \eqn{d}-dimensional hypersphere. The default value is \eqn{1}.} +//' \describe{ +//' \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.} +//' \item{\code{dimension}}{An integer that declares the dimension when exact sampling is enabled for a simplex or a hypersphere.} +//' \item{\code{radius}}{The radius of the \eqn{d}-dimensional hypersphere. The default value is \eqn{1}.} //' } //' @param n The number of points that the function is going to sample. //' @param seed Optional. A fixed seed for the number generator. diff --git a/src/sample_points.cpp b/src/sample_points.cpp index 5dc796a5..ab61f49a 100644 --- a/src/sample_points.cpp +++ b/src/sample_points.cpp @@ -224,8 +224,8 @@ bool is_walk(Rcpp::Nullable random_walk, std::string str) { //' @param P A convex polytope. It is an object from class (a) Hpolytope or (b) Vpolytope or (c) Zonotope or (d) VpolytopeIntersection. //' @param n The number of points that the function is going to sample from the convex polytope. //' @param random_walk Optional. A list that declares the random walk and some related parameters as follows: -//' \itemize{ -//' \item{\code{walk} }{ A string to declare the random walk: i) \code{'CDHR'} for Coordinate Directions Hit-and-Run, +//' \describe{ +//' \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{'dikin'} for dikin walk, vi) \code{'vaidya'} for vaidya walk, vii) \code{'john'} for john walk, //' viii) \code{'BCDHR'} boundary sampling by keeping the extreme points of CDHR or ix) \code{'BRDHR'} boundary sampling by keeping the extreme points of RDHR, @@ -236,24 +236,24 @@ bool is_walk(Rcpp::Nullable random_walk, std::string str) { //' The default walk is \code{'aBiW'} for the uniform distribution, \code{'CDHR'} for the Gaussian distribution and H-polytopes and //' \code{'BiW'} or \code{'RDHR'} for the same distributions and V-polytopes and zonotopes. \code{'NUTS'} is the default sampler for logconcave densities and \code{'CRHMC'} //' for logconcave densities with H-polytope and sparse constrainted problems.} -//' \item{\code{walk_length} }{ The number of the steps per generated point for the random walk. The default value is \eqn{1}.} -//' \item{\code{nburns} }{ The number of points to burn before start sampling. The default value is \eqn{1}.} -//' \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()}.} -//' \item{\code{BaW_rad} }{ The radius for the ball walk.} -//' \item{\code{L} }{ The maximum length of the billiard trajectory or the radius for the step of dikin, vaidya or john walk.} -//' \item{\code{solver} }{ Specify ODE solver for logconcave sampling. Options are i) leapfrog, ii) euler iii) runge-kutta iv) richardson} -//' \item{\code{step_size} }{ Optionally chosen step size for logconcave sampling. Defaults to a theoretical value if not provided.} +//' \item{\code{walk_length}}{The number of the steps per generated point for the random walk. The default value is \eqn{1}.} +//' \item{\code{nburns}}{The number of points to burn before start sampling. The default value is \eqn{1}.} +//' \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()}.} +//' \item{\code{BaW_rad}}{The radius for the ball walk.} +//' \item{\code{L}}{The maximum length of the billiard trajectory or the radius for the step of dikin, vaidya or john walk.} +//' \item{\code{solver}}{Specify ODE solver for logconcave sampling. Options are i) leapfrog, ii) euler iii) runge-kutta iv) richardson} +//' \item{\code{step_size}}{Optionally chosen step size for logconcave sampling. Defaults to a theoretical value if not provided.} //' } //' @param distribution Optional. A list that declares the target density and some related parameters as follows: -//' \itemize{ -//' \item{\code{density} }{ A string: (a) \code{'uniform'} for the uniform distribution or b) \code{'gaussian'} for the multidimensional spherical distribution c) \code{logconcave} with form proportional to exp(-f(x)) where f(x) is L-smooth and m-strongly-convex d) \code{'exponential'} for the exponential distribution. The default target distribution is the uniform distribution.} -//' \item{\code{variance} }{ The variance of the multidimensional spherical gaussian or the exponential distribution. The default value is 1.} -//' \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()}.} -//' \item{\code{bias} }{ The bias vector for the exponential distribution. The default vector is \eqn{c_1 = 1} and \eqn{c_i = 0} for \eqn{i \neq 1}.} -//' \item{\code{L_} }{ Smoothness constant (for logconcave). } -//' \item{\code{m} }{ Strong-convexity constant (for logconcave). } -//' \item{\code{negative_logprob} }{ Negative log-probability (for logconcave). } -//' \item{\code{negative_logprob_gradient} }{ Negative log-probability gradient (for logconcave). } +//' \describe{ +//' \item{\code{density}}{A string: (a) \code{'uniform'} for the uniform distribution or b) \code{'gaussian'} for the multidimensional spherical distribution c) \code{logconcave} with form proportional to exp(-f(x)) where f(x) is L-smooth and m-strongly-convex d) \code{'exponential'} for the exponential distribution. The default target distribution is the uniform distribution.} +//' \item{\code{variance}}{The variance of the multidimensional spherical gaussian or the exponential distribution. The default value is 1.} +//' \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()}.} +//' \item{\code{bias}}{The bias vector for the exponential distribution. The default vector is \eqn{c_1 = 1} and \eqn{c_i = 0} for \eqn{i \neq 1}.} +//' \item{\code{L_}}{Smoothness constant (for logconcave). } +//' \item{\code{m}}{Strong-convexity constant (for logconcave). } +//' \item{\code{negative_logprob}}{Negative log-probability (for logconcave). } +//' \item{\code{negative_logprob_gradient}}{Negative log-probability gradient (for logconcave). } //' } //' @param seed Optional. A fixed seed for the number generator. //' diff --git a/src/volume.cpp b/src/volume.cpp index cc41be3a..e955b07d 100644 --- a/src/volume.cpp +++ b/src/volume.cpp @@ -174,14 +174,14 @@ std::pair generic_volume(Polytope& P, RNGType &rng, unsigned int //' //' @param P A convex polytope. It is an object from class a) Hpolytope or b) Vpolytope or c) Zonotope or d) VpolytopeIntersection. //' @param settings Optional. A list that declares which algorithm, random walk and values of parameters to use, as follows: -//' \itemize{ -//' \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'}.} -//' \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.} -//' \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 algorithm the default walk is \code{'BiW'}. For CG and SOB algorithms the default walk is \code{'CDHR'} for H-polytopes and \code{'RDHR'} for the other representations.} -//' \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.} -//' \item{\code{win_len} }{ The length of the sliding window for CB or CG algorithm. The default value is \eqn{250} for CB with BiW and \eqn{400+3d^2} for CB and any other random walk and \eqn{500+4d^2} for CG.} -//' \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}.} -//' \item{\code{seed} }{ A fixed seed for the number generator.} +//' \describe{ +//' \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'}.} +//' \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.} +//' \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 algorithm the default walk is \code{'BiW'}. For CG and SOB algorithms the default walk is \code{'CDHR'} for H-polytopes and \code{'RDHR'} for the other representations.} +//' \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.} +//' \item{\code{win_len}}{The length of the sliding window for CB or CG algorithm. The default value is \eqn{250} for CB with BiW and \eqn{400+3d^2} for CB and any other random walk and \eqn{500+4d^2} for CG.} +//' \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}.} +//' \item{\code{seed}}{A fixed seed for the number generator.} //' } //' @param rounding Optional. A string parameter to request a rounding method to be applied in the input polytope before volume computation: a) \code{'min_ellipsoid'}, b) \code{'svd'}, c) \code{'max_ellipsoid'} and d) \code{'none'} for no rounding. //' From 3681513199f9bed0748f812452273abe019905d5 Mon Sep 17 00:00:00 2001 From: vfisikop Date: Wed, 9 Oct 2024 19:18:21 +0300 Subject: [PATCH 2/5] Add Authors@R in description --- DESCRIPTION | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4cf9add0..a6564b3a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,9 +2,11 @@ Package: volesti Type: Package License: LGPL-3 Title: Volume Approximation and Sampling of Convex Polytopes -Author: Vissarion Fisikopoulos [aut, cph, cre], - Apostolos Chalkis [cph, aut], - contributors in file inst/AUTHORS +Authors@R: c( + person("Vissarion", "Fisikopoulos", , "vissarion.fisikopoulos@gmail.com", role = c("aut", "cre", "cph"), + comment = c(ORCID = "0000-0002-0780-666X")), + person("Apostolos", "Chalkis", , "tolis.chal@gmail.com", role = c("aut", "cph"), + comment = c(ORCID = "0000-0002-4628-1907"))) 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 From 25a097b8dd9a12f2107d871d1557d21d67b91651 Mon Sep 17 00:00:00 2001 From: vfisikop Date: Wed, 9 Oct 2024 19:27:19 +0300 Subject: [PATCH 3/5] Update to use artifact v4 in github actions --- .github/workflows/R-CMD-check-macOS.yml | 4 ++-- .github/workflows/R-CMD-check-ubuntu.yml | 4 ++-- .github/workflows/R-CMD-check-windows.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/R-CMD-check-macOS.yml b/.github/workflows/R-CMD-check-macOS.yml index c7ba3483..3607e538 100644 --- a/.github/workflows/R-CMD-check-macOS.yml +++ b/.github/workflows/R-CMD-check-macOS.yml @@ -47,7 +47,7 @@ jobs: - name: Upload check results if: failure() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check \ No newline at end of file + path: check diff --git a/.github/workflows/R-CMD-check-ubuntu.yml b/.github/workflows/R-CMD-check-ubuntu.yml index 55f2c518..1308c9dc 100644 --- a/.github/workflows/R-CMD-check-ubuntu.yml +++ b/.github/workflows/R-CMD-check-ubuntu.yml @@ -49,7 +49,7 @@ jobs: - name: Upload check results if: failure() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check \ No newline at end of file + path: check diff --git a/.github/workflows/R-CMD-check-windows.yml b/.github/workflows/R-CMD-check-windows.yml index db0a8bd0..c40657fd 100644 --- a/.github/workflows/R-CMD-check-windows.yml +++ b/.github/workflows/R-CMD-check-windows.yml @@ -46,7 +46,7 @@ jobs: - name: Upload check results if: failure() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check \ No newline at end of file + path: check From 81053e9065c3dfd5ee0766d989fac2bfe0366cf8 Mon Sep 17 00:00:00 2001 From: vfisikop Date: Thu, 10 Oct 2024 13:53:42 +0300 Subject: [PATCH 4/5] Fix more documentation issues --- R/gen_rand_zonotope.R | 4 ++-- R/rotate_polytope.R | 10 +++++----- man/gen_rand_zonotope.Rd | 4 ++-- man/rotate_polytope.Rd | 10 +++++----- src/uniform_sample_correlation_matrices.cpp | 3 +-- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/R/gen_rand_zonotope.R b/R/gen_rand_zonotope.R index 8cc7b7c8..aa887253 100644 --- a/R/gen_rand_zonotope.R +++ b/R/gen_rand_zonotope.R @@ -7,8 +7,8 @@ #' @param nsegments The number of segments that generate the zonotope. #' @param generator A list that could contain two elements. #' \describe{ -#' \item{distribution}{ the distribution to pick the length of each segment from \eqn{[0,100]}: (i) 'uniform', (ii) 'gaussian' or (iii) 'exponential', the default value is 'uniform.} -#' \item {seed}{Optional. A fixed seed for the number generator.} +#' \item{distribution}{The distribution to pick the length of each segment from \eqn{[0,100]}: (i) 'uniform', (ii) 'gaussian' or (iii) 'exponential', the default value is 'uniform.} +#' \item{seed}{Optional. A fixed seed for the number generator.} #' } #' #' @return A polytope class representing a zonotope. diff --git a/R/rotate_polytope.R b/R/rotate_polytope.R index 4d43d2dc..585db700 100644 --- a/R/rotate_polytope.R +++ b/R/rotate_polytope.R @@ -8,11 +8,11 @@ #' @return A list that contains the rotated polytope and the matrix \eqn{T} of the linear transformation. #' #' @details Let \eqn{P} be the given polytope and \eqn{Q} the rotated one and \eqn{T} be the matrix of the linear transformation. -#' \describe{ -#' \item{If \eqn{P} is in H-representation and \eqn{A} is the matrix that contains the normal vectors of the facets of \eqn{Q} then \eqn{AT} contains the normal vactors of the facets of \eqn{P}.} -#' \item{If \eqn{P} is in V-representation and \eqn{V} is the matrix that contains column-wise the vertices of \eqn{Q} then \eqn{T^TV} contains the vertices of \eqn{P}.} -#' \item{If \eqn{P} is a zonotope and \eqn{G} is the matrix that contains column-wise the generators of \eqn{Q} then \eqn{T^TG} contains the generators of \eqn{P}.} -#' \item{If \eqn{M} is a matrix that contains column-wise points in \eqn{Q} then \eqn{T^TM} contains points in \eqn{P}.} +#' \itemize{ +#' \item If \eqn{P} is in H-representation and \eqn{A} is the matrix that contains the normal vectors of the facets of \eqn{Q} then \eqn{AT} contains the normal vectors of the facets of \eqn{P}. +#' \item If \eqn{P} is in V-representation and \eqn{V} is the matrix that contains column-wise the vertices of \eqn{Q} then \eqn{T^TV} contains the vertices of \eqn{P}. +#' \item If \eqn{P} is a zonotope and \eqn{G} is the matrix that contains column-wise the generators of \eqn{Q} then \eqn{T^TG} contains the generators of \eqn{P}. +#' \item If \eqn{M} is a matrix that contains column-wise points in \eqn{Q} then \eqn{T^TM} contains points in \eqn{P}. #' } #' @examples #' # rotate a H-polytope (2d unit simplex) diff --git a/man/gen_rand_zonotope.Rd b/man/gen_rand_zonotope.Rd index b0ab01c3..683c15f2 100644 --- a/man/gen_rand_zonotope.Rd +++ b/man/gen_rand_zonotope.Rd @@ -17,8 +17,8 @@ gen_rand_zonotope( \item{generator}{A list that could contain two elements. \describe{ -\item{distribution}{ the distribution to pick the length of each segment from \eqn{[0,100]}: (i) 'uniform', (ii) 'gaussian' or (iii) 'exponential', the default value is 'uniform.} -\item {seed}{Optional. A fixed seed for the number generator.} +\item{distribution}{The distribution to pick the length of each segment from \eqn{[0,100]}: (i) 'uniform', (ii) 'gaussian' or (iii) 'exponential', the default value is 'uniform.} +\item{seed}{Optional. A fixed seed for the number generator.} }} } \value{ diff --git a/man/rotate_polytope.Rd b/man/rotate_polytope.Rd index bc7cef10..4c67f671 100644 --- a/man/rotate_polytope.Rd +++ b/man/rotate_polytope.Rd @@ -19,11 +19,11 @@ Given a convex H- or V- polytope or a zonotope or an intersection of two V-polyt } \details{ Let \eqn{P} be the given polytope and \eqn{Q} the rotated one and \eqn{T} be the matrix of the linear transformation. -\describe{ -\item{If \eqn{P} is in H-representation and \eqn{A} is the matrix that contains the normal vectors of the facets of \eqn{Q} then \eqn{AT} contains the normal vactors of the facets of \eqn{P}.} -\item{If \eqn{P} is in V-representation and \eqn{V} is the matrix that contains column-wise the vertices of \eqn{Q} then \eqn{T^TV} contains the vertices of \eqn{P}.} -\item{If \eqn{P} is a zonotope and \eqn{G} is the matrix that contains column-wise the generators of \eqn{Q} then \eqn{T^TG} contains the generators of \eqn{P}.} -\item{If \eqn{M} is a matrix that contains column-wise points in \eqn{Q} then \eqn{T^TM} contains points in \eqn{P}.} +\itemize{ +\item If \eqn{P} is in H-representation and \eqn{A} is the matrix that contains the normal vectors of the facets of \eqn{Q} then \eqn{AT} contains the normal vectors of the facets of \eqn{P}. +\item If \eqn{P} is in V-representation and \eqn{V} is the matrix that contains column-wise the vertices of \eqn{Q} then \eqn{T^TV} contains the vertices of \eqn{P}. +\item If \eqn{P} is a zonotope and \eqn{G} is the matrix that contains column-wise the generators of \eqn{Q} then \eqn{T^TG} contains the generators of \eqn{P}. +\item If \eqn{M} is a matrix that contains column-wise points in \eqn{Q} then \eqn{T^TM} contains points in \eqn{P}. } } \examples{ diff --git a/src/uniform_sample_correlation_matrices.cpp b/src/uniform_sample_correlation_matrices.cpp index c1c73826..cf099535 100644 --- a/src/uniform_sample_correlation_matrices.cpp +++ b/src/uniform_sample_correlation_matrices.cpp @@ -21,7 +21,6 @@ //' @param validate Optional. Whether to validate the sampled matrices. Default is false. //' //' @return A list of sampled correlation matrices. - // [[Rcpp::export]] Rcpp::List uniform_sample_correlation_matrices(const unsigned int n, const unsigned int num_matrices = 1000, const unsigned int walk_length=1, const unsigned int nburns = 0, const bool validate = false) { @@ -43,7 +42,7 @@ Rcpp::List uniform_sample_correlation_matrices(const unsigned int n, const unsig throw Rcpp::exception("Invalid correlation matrix"); } } - } + } Rcpp::List rcpp_sampled_matrices(randCorMatrices.size()); int index = 0; From 980f1ec7020c814fb5bf7f14850f70fc05d6eb79 Mon Sep 17 00:00:00 2001 From: vfisikop Date: Thu, 10 Oct 2024 15:55:35 +0300 Subject: [PATCH 5/5] Update macos github actions --- .github/workflows/R-CMD-check-macOS.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check-macOS.yml b/.github/workflows/R-CMD-check-macOS.yml index 3607e538..d2dc4471 100644 --- a/.github/workflows/R-CMD-check-macOS.yml +++ b/.github/workflows/R-CMD-check-macOS.yml @@ -1,7 +1,7 @@ ############################################################################## # GitHub Actions Workflow to test the R interface of volesti # -# Copyright (c) 2020 Vissarion Fisikopoulos +# Copyright (c) 2020-2024 Vissarion Fisikopoulos # # Licensed under GNU LGPL.3, see LICENCE file ############################################################################## @@ -20,8 +20,20 @@ jobs: fail-fast: false matrix: config: + ## incompatible versions of gfortran and R - {os: macOS-latest, r: '4.1.2'} + ## building with clang 15 yields a compile error from external/PackedCSparse/FloatArray.h:11: + ## error "This header is only meant to be used on x86 and x64 architecture" - {os: macOS-latest, r: 'release'} + ## In file included from direct_sampling.cpp:19: + ## In file included from volesti/include/volume/volume_sequence_of_balls.hpp:21: + ## volesti/include/convex_bodies/hpolytope.h:1015:35: error: no template named 'is_same_v' in namespace 'std'; did you mean 'is_same'? + ## -> std::enable_if_t> && !std::is_same_v, void> { // MT must be in RowMajor format + - {os: macOS-13, r: '4.1.2'} + - {os: macOS-12, r: '4.1.2'} + ## pass without errors + - {os: macOS-13, r: 'release'} + - {os: macOS-12, r: 'release'} env: R_REMOTES_NO_ERRORS_FROM_WARNINGS: true