geosets-rs

Crates.iogeosets-rs
lib.rsgeosets-rs
version0.1.1
created_at2025-08-21 09:14:09.314159+00
updated_at2025-08-29 10:44:36.397157+00
descriptionA Rust library for continuous set arithmetic.
homepage
repositoryhttps://rolandstolz.github.io/
max_upload_size
id1804484
size200,936
(RolandStolz)

documentation

https://rolandstolz.github.io/geosets-rs/geosets_rs/

README

geosets-rs

CI Coverage Status Crates.io docs.rs License

A Rust library for continuous set arithmetic.

Features

The following set representations are supported

  • H-Polytopes (Half-space representation)
  • V-Polytopes (Vertex representation)
  • Zonotopes
  • Intervals

Installation

Add this to your Cargo.toml:

cargo add geosets-rs

System Dependencies

This library depends on several system libraries that need to be installed:

Ubuntu/Debian

sudo apt-get install libcdd-dev libopenblas-dev liblapack-dev pkg-config clang libclang-dev coinor-cbc coinor-libcbc-dev

macOS

brew install cddlib openblas lapack

Usage

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();

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Commit count: 0

cargo fmt