Return a map whose root node is a full inner node, and the leaf nodes are all full containing: 110, 120, ..., 170 210, 220, ..., 270 ... 810, 820, ..., 870
(f: &mut MapForest<u32, f32>)
| 1076 | // ... |
| 1077 | // 810, 820, ..., 870 |
| 1078 | fn full(f: &mut MapForest<u32, f32>) -> Map<u32, f32> { |
| 1079 | let mut m = Map::new(); |
| 1080 | |
| 1081 | // Start by inserting elements in order. |
| 1082 | // This should leave 8 leaf nodes with 4 elements in each. |
| 1083 | for row in 1..9 { |
| 1084 | for col in 1..5 { |
| 1085 | m.insert(row * 100 + col * 10, row as f32 + col as f32 * 0.1, f, &()); |
| 1086 | } |
| 1087 | } |
| 1088 | |
| 1089 | // Then top up the leaf nodes without splitting them. |
| 1090 | for row in 1..9 { |
| 1091 | for col in 5..8 { |
| 1092 | m.insert(row * 100 + col * 10, row as f32 + col as f32 * 0.1, f, &()); |
| 1093 | } |
| 1094 | } |
| 1095 | |
| 1096 | m |
| 1097 | } |
| 1098 | |
| 1099 | let mut m = full(f); |
| 1100 | // Verify geometry. Get get node2 as the root and leaves node0, 1, 3, ... |