Crates.io | harness-space |
lib.rs | harness-space |
version | 0.7.0 |
created_at | 2025-04-29 13:05:30.114064+00 |
updated_at | 2025-05-23 19:55:06.059064+00 |
description | The library for topological and other spaces |
homepage | |
repository | https://github.com/harness-labs/space |
max_upload_size | |
id | 1653513 |
size | 252,341 |
A Rust library providing mathematical structures and operations for topological spaces, simplicial complexes, and graphs. This crate is designed to support computational topology and geometry applications.
Topological Spaces: Implementation of fundamental topological concepts
Simplicial Complexes: Tools for working with simplicial complexes
Graph Theory: Flexible graph data structures
use harness_space::definitions::{Set, TopologicalSpace, MetricSpace};
// Define your own space type
struct MySpace {
// ... implementation details
}
struct MyPoint {
// ... implementation details
}
impl Set for MySpace {
type Point = MyPoint;
// ... implement set operations
}
impl TopologicalSpace for MySpace {
type Point = MyPoint;
type OpenSet = MyOpenSet;
// ... implement topological operations
}
use harness_space::complexes::{Simplex, SimplicialComplex};
// Create a simplex (e.g., a triangle)
let triangle = Simplex::new(2, vec![0, 1, 2]);
// Create a simplicial complex
let mut complex = SimplicialComplex::new();
complex.join_element(triangle);
use harness_space::graph::{Graph, Undirected};
use std::collections::HashSet;
// Create a graph
let mut vertices = HashSet::new();
vertices.insert(1);
vertices.insert(2);
let mut edges = HashSet::new();
edges.insert((1, 2));
let graph = Graph::<usize, Undirected>::new(vertices, edges);