Crates.io | geosets-rs |
lib.rs | geosets-rs |
version | 0.1.1 |
created_at | 2025-08-21 09:14:09.314159+00 |
updated_at | 2025-08-29 10:44:36.397157+00 |
description | A Rust library for continuous set arithmetic. |
homepage | |
repository | https://rolandstolz.github.io/ |
max_upload_size | |
id | 1804484 |
size | 200,936 |
A Rust library for continuous set arithmetic.
The following set representations are supported
Add this to your Cargo.toml
:
cargo add geosets-rs
This library depends on several system libraries that need to be installed:
sudo apt-get install libcdd-dev libopenblas-dev liblapack-dev pkg-config clang libclang-dev coinor-cbc coinor-libcbc-dev
brew install cddlib openblas lapack
use geosets_rs::{HPolytope, sets::GeoSet};
let set = HPolytope::from_random(2, 4).unwrap();
// Convert to vertices
let _vertices = set.to_vertices().unwrap();
// Calculate volume
let volume = set.volume().unwrap();
println!("Volume: {}", volume);
// Translate the set
let translation = ndarray::Array1::ones(2);
let translated = set.translate(&translation).unwrap();
// Plot
let mut plot = translated.plot((0, 1), true, false).unwrap();
// Plot with original
let original_trace = set
.create_trace((0, 1), Some("Original VPolytope"))
.unwrap();
plot.add_trace(original_trace);
// Uncomment to show
// plot.show();
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.