Skip to content

Commit b9cdb33

Browse files
vissarionclaude
andcommitted
fix: resolve Codecov path mismatch in coverage CI job
- Add --base-directory .. to lcov --capture so source file paths are written relative to the repo root instead of as absolute paths - Add sed fallback to strip CI runner path prefix from SF: lines in case the lcov version does not properly support --base-directory The error was: 'Unusable report due to source code unavailability, path mismatch, empty report, or incorrect data format' Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6ef7b38 commit b9cdb33

43 files changed

Lines changed: 558 additions & 100 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/cmake-clang.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ jobs:
2424
runs-on: ${{ matrix.config.os }}
2525
steps:
2626
- uses: actions/checkout@v4
27+
- name: Cache external dependencies (Eigen, Spectra, SuiteSparse)
28+
uses: actions/cache@v4
29+
with:
30+
path: external/_deps
31+
key: deps-${{ runner.os }}-${{ matrix.config.compiler }}-${{ hashFiles('external/cmake-files/*.cmake') }}
32+
restore-keys: |
33+
deps-${{ runner.os }}-${{ matrix.config.compiler }}-
2734
- run: sudo apt-get update || true;
2835
sudo apt-get install ${{ matrix.config.compiler_pkg }} lp-solve libopenblas-dev liblapack-dev;
2936
rm -rf build;

.github/workflows/cmake-examples.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ jobs:
2121
runs-on: ${{ matrix.config.os }}
2222
steps:
2323
- uses: actions/checkout@v4
24+
- name: Cache external dependencies (Eigen, Spectra, SuiteSparse)
25+
uses: actions/cache@v4
26+
with:
27+
path: external/_deps
28+
key: deps-${{ runner.os }}-${{ matrix.config.compiler }}-${{ hashFiles('external/cmake-files/*.cmake') }}
29+
restore-keys: |
30+
deps-${{ runner.os }}-${{ matrix.config.compiler }}-
2431
- run: sudo apt-get update || true;
2532
sudo apt-get install ${{ matrix.config.compiler_pkg }} lp-solve libopenblas-dev liblapack-dev libomp-dev libarpack2-dev;
2633
- name: Build examples

.github/workflows/cmake-gcc.yml

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ jobs:
2424
runs-on: ${{ matrix.config.os }}
2525
steps:
2626
- uses: actions/checkout@v4
27+
- name: Cache external dependencies (Eigen, Spectra, SuiteSparse)
28+
uses: actions/cache@v4
29+
with:
30+
path: external/_deps
31+
key: deps-${{ runner.os }}-${{ matrix.config.compiler }}-${{ hashFiles('external/cmake-files/*.cmake') }}
32+
restore-keys: |
33+
deps-${{ runner.os }}-${{ matrix.config.compiler }}-
2734
- run: sudo apt-get update || true;
2835
sudo apt-get install ${{ matrix.config.compiler }} lp-solve libopenblas-dev liblapack-dev;
2936
rm -rf build;
@@ -39,28 +46,46 @@ jobs:
3946
continue-on-error: true
4047
steps:
4148
- uses: actions/checkout@v4
49+
- name: Cache external dependencies (Eigen, Spectra, SuiteSparse)
50+
uses: actions/cache@v4
51+
with:
52+
path: external/_deps
53+
key: deps-${{ runner.os }}-${{ matrix.config.compiler }}-${{ hashFiles('external/cmake-files/*.cmake') }}
54+
restore-keys: |
55+
deps-${{ runner.os }}-${{ matrix.config.compiler }}-
4256
- name: Build and test with coverage
4357
run: |
4458
sudo apt-get update || true
45-
sudo apt-get install -y g++-12 lp-solve libopenblas-dev liblapack-dev lcov
59+
sudo apt-get install -y g++-12 gcc-12 lp-solve libopenblas-dev liblapack-dev
60+
sudo apt-get install -y gcovr 2>/dev/null || pip install gcovr 2>/dev/null || pip install --break-system-packages gcovr 2>/dev/null || true
4661
rm -rf build
4762
mkdir build
4863
cd build
4964
cmake -D CMAKE_CXX_COMPILER=g++-12 -D DISABLE_NLP_ORACLES=ON -D USE_MKL=OFF -D CODE_COVERAGE=ON ../test
5065
make -j$(nproc)
5166
ctest -j$(nproc) --verbose -E "crhmc_polytope_test_preparation|crhmc_test_polytope_sampling" --timeout 300 || true
52-
echo "=== Coverage report ==="
53-
lcov --capture --directory . --output-file coverage.info --rc lcov_branch_coverage=1 || true
54-
lcov --remove coverage.info '/usr/*' '*/external/*' '*/test/*' '*/_deps/*' --output-file coverage_filtered.info --rc lcov_branch_coverage=1 || true
55-
lcov --summary coverage_filtered.info --rc lcov_branch_coverage=1 || true
56-
echo "=== Per-file coverage ==="
57-
lcov --list coverage_filtered.info --rc lcov_branch_coverage=1 2>/dev/null | grep -E "include/|TOTAL" | head -60 || true
67+
- name: Generate coverage report
68+
if: success() || failure()
69+
run: |
70+
cd build
71+
echo "=== gcda files found ==="
72+
find . -name '*.gcda' | wc -l
73+
echo "=== Running gcov ==="
74+
for gcda in $(find . -name '*.gcda'); do
75+
gcov-12 -o $(dirname $gcda) ${gcda%.gcda}.gcno 2>&1 | grep -E "File|Lines" | head -2
76+
done || true
77+
echo "=== Generating XML ==="
78+
gcovr --gcov-executable gcov-12 --root .. --exclude '.*external.*' --exclude '.*test.*' --exclude '.*_deps.*' --xml -o coverage.xml 2>&1
79+
echo "Exit: $?"
80+
ls -la coverage.xml 2>&1 || true
81+
head -5 coverage.xml 2>&1 || true
5882
- name: Upload coverage to Codecov
5983
if: success() || failure()
6084
uses: codecov/codecov-action@v5
6185
with:
62-
files: build/coverage_filtered.info
86+
files: build/coverage.xml
6387
flags: unittests
6488
fail_ci_if_error: false
89+
disable_search: true
6590
env:
6691
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center"><img src="docs/logo/volesti_logo.jpg"></p>
22

3-
**VolEsti** is a `C++` library for volume approximation and sampling of convex bodies (*e.g.* polytopes) with an `R` interface. For a limited `Python` interface we refer to package [dingo](https://github.com/GeomScale/dingo). **VolEsti** is part of the [GeomScale](https://geomscale.github.io) project.
3+
**VolEsti** is a `C++` library for volume approximation and sampling of convex bodies (*e.g.* polytopes, spectrahedra) with an `R` interface. For a `Python` interface see [dingo](https://github.com/GeomScale/dingo). **VolEsti** is part of the [GeomScale](https://geomscale.github.io) project.
44

55
[![CRAN status](https://www.r-pkg.org/badges/version/volesti)](https://cran.r-project.org/package=volesti)
66
[![CRAN downloads](https://cranlogs.r-pkg.org/badges/volesti)](https://cran.r-project.org/package=volesti)
@@ -21,23 +21,86 @@
2121
[![R-CMD-macOS](https://github.com/GeomScale/volesti/workflows/R-CMD-check-macOS/badge.svg)](https://github.com/GeomScale/volesti/actions?query=workflow%3AR-CMD-macOS)
2222
[![R-CMD-windows](https://github.com/GeomScale/volesti/workflows/R-CMD-check-windows/badge.svg)](https://github.com/GeomScale/volesti/actions?query=workflow%3AR-CMD-windows)
2323

24+
### 📖 Citing VolEsti
25+
26+
If you use **volesti** in your research, please cite:
27+
28+
> A. Chalkis, V. Fisikopoulos, M. Papachristou, E. Tsigaridas.
29+
> **volesti: A C++ library for sampling and volume computation on convex bodies.**
30+
> *Journal of Open Source Software*, 10(108):7886, 2025.
31+
> [![DOI](https://joss.theoj.org/papers/10.21105/joss.07886/status.svg)](https://doi.org/10.21105/joss.07886)
32+
33+
For the R interface:
34+
> A. Chalkis, V. Fisikopoulos.
35+
> **volesti: Volume Approximation and Sampling for Convex Polytopes in R.**
36+
> *The R Journal*, 13(2):642–660, 2021.
37+
> DOI: [10.32614/RJ-2021-077](https://doi.org/10.32614/RJ-2021-077)
38+
39+
For specific algorithms (Cooling Balls, Reflective HMC, CRHMC, spectrahedra,
40+
etc.), see [Publications](docs/misc/publications.md) and
41+
[Research & Bibliography](docs/misc/research.md).
42+
43+
### 🚀 Quick Start
44+
45+
```cpp
46+
#include "volume/volume_cooling_hpoly.hpp"
47+
48+
// Define a 3D cube H-polytope
49+
Eigen::MatrixXd A(6, 3);
50+
Eigen::VectorXd b(6);
51+
A << 1, 0, 0,
52+
-1, 0, 0,
53+
0, 1, 0,
54+
0, -1, 0,
55+
0, 0, 1,
56+
0, 0, -1;
57+
b << 1, 1, 1, 1, 1, 1;
58+
HPolytope P(A, b);
59+
60+
// Approximate its volume
61+
std::pair<double, double> vol = volume(P); // ~8.0
62+
```
63+
64+
See [Getting Started](https://volesti.readthedocs.io/en/latest/getting_started/install.html)
65+
for full build instructions.
66+
67+
### ✨ Key Features
68+
69+
| Feature | Algorithms | Papers |
70+
|---------|-----------|--------|
71+
| **Volume Computation** | Cooling Balls (CB), Cooling Gaussians (CG), Sequence of Balls (SOB), CRHMC variants | Chalkis et al. 2023 ([JEA](https://doi.org/10.1145/3584182)); Emiris & Fisikopoulos 2018 ([TOMS](https://doi.org/10.1145/3194656)) |
72+
| **Uniform Sampling** | Billiard, Ball Walk, CDHR, RDHR, Dikin, John, Vaidya, Shake-and-Bake | Chalkis et al. 2019/2023; Emiris & Fisikopoulos 2014 ([SoCG](https://doi.org/10.1145/2582112.2582133)) |
73+
| **Log-Concave Sampling** | Reflective HMC, CRHMC, Langevin, NUTS, Boltzmann HMC | Chalkis et al. 2023 ([TOMS](https://doi.org/10.1145/3589505)); Kook et al. 2022 ([NeurIPS](https://arxiv.org/abs/2303.00480)) |
74+
| **Convex Body Types** | H-polytopes, V-polytopes, Zonotopes, Spectrahedra, Order Polytopes, general ConvexBody | Chalkis et al. 2022 ([LAA](https://doi.org/10.1016/j.laa.2022.04.002)) |
75+
| **Rounding** | SVD, inscribed ellipsoid, min-covering ellipsoid | Emiris & Fisikopoulos 2018 |
76+
| **SDP Solver** | Simulated Annealing + Reflective HMC | Chalkis et al. 2020/2023 |
77+
| **MCMC Diagnostics** | PSRF (Gelman-Rubin), ESS, Geweke, Raftery-Lewis | Gelman & Rubin 1992 |
78+
79+
Performance highlights:
80+
- Volume estimation scales to **thousands of dimensions** for H-polytopes
81+
- 20–130× faster than prior state-of-the-art on standard benchmarks
82+
- First practical volume estimation for V- and Z-polytopes
83+
- Sampled the **5,335-dimensional** Recon3D human metabolic network in <30 hours
84+
2485
### 📄 Documentation
2586
2687
* [Package documentation](https://volesti.readthedocs.io)
2788
* [Wikipage with Tutorials and Demos](https://github.com/GeomScale/volesti/wiki)
28-
* [Tutorial given to PyData meetup](https://vissarion.github.io/tutorials/volesti_tutorial_pydata.html)
89+
* [Research & Bibliography](docs/misc/research.md) — paper-to-code mapping
90+
* [Publications](docs/misc/publications.md) — complete bibliography
2991
* [Tutorial on (truncated) logconcave sampling (R and C++)](https://papachristoumarios.github.io/2020/07/21/Sampling-from-high-dimensional-truncated-log-concave-densities-with-volesti)
3092
* [Contributing](CONTRIBUTING.md)
3193
3294
### ⭐ Credits
3395
3496
* [Contributors and Package History](docs/misc/credits.md)
3597
* [List of Publications](docs/misc/publications.md)
98+
* [Research & Bibliography](docs/misc/research.md)
3699
37100
### © Copyright and Licensing
38101
39-
Copyright (c) 2012-2024 Vissarion Fisikopoulos\
40-
Copyright (c) 2018-2024 Apostolos Chalkis\
41-
Copyright (c) 2020-2024 Elias Tsigaridas
102+
Copyright (c) 2012–2025 Vissarion Fisikopoulos\
103+
Copyright (c) 2018–2025 Apostolos Chalkis\
104+
Copyright (c) 2020–2025 Elias Tsigaridas
42105
43-
You may redistribute or modify the software under the [GNU Lesser General Public License](/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.
106+
You may redistribute or modify the software under the [GNU Lesser General Public License](/LICENSE) as published by the 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.

codecov.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Codecov configuration for volesti
2+
# https://docs.codecov.com/docs/codecovyml-reference
3+
4+
coverage:
5+
status:
6+
project:
7+
default:
8+
target: auto
9+
threshold: 1%
10+
patch:
11+
default:
12+
target: auto
13+
14+
# Fix path mapping for CI runner
15+
fixes:
16+
- "/home/runner/work/volesti/volesti/::"
17+
18+
ignore:
19+
- "external/"
20+
- "test/"
21+
- "_deps/"
22+
- "examples/"
23+
- "R-proj/"
24+
25+
comment:
26+
layout: "reach, diff, flags, files"
27+
behavior: default
28+
require_changes: false

docs/Doxyfile.in

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ PROJECT_NUMBER =
4444
# for a project that appears at the top of each page and should give viewer a
4545
# quick idea about the purpose of the project. Keep the description short.
4646

47-
PROJECT_BRIEF =
47+
PROJECT_BRIEF = "C++ library for volume approximation and sampling of convex bodies"
4848

4949
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
5050
# in the documentation. The maximum height of the logo should not exceed 55
@@ -195,7 +195,7 @@ SHORT_NAMES = NO
195195
# description.)
196196
# The default value is: NO.
197197

198-
JAVADOC_AUTOBRIEF = NO
198+
JAVADOC_AUTOBRIEF = YES
199199

200200
# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
201201
# such as
@@ -467,7 +467,7 @@ LOOKUP_CACHE_SIZE = 0
467467
# normally produced when WARNINGS is set to YES.
468468
# The default value is: NO.
469469

470-
EXTRACT_ALL = NO
470+
EXTRACT_ALL = YES
471471

472472
# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
473473
# be included in the documentation.
@@ -829,7 +829,8 @@ WARN_LOGFILE =
829829
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
830830
# Note: If this tag is empty the current directory is searched.
831831

832-
INPUT = ../include
832+
INPUT = ../include \
833+
../docs/mainpage_doxygen.md
833834

834835
# This tag can be used to specify the character encoding of the source files
835836
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -944,13 +945,19 @@ EXCLUDE_PATTERNS =
944945
# Note that the wildcards are matched against the file with absolute path, so to
945946
# exclude all test directories use the pattern */test/*
946947

947-
EXCLUDE_SYMBOLS =
948+
EXCLUDE_SYMBOLS = Eigen::* \
949+
std::* \
950+
ifopt::* \
951+
cxxtimer::* \
952+
boost::* \
953+
matplotlibcpp::* \
954+
autodiff::*
948955

949956
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
950957
# that contain example code fragments that are included (see the \include
951958
# command).
952959

953-
EXAMPLE_PATH =
960+
EXAMPLE_PATH = ../examples
954961

955962
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
956963
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -964,7 +971,7 @@ EXAMPLE_PATTERNS = *
964971
# irrespective of the value of the RECURSIVE tag.
965972
# The default value is: NO.
966973

967-
EXAMPLE_RECURSIVE = NO
974+
EXAMPLE_RECURSIVE = YES
968975

969976
# The IMAGE_PATH tag can be used to specify one or more files or directories
970977
# that contain images that are to be included in the documentation (see the
@@ -1026,7 +1033,7 @@ FILTER_SOURCE_PATTERNS =
10261033
# (index.html). This can be useful if you have a project on for instance GitHub
10271034
# and want to reuse the introduction page also for the doxygen output.
10281035

1029-
USE_MDFILE_AS_MAINPAGE =
1036+
USE_MDFILE_AS_MAINPAGE = mainpage_doxygen.md
10301037

10311038
#---------------------------------------------------------------------------
10321039
# Configuration options related to source browsing

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# -- Project information -----------------------------------------------------
2727

2828
project = 'VolEsti'
29-
copyright = '2022, Vissarion Fisikopoulos, Apostolos Chalkis, Elias Tsigaridas'
29+
copyright = '2012–2025, Vissarion Fisikopoulos, Apostolos Chalkis, Elias Tsigaridas'
3030
author = 'Vissarion Fisikopoulos, Apostolos Chalkis, Elias Tsigaridas'
3131

3232

@@ -38,7 +38,7 @@
3838
extensions = [
3939
'sphinx.ext.autodoc',
4040
'sphinx.ext.intersphinx',
41-
'sphinx.ext.autosectionlabel',
41+
# 'sphinx.ext.autosectionlabel', # Disabled: duplicate labels across howto/theory pages
4242
'sphinx.ext.todo',
4343
'sphinx.ext.coverage',
4444
'sphinx.ext.mathjax',

docs/getting_started/cpp_example.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# How to create your first example using the C++ interface
22

3-
Here we give step-by-step instructions for how to estimate the volume of a 3-dimensional cube using `volesti` library.
3+
Here we give step-by-step instructions for how to estimate the volume of a 3-dimensional cube using `volesti` library. The example uses the **Cooling Balls (CB)** algorithm.
4+
5+
📚 **Reference:** A. Chalkis, I.Z. Emiris, V. Fisikopoulos.
6+
*A Practical Algorithm for Volume Estimation based on Billiard Trajectories and
7+
Simulated Annealing.* ACM JEA, 28:1.3, 2023.
8+
DOI: [10.1145/3584182](https://doi.org/10.1145/3584182)
49

510
Write the following C++ code and save it in `volume_example.cpp`
611

docs/getting_started/install.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Installation Guide
22
==================
33

4+
📚 **Reference:** A. Chalkis, V. Fisikopoulos, M. Papachristou, E. Tsigaridas.
5+
*volesti: A C++ library for sampling and volume computation on convex bodies.*
6+
JOSS, 10(108):7886, 2025.
7+
DOI: [10.21105/joss.07886](https://doi.org/10.21105/joss.07886)
8+
49
## C++ Interface
510

611
### Compile C++ sources and run tests

0 commit comments

Comments
 (0)