Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center"><img src="docs/logo/volesti_logo.jpg"></p>

**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.
**VolEsti** is a `C++` library for volume approximation and sampling of convex bodies (*e.g.* polytopes) with interfaces for `R`, `Python`, and `GNU Octave`. An `R` interface is available on [CRAN](https://CRAN.R-project.org/package=volesti). For a limited `Python` interface we refer to package [dingo](https://github.com/GeomScale/dingo). An `Octave` package interface is available in the `octave/` directory of this repository. **VolEsti** is part of the [GeomScale](https://geomscale.github.io) project.

[![CRAN status](https://www.r-pkg.org/badges/version/volesti)](https://cran.r-project.org/package=volesti)
[![CRAN downloads](https://cranlogs.r-pkg.org/badges/volesti)](https://cran.r-project.org/package=volesti)
Expand Down
23 changes: 23 additions & 0 deletions docs/getting_started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,27 @@ An ``R`` interface is available from the package [Rvolesti](https://github.com/G

A ``python`` interface is available from the package [dingo](https://github.com/GeomScale/dingo).

## Octave Interface

An ``Octave`` package interface is available in the `octave/` directory of this repository. To install:

1. Install prerequisites: Octave (>= 5.1.0), C++ compiler with C++17 support, CMake (>= 3.11), Eigen3, Boost, and lp_solve.

2. Build the MEX files:
```bash
cd octave/src
mkdir build && cd build
cmake ..
make
```

3. Install the package from within Octave:
```octave
cd octave
pkg install .
pkg load volesti
```

For detailed instructions, see [octave/README.md](../../octave/README.md).


9 changes: 9 additions & 0 deletions octave/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Build directories
src/build/
src/*.oct
inst/*.oct

# Octave package files
inst/*.oct
*.tar.gz

3 changes: 3 additions & 0 deletions octave/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This package is distributed under the GNU Lesser General Public License, version 3 or later.
See the LICENSE file in the parent directory for full license text.

13 changes: 13 additions & 0 deletions octave/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Name: volesti
Version: 1.0.0
Date: 2025-01-03
Title: Volume Estimation and Sampling of Convex Bodies
Author: Vissarion Fisikopoulos, Apostolos Chalkis, Elias Tsigaridas, and contributors
Maintainer: VolEsti Team
Description: VolEsti is a C++ library for volume approximation and sampling of convex bodies (e.g. polytopes). This package provides an Octave interface to the VolEsti library, allowing Octave users to compute volumes and sample from convex polytopes using native Octave code.
License: LGPL-3.0-or-later
Categories: Mathematics, Statistics, Numerical Methods
Url: https://github.com/GeomScale/volesti
Depends: octave (>= 5.1.0)
SystemRequirements: C++ compiler with C++17 support, CMake (>= 3.11), Eigen3, Boost, lp_solve

10 changes: 10 additions & 0 deletions octave/INDEX
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
polytope >> Polytope operations
volume >> Polytope volume computation
sample_points >> Sampling from polytopes
GenCube >> Generate hypercube polytope
test_gencube >> Test GenCube function
test_volume >> Test volume computation
test_sampling >> Test sampling functions
volesti_test >> Comprehensive test suite
runtests >> Run all test suites

88 changes: 88 additions & 0 deletions octave/INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
INSTALLATION INSTRUCTIONS FOR VOLESTI OCTAVE PACKAGE
=====================================================

Prerequisites
-------------

1. Octave (version 5.1.0 or later)
- Download from: https://www.gnu.org/software/octave/download.html
- Or install via package manager (apt, brew, etc.)

2. C++ compiler with C++17 support
- GCC 7+ or Clang 5+ on Linux/Mac
- MSVC 2017+ on Windows

3. CMake (>= 3.11)
- Download from: https://cmake.org/download/

4. Required libraries:
- Eigen3 (>= 3.3)
- Boost libraries
- lp_solve

On Ubuntu/Debian:
sudo apt-get install libeigen3-dev libboost-all-dev lp-solve liblpsolve55-dev

On macOS (with Homebrew):
brew install eigen boost lp_solve

On Windows:
Use vcpkg or install manually

Building the MEX Files
----------------------

1. Navigate to the source directory:
cd octave/src

2. Create build directory and configure:
mkdir build
cd build
cmake ..

On Windows (PowerShell or Command Prompt):
mkdir build
cd build
cmake ..

3. Build:
make # Linux/Mac

On Windows:
cmake --build . --config Release

4. The compiled .oct files should appear in octave/inst/

Installing the Package
-----------------------

1. From within Octave, navigate to the octave directory:
cd octave

2. Install the package:
pkg install .

3. Load the package:
pkg load volesti

4. Test the installation:
volesti_example

Troubleshooting
---------------

- If octave-config is not found:
- Ensure Octave is in your PATH
- Or specify the path manually in CMakeLists.txt

- If MEX files fail to load:
- Check that all dependencies are installed
- Verify that .oct files are in the inst/ directory
- Try rebuilding with verbose output

- Build errors related to Eigen or Boost:
- Ensure include paths are correct in CMakeLists.txt
- Check that library versions are compatible

For more help, see octave/README.md or the main project documentation.

84 changes: 84 additions & 0 deletions octave/PR_INSTRUCTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Instructions for Creating Pull Request

## Step 1: Fork the Repository (if not already done)

1. Go to https://github.com/GeomScale/volesti
2. Click the "Fork" button in the top right
3. This creates a copy at https://github.com/YOUR_USERNAME/volesti

## Step 2: Add Your Fork as a Remote

Replace `YOUR_USERNAME` with your actual GitHub username:

```bash
git remote add fork https://github.com/YOUR_USERNAME/volesti.git
```

## Step 3: Push Your Branch to Your Fork

```bash
git push -u fork interface-to-GNU-Octave-language
```

## Step 4: Create Pull Request via GitHub Web Interface

1. Go to https://github.com/YOUR_USERNAME/volesti
2. You should see a banner saying "interface-to-GNU-Octave-language had recent pushes"
3. Click the "Compare & pull request" button
4. Or manually:
- Go to https://github.com/GeomScale/volesti
- Click "Pull requests" tab
- Click "New pull request"
- Select "compare across forks"
- Base repository: `GeomScale/volesti`, base: `develop`
- Head repository: `YOUR_USERNAME/volesti`, compare: `interface-to-GNU-Octave-language`
- Click "Create pull request"

## Step 5: Fill in Pull Request Details

Use this title:
```
Add GNU Octave interface package for VolEsti
```

And this description (see `octave/PULL_REQUEST.md` for full details):

```markdown
## Summary

This PR adds a complete GNU Octave package interface for VolEsti, allowing Octave users to use the library with native Octave code.

## Features

- Volume computation with multiple algorithms
- Uniform sampling with various random walk methods
- Polytope generation (hypercubes)
- Comprehensive test suite
- Complete documentation

## Implementation

- MEX interfaces for C++ library (`volesti_volume_mex.cpp`, `volesti_sample_mex.cpp`)
- Octave wrapper functions (`volume()`, `sample_points()`, `GenCube()`)
- Test suite with 11+ test cases
- Build system with CMake
- Installation and usage documentation

See `octave/README.md` and `octave/PULL_REQUEST.md` for more details.
```

## Alternative: Using GitHub CLI (if installed)

If you have GitHub CLI (`gh`) installed:

```bash
# Authenticate (if not already done)
gh auth login

# Push to fork
git push -u fork interface-to-GNU-Octave-language

# Create PR
gh pr create --base develop --title "Add GNU Octave interface package for VolEsti" --body-file octave/PULL_REQUEST.md
```

87 changes: 87 additions & 0 deletions octave/PULL_REQUEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Pull Request: GNU Octave Interface for VolEsti

## Summary

This PR adds a complete GNU Octave package interface for VolEsti, allowing Octave users to use the library with native Octave code.

## Changes

### Package Structure
- Complete Octave package structure following Octave package conventions
- `DESCRIPTION`, `COPYING`, `INDEX` files for package metadata
- Installation instructions (`INSTALL`, `README.md`)

### Implementation
- **MEX Interfaces** (`src/`):
- `volesti_volume_mex.cpp` - Volume computation MEX interface
- `volesti_sample_mex.cpp` - Sampling MEX interface
- `CMakeLists.txt` - Build configuration for MEX files
- Build scripts for Linux/Windows

- **Octave Functions** (`inst/`):
- `volume()` - Compute volume of polytopes
- `sample_points()` - Sample uniform points from polytopes
- `GenCube()` - Generate hypercube polytopes
- `volesti()` - Package information function
- `volesti_example()` - Example script

- **Test Suite** (`inst/`):
- `volesti_test()` - Comprehensive test suite (11 test cases)
- `test_gencube()` - Polytope generation tests
- `test_volume()` - Volume computation tests
- `test_sampling()` - Sampling tests
- `runtests()` - Test runner

### Documentation
- Texinfo documentation (`doc/volesti.texi`)
- Updated main `README.md` with Octave interface information
- Updated `docs/getting_started/install.md` with installation instructions
- Package README with usage examples

## Features

### Volume Computation
- Multiple algorithms: sequence_of_balls, cooling_gaussians
- Customizable error tolerance
- Support for H-polytopes (Ax <= b)

### Sampling
- Multiple random walk methods:
- CDHR (Coordinate Directions Hit-and-Run)
- RDHR (Random Directions Hit-and-Run)
- Ball Walk
- Billiard Walk
- Customizable walk length and burn-in steps

### Polytope Generation
- Hypercube generator with customizable dimensions and scale

## Testing

Comprehensive test suite included:
- Functionality tests for all main functions
- Error handling and input validation
- Edge cases (different dimensions, parameters)
- All tests can be run with `runtests()`

## Installation

See `octave/README.md` and `octave/INSTALL` for detailed installation instructions.

## Status

✅ Package structure complete
✅ MEX interfaces implemented
✅ Octave wrapper functions implemented
✅ Test suite created
✅ Documentation added
✅ Build system configured
⚠️ Needs compilation and testing on target platforms

## Next Steps

1. Build and test on Linux, macOS, and Windows
2. Verify compatibility with different Octave versions
3. Submit to Octave Packages index after testing
4. Add CI/CD for automated testing

Loading