From 52a4f574baba290036fb832fe67e359d8786545d Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Thu, 18 Jun 2020 17:18:31 +0300 Subject: [PATCH] Fix deprecated ftime in lpsolve and update README (#89) --- R-proj/DESCRIPTION | 4 +- .../src/Rproj_externals/lp_solve/commonlib.c | 6 +-- cran_gen/NEWS.md | 5 +++ cran_gen/README.md | 42 +++++-------------- 4 files changed, 21 insertions(+), 36 deletions(-) diff --git a/R-proj/DESCRIPTION b/R-proj/DESCRIPTION index 3ee4bdfc3..cdc1458f4 100644 --- a/R-proj/DESCRIPTION +++ b/R-proj/DESCRIPTION @@ -11,8 +11,8 @@ Description: Provides an R interface for 'volesti' C++ package. 'volesti' comput (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. -Version: 1.1.0 -Date: 2020-05-29 +Version: 1.1.1 +Date: 2020-06-18 Maintainer: Vissarion Fisikopoulos Depends: Rcpp (>= 0.12.17) Imports: methods, stats diff --git a/R-proj/src/Rproj_externals/lp_solve/commonlib.c b/R-proj/src/Rproj_externals/lp_solve/commonlib.c index 418f45dfe..1b755fd1a 100644 --- a/R-proj/src/Rproj_externals/lp_solve/commonlib.c +++ b/R-proj/src/Rproj_externals/lp_solve/commonlib.c @@ -852,10 +852,10 @@ double timeNow(void) } return( timeBase + (double) now.QuadPart/(double) freq.QuadPart ); #else - struct timeb buf; + struct timeval buf; - ftime(&buf); - return((double)buf.time+((double) buf.millitm)/1000.0); + gettimeofday(&buf, NULL); + return((double)buf.tv_sec+(double) buf.tv_usec); #endif } diff --git a/cran_gen/NEWS.md b/cran_gen/NEWS.md index 32b0fb07e..5038f653b 100644 --- a/cran_gen/NEWS.md +++ b/cran_gen/NEWS.md @@ -24,3 +24,8 @@ * 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 + diff --git a/cran_gen/README.md b/cran_gen/README.md index e753e04c1..8a9245ec5 100644 --- a/cran_gen/README.md +++ b/cran_gen/README.md @@ -3,7 +3,7 @@ ## About The `volesti` package provides [R](https://www.r-project.org/) with functions for volume estimation and sampling. In particular, it provides an R interface for the C++ library [**volesti**](https://github.com/GeomScale/volume_approximation). -`volesti` computes approximations of volume of polytopes given as a set of points or linear inequalities or as a Minkowski sum of segments (zonotopes). There are two algorithms for volume approximation as well as algorithms for sampling, rounding and rotating polytopes. +`volesti` computes approximations of volume of polytopes given as a set of points or linear inequalities or as a Minkowski sum of segments (zonotopes). There are algorithms for volume approximation as well as algorithms for sampling, rounding and rotating polytopes. Last but not least, `volesti` provides implementations of geometric algorithms to compute the score of a portfolio given asset returns and to detect financial crises in stock markets. ## Download and install @@ -16,40 +16,20 @@ install.packages("volesti") ``` * The package-dependencies are: `Rcpp`, `RcppEigen`, `BH`. -## Usage - -* The main function is `volume()`. It can be used to approximate the volume of a convex polytope given as a set of linear inequalities or a set of vertices (d-dimensional points) or as a Minkowski sum of segments (zonotope). There are two algorithms that can be used. The first is `SequenceOfBalls` and the second is `CoolingGaussian`. -* `sample_points()` can be used to sample points from a convex polytope approximating uniform or multidimensional spherical gaussian target distribution using: (a) coordinate directions hit-and-run (default), (b) random directions hit-and-run or (c) ball walk. This function can be used as well in order to sample exact uniform points from simplices and the boundary or the interior of hyperspheres. -* `round_polytope()` can be used to round a convex polytope. -* `rand_rotate()` can be used to apply a random rotation to a convex polytope. -* `gen_cross()` can be used to generate a d-dimensional cross polytope. -* `gen_cube()` can be used to generate a d-dimensional unit cube. -* `gen_prod_simplex()` can be used to generate a 2d-dimensional polytope that is defined as the product of two d-dimensional unit simplices. -* `gen_simplex()` can be used to generate the d-dimensional unit simplex. -* `gen_skinny_cube()` can be used to generate a d-dimensional skinny hypercube. -* `gen_rand_hpoly()` can be used to generate a d-dimensional polytope in H-representation with m facets. -* `gen_rand_vpoly()` can be used to generate a d-dimensional polytope in V-representation with m vertices. -* `gen_rand_zonotope()` can be used to generate a random d-dimensional zonotope defined by the Minkowski sum of m d-dimensional segments. -* `file_to_polytope()` takes the path for an ine or an ext file and returns the corresponding polytope. -* `frustum_of_simplex()` can be used to evaluate the portion of of the d-dimensional unit simplex contained in a given half-space using M. Ali's version of G. Varsi's iterative formula. -* `inner_ball()` can be used to compute an inscribed ball of a convex polytope (works for all the representations). -* `copula1()` can be used to compute the copula when two families of parallel hyperplanes are given. -* `copula2()` can be used to compute the copula when one familiy of parallel hyperplanes and a family of concentric ellipsoids are given. - -For more details, features, examples and references you can read the documentation. +## Documentation -## Credits +* [Using the R Interface](https://github.com/GeomScale/volume_approximation/blob/v1.1.1/doc/r_interface.md) +* [Wikipage with Tutorials and Demos](https://github.com/GeomScale/volume_approximation/wiki) +* [Tutorial given to PyData meetup](https://vissarion.github.io/tutorials/volesti_tutorial_pydata.html) -Copyright (c) 2012-2020 Vissarion Fisikopoulos -Copyright (c) 2018-2020 Apostolos Chalkis -You may redistribute or modify the software under the GNU Lesser General Public License as published by Free Software Foundation, either version 3 of the License, or (at your option) any later version. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. +## Credits -Main development by Vissarion Fisikopoulos while he was affiliated with University of Athens (UoA, Greece) and University of Brussels (ULB, Belgium), and Chalkis Apostolos affiliated with University of Athens. Part of the development was done while A.Chalkis (as student) and V.Fisikopoulos (as mentor) were participating in Google Summer of Code 2018 program. +* [Contributors and Package History](https://github.com/GeomScale/volume_approximation/blob/v1.1.1/doc/credits.md) +* [List of Publications](https://github.com/GeomScale/volume_approximation/blob/v1.1.1/doc/publications.md) -### Publications +Copyright (c) 2012-2020 Vissarion Fisikopoulos +Copyright (c) 2018-2020 Apostolos Chalkis -1. I.Z. Emiris and V. Fisikopoulos, *Efficient random-walk methods for approximating polytope volume*, In Proc. ACM Symposium on Computational Geometry, Kyoto, Japan, p.318-325, 2014. -2. I.Z. Emiris and V. Fisikopoulos, *Practical polytope volume approximation*, ACM Transactions on Mathematical Software, vol 44, issue 4, 2018. -3. L. Cales, A. Chalkis, I.Z. Emiris, V. Fisikopoulos, *Practical volume computation of structured convex bodies, and an application to modeling portfolio dependencies and financial crises*, Proc. of Symposium on Computational Geometry, Budapest, Hungary, 2018. +You may redistribute or modify the software under the GNU Lesser General Public License as published by Free Software Foundation, either version 3 of the License, or (at your option) any later version. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.