Skip to content

Commit bc3dc75

Browse files
top example, in progress.
1 parent b043aa2 commit bc3dc75

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/lib.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
//! use coupe::Partition as _;
1717
//! use coupe::Point2D;
1818
//!
19-
//! // define coordinates, weights and graph
20-
//! # let coordinates: [Point2D; 9] = [
19+
//! // define coordinates
20+
//! let coordinates: [Point2D; 9] = [
21+
//! // define some points
2122
//! # Point2D::new(0.0, 0.0),
2223
//! # Point2D::new(0.0, 1.0),
2324
//! # Point2D::new(0.0, 2.0),
@@ -27,9 +28,12 @@
2728
//! # Point2D::new(2.0, 0.0),
2829
//! # Point2D::new(2.0, 1.0),
2930
//! # Point2D::new(2.0, 2.0),
30-
//! # ];
31-
//! # let weights: [f64; 9] = [1.0, 2.0, 3.0, 2.0, 3.0, 4.0, 3.0, 4.0, 5.0];
32-
//! # let graph: sprs::CsMat<i64> = {
31+
//! ];
32+
//! // Define weights
33+
//! let weights: [f64; 9] = [1.0, 2.0, 3.0, 2.0, 3.0, 4.0, 3.0, 4.0, 5.0];
34+
//! // define graph
35+
//! let graph: sprs::CsMat<i64> = {
36+
//! // define topology
3337
//! # let mut g = sprs::CsMat::empty(sprs::CSR, 9);
3438
//! # g.insert(0, 1, 1);
3539
//! # g.insert(0, 3, 1);
@@ -56,7 +60,13 @@
5660
//! # g.insert(8, 5, 1);
5761
//! # g.insert(8, 7, 1);
5862
//! # g
59-
//! # };
63+
//! };
64+
//!
65+
//! let mut partition = [0; 8];
66+
//!
67+
//! // generate a partition of 4 parts
68+
//! coupe::Rcb { iter_count: 2, ..Default::default() }
69+
//! .partition(&mut partition, (points, weights))?;
6070
//! ```
6171
//!
6272
//! ## Geometric Partitioning

0 commit comments

Comments
 (0)