1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//! Implements bit matrices.
//!
//! # Examples
//!
//! Gets a mutable reference to the square bit matrix within this
//! rectangular matrix, then performs a transitive closure.
//!
//! ```rust
//! use bit_matrix::BitMatrix;
//!
//! let mut matrix = <BitMatrix>::new(7, 5);
//! matrix.set(1, 2, true);
//! matrix.set(2, 3, true);
//! matrix.set(3, 4, true);
//!
//! {
//! let mut sub_matrix = matrix.sub_matrix_mut(1 .. 6);
//! sub_matrix.transitive_closure();
//! }
//! assert!(matrix[(1, 4)]);
//!
//! matrix.reflexive_closure();
//! assert!(matrix[(0, 0)]);
//! assert!(matrix[(1, 1)]);
//! assert!(matrix[(2, 2)]);
//! assert!(matrix[(3, 3)]);
//! ```
//!
//! This simple example calculates the transitive closure of 4x4 bit matrix.
//!
//! ```rust
//! use bit_matrix::BitMatrix;
//!
//! let mut matrix = <BitMatrix>::new(4, 4);
//! let points = &[
//! (0, 0),
//! (0, 1),
//! (0, 3),
//! (1, 0),
//! (1, 2),
//! (2, 0),
//! (2, 1),
//! (3, 1),
//! (3, 3),
//! ];
//! for &(i, j) in points {
//! matrix.set(i, j, true);
//! }
//! matrix.transitive_closure();
//!
//! let mut expected_matrix = BitMatrix::new(4, 4);
//! for i in 0..4 {
//! for j in 0..4 {
//! expected_matrix.set(i, j, true);
//! }
//! }
//!
//! assert_eq!(matrix, expected_matrix);
//! ```
pub use BitMatrix;
pub