Commit 96f4404
find_best_packing: store orders side-by-side in a single vector (#15)
* initial
* remove .cache/
* re-constify rect reference in all_inserted
* properly resize vector every time
* find_best_packing: put order vector on stack instead of TLS
* replace std::span with templated iterators
* remove unused type alias
* fix whitespace
* merge changes
* fix whitespace
* pointers instead of iterators + correctly set vector size
* remove unused typedef
* fix: resize before copy to ensure proper end() pointer
* restore example.cpp
* find_best_packing: return early if there are no subjects
* example: clarify raw arrays can be used
* find_best_packing_dont_sort: fix edge case of empty subjects
* example: clarify necessary STL container functions
* remove extraneous scope
* fix whitespace
* example: restore rectangle sizes
* relocate empty subject list check to find_best_packing_impl
* backtrack certain changes; use unique_ptr for storing rects
* example: document std::size() subject requirement
* use std::pair<iterator, iterator> as a makeshift std::span
* compile fix: missing <memory>
* find_best_packing_impl: use std::optional for best order iterator
* find_best_packing_impl: move both iterators into std::optional
* best_packing_for_ordering(_impl): switch back to generic O ordering
* example: fix whitespace
* find_best_packing: rename count_subjects to count_valid_subjects
* find_best_packing_impl: re-add scope braces
* find_best_packing_impl: remove unnecessary comment
* find_best_packing_impl: alias iterator pair as OrderType
* preserve order_type
* example: fix whitespace
* best_bin_finder: fix whitespace
* finders_interface: fix whitespace
* finders_interface: fix whitespace
* Revert "finders_interface: fix whitespace"
This reverts commit c96e235.
* find_best_packing_impl: const-ify OrderType& in for_each_order lambda
* best_bin_finder: de-format
* Apply suggestion from @geneotech
* Apply suggestion from @geneotech
* Apply suggestion from @geneotech
* comments
* comments
* adjust scope
* emulate span to simplify loops
* more readable loop
* simplify loops with ith_order lambda
* adjust
* adjust
* const
---------
Co-authored-by: geneotech <patryk.czachurski@gmail.com>
Co-authored-by: Patryk Czachurski <patryk.czachurski@softnet.pl>1 parent 119eb11 commit 96f4404
File tree
4 files changed
+78
-31
lines changed- example
- src/rectpack2D
4 files changed
+78
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
121 | 123 | | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
126 | | - | |
| 128 | + | |
| 129 | + | |
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
7 | 24 | | |
8 | 25 | | |
9 | 26 | | |
| |||
216 | 233 | | |
217 | 234 | | |
218 | 235 | | |
219 | | - | |
| 236 | + | |
220 | 237 | | |
221 | 238 | | |
222 | 239 | | |
| |||
229 | 246 | | |
230 | 247 | | |
231 | 248 | | |
232 | | - | |
| 249 | + | |
233 | 250 | | |
234 | 251 | | |
235 | 252 | | |
| |||
242 | 259 | | |
243 | 260 | | |
244 | 261 | | |
245 | | - | |
| 262 | + | |
246 | 263 | | |
247 | | - | |
| 264 | + | |
248 | 265 | | |
249 | 266 | | |
250 | 267 | | |
251 | 268 | | |
252 | 269 | | |
253 | 270 | | |
254 | 271 | | |
255 | | - | |
| 272 | + | |
256 | 273 | | |
257 | 274 | | |
258 | 275 | | |
259 | 276 | | |
260 | 277 | | |
261 | 278 | | |
262 | | - | |
| 279 | + | |
263 | 280 | | |
264 | 281 | | |
265 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | | - | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
80 | | - | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | | - | |
| 86 | + | |
84 | 87 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
89 | 91 | | |
90 | | - | |
91 | | - | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
98 | 116 | | |
99 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
100 | 122 | | |
101 | 123 | | |
102 | 124 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 125 | + | |
| 126 | + | |
106 | 127 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
111 | 132 | | |
112 | | - | |
113 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
114 | 136 | | |
115 | 137 | | |
116 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
117 | 143 | | |
118 | 144 | | |
119 | 145 | | |
| |||
0 commit comments