Commit Graph
22 Commits
Author SHA1 Message Date
Bruce Mitchener 3cfdbd6717 Use noexcept on swap, move constructors, etc. 2024-02-17 11:04:10 +01:00
Behdad Esfahbod 9c4d3c3c70 [graph] Pre-alloc priority-heap array 2023-11-10 12:26:02 -07:00
Qunxin Liu 1f395cbaf9 [instancer] templatize the priority queue, use custom type for varstore
when instantiating varstore, we need to pop a tuple like
(combined_gain, i, j), if combined gain is the same then we compare the
value of i, and then j. So we'd like to use custom type as the key when
popping from the queue. This would match fonttool's algorithm cause it
uses heappop().
2023-10-13 14:52:27 -06:00
Behdad Esfahbod d9cf9b5f07 [priority-queue] Inline insert() 2023-07-14 12:19:10 -06:00
Behdad Esfahbod 5e42f7bb6d Revert "Revert "[priority-queue] Inline a couple more""
This reverts commit 915410e526.

Mistake.
2023-07-14 11:26:38 -06:00
Behdad Esfahbod 915410e526 Revert "[priority-queue] Inline a couple more"
This reverts commit 8704d73213.
2023-07-14 11:19:12 -06:00
Behdad Esfahbod 8704d73213 [priority-queue] Inline a couple more 2023-07-10 18:11:50 -06:00
Behdad Esfahbod 4c9e8b848b [priority-queue] Always-inline a method 2023-07-10 18:04:03 -06:00
Behdad Esfahbod fc24ffbfb3 [priority-queue] Minor simplify
Tail-recursion definitely was being optimized by compiler,
but I prefer writing it this way.
2023-07-09 11:05:52 -06:00
Behdad Esfahbod 8e43e3a8ce [priority-heap] Comment 2023-04-22 10:16:43 -06:00
Behdad Esfahbod 097fb8b8aa [priority-queue] Use resize instead of shrink
To avoid reallocation of smaller array. Not desirable here.
2023-01-05 14:38:10 -07:00
Behdad Esfahbod a7fee43cef [priority-queue] Minor micro-optimize 2022-11-23 17:46:32 -07:00
Behdad Esfahbod 02949cf64f [priority-queue] More assert adjustment 2022-11-16 12:06:44 -07:00
Behdad Esfahbod 620ddd762d [priority-queue] Fix asserts 2022-11-16 12:04:35 -07:00
Garret Rieger 73b8360dcf [subset] fix fuzzer found underflow when heap push fails.
Fixes https://oss-fuzz.com/testcase-detail/5148625505746944.
2022-05-19 17:02:34 -06:00
Behdad Esfahbod 6b62c10f02 [priority-queue] Remove old init/fini 2022-05-18 16:27:54 -06:00
Behdad Esfahbod 39a424caf0 [priority-queue] Optimize heap access 2022-05-18 16:19:44 -06:00
Behdad Esfahbod 9308659fd7 [priority-queue] Optimize swap() 2022-05-18 16:14:25 -06:00
Garret Rieger f561fa6e4c Change priority queue to use (priority, value) instead of (value, priority). 2021-03-18 11:13:47 -07:00
Garret Rieger 59ac0a0d0a [subset] Use priority for comparison in heap. 2021-03-17 15:53:57 -07:00
Garret Rieger 4c8dd41ed9 [subset] re-write compute distances to use an array lookup for the distance map. 2021-03-17 15:53:57 -07:00
Garret Rieger 5c4e0ffd97 [subset] Add a basic priority queue datastructure (binary heap). 2021-03-17 15:53:57 -07:00