Skip to content

Commit 2ab3e9e

Browse files
jturner314bluss
authored andcommitted
Add illustration of .windows() method
1 parent e35987c commit 2ab3e9e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/impl_methods.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,28 @@ where
11171117
/// **Panics** if any dimension of `window_size` is zero.<br>
11181118
/// (**Panics** if `D` is `IxDyn` and `window_size` does not match the
11191119
/// number of array axes.)
1120+
///
1121+
/// This is an illustration of the 2×2 windows in a 3×4 array:
1122+
///
1123+
/// ```text
1124+
/// ──▶ Axis(1)
1125+
///
1126+
/// │ ┏━━━━━┳━━━━━┱─────┬─────┐ ┌─────┲━━━━━┳━━━━━┱─────┐ ┌─────┬─────┲━━━━━┳━━━━━┓
1127+
/// ▼ ┃ a₀₀ ┃ a₀₁ ┃ │ │ │ ┃ a₀₁ ┃ a₀₂ ┃ │ │ │ ┃ a₀₂ ┃ a₀₃ ┃
1128+
/// Axis(0) ┣━━━━━╋━━━━━╉─────┼─────┤ ├─────╊━━━━━╋━━━━━╉─────┤ ├─────┼─────╊━━━━━╋━━━━━┫
1129+
/// ┃ a₁₀ ┃ a₁₁ ┃ │ │ │ ┃ a₁₁ ┃ a₁₂ ┃ │ │ │ ┃ a₁₂ ┃ a₁₃ ┃
1130+
/// ┡━━━━━╇━━━━━╃─────┼─────┤ ├─────╄━━━━━╇━━━━━╃─────┤ ├─────┼─────╄━━━━━╇━━━━━┩
1131+
/// │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1132+
/// └─────┴─────┴─────┴─────┘ └─────┴─────┴─────┴─────┘ └─────┴─────┴─────┴─────┘
1133+
///
1134+
/// ┌─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┐
1135+
/// │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
1136+
/// ┢━━━━━╈━━━━━╅─────┼─────┤ ├─────╆━━━━━╈━━━━━╅─────┤ ├─────┼─────╆━━━━━╈━━━━━┪
1137+
/// ┃ a₁₀ ┃ a₁₁ ┃ │ │ │ ┃ a₁₁ ┃ a₁₂ ┃ │ │ │ ┃ a₁₂ ┃ a₁₃ ┃
1138+
/// ┣━━━━━╋━━━━━╉─────┼─────┤ ├─────╊━━━━━╋━━━━━╉─────┤ ├─────┼─────╊━━━━━╋━━━━━┫
1139+
/// ┃ a₂₀ ┃ a₂₁ ┃ │ │ │ ┃ a₂₁ ┃ a₂₂ ┃ │ │ │ ┃ a₂₂ ┃ a₂₃ ┃
1140+
/// ┗━━━━━┻━━━━━┹─────┴─────┘ └─────┺━━━━━┻━━━━━┹─────┘ └─────┴─────┺━━━━━┻━━━━━┛
1141+
/// ```
11201142
pub fn windows<E>(&self, window_size: E) -> Windows<'_, A, D>
11211143
where
11221144
E: IntoDimension<Dim = D>,

0 commit comments

Comments
 (0)