Commit 539a994
533 out of place set does not clear the output vector (#96)
The `grb::set` did not follow out-of-place semantics, while the unit test designed to catch that was bugged. Additionally, the label propagation smoke test relied on the older in-place semantics.
This MR makes sure the existing nonzero structure of the output vector is cleared whenever the dense descriptor is not given. It fixes the corresponding unit test, and replaces the `grb::set( vector, mask, vector )` used by the label propagation algorithm (used for clamping) with the in-place `grb::foldl( vector, mask, vector )` using the `right_assign` operator.
This MR also includes the related changes and fixes listed below.
- Bugfix: introduces the previously missing masked vector-to-vector `grb::foldl` in the BSP1D backend;
- Bugfix: masked vector-to-vector folds with dense vectors but sparse masks would return `ILLEGAL` (the generic implementation could execute it, but did not because it was executing a dynamic check on the dense descriptor using a template argument that was not the exact reverse of being passed that descriptor-- this MR fixes this by lifting checks w.r.t. the dense descriptor out of the generic implementation);
- Bugfix: several variants of `grb::set` did not correctly return `ILLEGAL` when the dense descriptor was used;
- Performance: exchange `grb::set` with `std::swap` at various places in the label propagation algorithm;
- Performance: `grb::set` variants now do not call `assignAll` nor `clear` when a dense structure is assured to remain;
- Testing: unify output from label smoke tests and minor typo fix in `smoketests.sh`;
- Testing: `grb::set` unit test now also tests for correct behaviour when the dense descriptor is used;
- Code improvements: various code style fixes across files touched by this MR;
- Semantics & documentation: dense descriptor also applies to output containers.
Thanks to Aristeidis for finding the bug and implementing the initial fix to `grb::set`!1 parent 9d78cd8 commit 539a994
File tree
9 files changed
+819
-172
lines changed- include/graphblas
- algorithms
- bsp1d
- reference
- tests
- smoke
- unit
9 files changed
+819
-172
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
233 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
| |||
246 | 252 | | |
247 | 253 | | |
248 | 254 | | |
249 | | - | |
| 255 | + | |
250 | 256 | | |
251 | 257 | | |
252 | 258 | | |
253 | 259 | | |
254 | | - | |
| 260 | + | |
255 | 261 | | |
256 | 262 | | |
257 | 263 | | |
258 | 264 | | |
259 | 265 | | |
260 | | - | |
| 266 | + | |
261 | 267 | | |
262 | 268 | | |
263 | 269 | | |
264 | 270 | | |
265 | 271 | | |
266 | | - | |
| 272 | + | |
267 | 273 | | |
268 | 274 | | |
269 | | - | |
| 275 | + | |
| 276 | + | |
270 | 277 | | |
271 | 278 | | |
272 | 279 | | |
273 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
274 | 285 | | |
275 | 286 | | |
276 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
660 | 832 | | |
661 | 833 | | |
662 | 834 | | |
| |||
683 | 855 | | |
684 | 856 | | |
685 | 857 | | |
686 | | - | |
| 858 | + | |
687 | 859 | | |
688 | 860 | | |
689 | 861 | | |
690 | 862 | | |
691 | | - | |
| 863 | + | |
692 | 864 | | |
693 | 865 | | |
694 | 866 | | |
695 | 867 | | |
696 | | - | |
| 868 | + | |
697 | 869 | | |
698 | 870 | | |
699 | 871 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
| 121 | + | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
143 | 147 | | |
| 148 | + | |
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1058 | 1058 | | |
1059 | 1059 | | |
1060 | 1060 | | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
1064 | 1061 | | |
1065 | 1062 | | |
1066 | 1063 | | |
| |||
1852 | 1849 | | |
1853 | 1850 | | |
1854 | 1851 | | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
1855 | 1858 | | |
1856 | 1859 | | |
1857 | 1860 | | |
| |||
1919 | 1922 | | |
1920 | 1923 | | |
1921 | 1924 | | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
1922 | 1929 | | |
1923 | 1930 | | |
1924 | 1931 | | |
| |||
2036 | 2043 | | |
2037 | 2044 | | |
2038 | 2045 | | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
2039 | 2049 | | |
2040 | 2050 | | |
2041 | 2051 | | |
| |||
2101 | 2111 | | |
2102 | 2112 | | |
2103 | 2113 | | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
2104 | 2118 | | |
2105 | 2119 | | |
2106 | 2120 | | |
| |||
2580 | 2594 | | |
2581 | 2595 | | |
2582 | 2596 | | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
2583 | 2600 | | |
2584 | 2601 | | |
2585 | 2602 | | |
| |||
2703 | 2720 | | |
2704 | 2721 | | |
2705 | 2722 | | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
2706 | 2726 | | |
2707 | 2727 | | |
2708 | 2728 | | |
| |||
2771 | 2791 | | |
2772 | 2792 | | |
2773 | 2793 | | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
2774 | 2798 | | |
2775 | 2799 | | |
2776 | 2800 | | |
| |||
2838 | 2862 | | |
2839 | 2863 | | |
2840 | 2864 | | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
2841 | 2869 | | |
2842 | 2870 | | |
2843 | 2871 | | |
| |||
0 commit comments