Skip to content

Commit

Permalink
Update Rd files and remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
vfisikop committed Mar 5, 2024
1 parent 4ae6dd8 commit 1a8a960
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 240 deletions.
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export(gen_simplex)
export(gen_skinny_cube)
export(geweke)
export(inner_ball)
export(loadSdpaFormatFile)
export(ode_solve)
export(pinvweibull_with_loc)
export(psrf_multivariate)
Expand All @@ -30,7 +29,6 @@ export(rotate_polytope)
export(round_polytope)
export(sample_points)
export(volume)
export(writeSdpaFormatFile)
export(write_sdpa_format_file)
export(zonotope_approximation)
exportClasses(Hpolytope)
Expand Down
38 changes: 0 additions & 38 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -384,44 +384,6 @@ sample_points <- function(P, n, random_walk = NULL, distribution = NULL, seed =
.Call(`_volesti_sample_points`, P, n, random_walk, distribution, seed)
}

#' Write a SDPA format file
#'
#' Outputs a spectrahedron (the matrices defining a linear matrix inequality) and a vector (the objective function)
#' to a SDPA format file.
#'
#' @param spectrahedron A spectrahedron in n dimensions; must be an object of class Spectrahedron
#' @param objectiveFunction A numerical vector of length n
#' @param outputFile Name of the output file
#'
#' @examples
#' \dontrun{
#' A0 = matrix(c(-1,0,0,0,-2,1,0,1,-2), nrow=3, ncol=3, byrow = TRUE)
#' A1 = matrix(c(-1,0,0,0,0,1,0,1,0), nrow=3, ncol=3, byrow = TRUE)
#' A2 = matrix(c(0,0,-1,0,0,0,-1,0,0), nrow=3, ncol=3, byrow = TRUE)
#' lmi = list(A0, A1, A2)
#' S = Spectrahedron(matrices = lmi)
#' objFunction = c(1,1)
#' writeSdpaFormatFile(S, objFunction, "output.txt")
#' }
#' @export
writeSdpaFormatFile <- function(spectrahedron = NULL, objectiveFunction = NULL, outputFile = NULL) {
invisible(.Call(`_volesti_writeSdpaFormatFile`, spectrahedron, objectiveFunction, outputFile))
}

#' Read a SDPA format file
#'
#' @param inputFile Name of the input file
#'
#' @return A list with two named items: an item "matrices" which is a list of the matrices and an vector "objFunction"
#'
#' @examples
#' path = system.file('extdata', package = 'volesti')
#' l = loadSdpaFormatFile(paste0(path,'/sdpa_n2m3.txt'))
#' @export
loadSdpaFormatFile <- function(inputFile = NULL) {
.Call(`_volesti_loadSdpaFormatFile`, inputFile)
}

#' The main function for volume approximation of a convex Polytope (H-polytope, V-polytope, zonotope or intersection of two V-polytopes). It returns a list with two elements: (a) the logarithm of the estimated volume and (b) the estimated volume
#'
#' For the volume approximation can be used three algorithms. Either CoolingBodies (CB) or SequenceOfBalls (SOB) or CoolingGaussian (CG). An H-polytope with \eqn{m} facets is described by a \eqn{m\times d} matrix \eqn{A} and a \eqn{m}-dimensional vector \eqn{b}, s.t.: \eqn{P=\{x\ |\ Ax\leq b\} }. A V-polytope is defined as the convex hull of \eqn{m} \eqn{d}-dimensional points which correspond to the vertices of P. A zonotope is desrcibed by the Minkowski sum of \eqn{m} \eqn{d}-dimensional segments.
Expand Down
25 changes: 25 additions & 0 deletions man/HpolytopeSparse-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 0 additions & 21 deletions man/loadSdpaFormatFile.Rd

This file was deleted.

14 changes: 12 additions & 2 deletions man/sample_points.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 0 additions & 34 deletions man/writeSdpaFormatFile.Rd

This file was deleted.

2 changes: 1 addition & 1 deletion src/Makevars
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PKG_CPPFLAGS=-Iexternal -Iexternal/lpSolve/src -Iexternal/minimum_ellipsoid -Ivolesti/include -Ivolesti/include/convex_bodies/spectrahedra
PKG_CXXFLAGS= -DBOOST_NO_AUTO_PTR -DDISABLE_NLP_ORACLES -Wno-deprecated-declarations -lm -ldl -Wno-ignored-attributes
PKG_CXXFLAGS= -DBOOST_NO_AUTO_PTR -DDISABLE_NLP_ORACLES -Wno-ignored-attributes

PKG_LIBS=-Lexternal/lpSolve/src -llp_solve -Lexternal/PackedCSparse/qd -lqd $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

Expand Down
25 changes: 0 additions & 25 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,29 +223,6 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// writeSdpaFormatFile
void writeSdpaFormatFile(Rcpp::Reference spectrahedron, Rcpp::Nullable<Rcpp::NumericVector> objectiveFunction, Rcpp::Nullable<std::string> outputFile);
RcppExport SEXP _volesti_writeSdpaFormatFile(SEXP spectrahedronSEXP, SEXP objectiveFunctionSEXP, SEXP outputFileSEXP) {
BEGIN_RCPP
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< Rcpp::Reference >::type spectrahedron(spectrahedronSEXP);
Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::NumericVector> >::type objectiveFunction(objectiveFunctionSEXP);
Rcpp::traits::input_parameter< Rcpp::Nullable<std::string> >::type outputFile(outputFileSEXP);
writeSdpaFormatFile(spectrahedron, objectiveFunction, outputFile);
return R_NilValue;
END_RCPP
}
// loadSdpaFormatFile
Rcpp::List loadSdpaFormatFile(Rcpp::Nullable<std::string> inputFile);
RcppExport SEXP _volesti_loadSdpaFormatFile(SEXP inputFileSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< Rcpp::Nullable<std::string> >::type inputFile(inputFileSEXP);
rcpp_result_gen = Rcpp::wrap(loadSdpaFormatFile(inputFile));
return rcpp_result_gen;
END_RCPP
}
// volume
Rcpp::List volume(Rcpp::Reference P, Rcpp::Nullable<Rcpp::List> settings, Rcpp::Nullable<std::string> rounding);
RcppExport SEXP _volesti_volume(SEXP PSEXP, SEXP settingsSEXP, SEXP roundingSEXP) {
Expand Down Expand Up @@ -303,8 +280,6 @@ static const R_CallMethodDef CallEntries[] = {
{"_volesti_rotating", (DL_FUNC) &_volesti_rotating, 3},
{"_volesti_rounding", (DL_FUNC) &_volesti_rounding, 3},
{"_volesti_sample_points", (DL_FUNC) &_volesti_sample_points, 5},
{"_volesti_writeSdpaFormatFile", (DL_FUNC) &_volesti_writeSdpaFormatFile, 3},
{"_volesti_loadSdpaFormatFile", (DL_FUNC) &_volesti_loadSdpaFormatFile, 1},
{"_volesti_volume", (DL_FUNC) &_volesti_volume, 3},
{"_volesti_write_sdpa_format_file", (DL_FUNC) &_volesti_write_sdpa_format_file, 3},
{"_volesti_zono_approx", (DL_FUNC) &_volesti_zono_approx, 4},
Expand Down
117 changes: 0 additions & 117 deletions src/spectrahedron.cpp

This file was deleted.

0 comments on commit 1a8a960

Please sign in to comment.