|
16 | 16 | //! use coupe::Partition as _; |
17 | 17 | //! use coupe::Point2D; |
18 | 18 | //! |
19 | | -//! // define coordinates, weights and graph |
20 | | -//! # let coordinates: [Point2D; 9] = [ |
| 19 | +//! // define coordinates |
| 20 | +//! let coordinates: [Point2D; 9] = [ |
| 21 | +//! // define some points |
21 | 22 | //! # Point2D::new(0.0, 0.0), |
22 | 23 | //! # Point2D::new(0.0, 1.0), |
23 | 24 | //! # Point2D::new(0.0, 2.0), |
|
27 | 28 | //! # Point2D::new(2.0, 0.0), |
28 | 29 | //! # Point2D::new(2.0, 1.0), |
29 | 30 | //! # 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 |
33 | 37 | //! # let mut g = sprs::CsMat::empty(sprs::CSR, 9); |
34 | 38 | //! # g.insert(0, 1, 1); |
35 | 39 | //! # g.insert(0, 3, 1); |
|
56 | 60 | //! # g.insert(8, 5, 1); |
57 | 61 | //! # g.insert(8, 7, 1); |
58 | 62 | //! # 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))?; |
60 | 70 | //! ``` |
61 | 71 | //! |
62 | 72 | //! ## Geometric Partitioning |
|
0 commit comments