-
Notifications
You must be signed in to change notification settings - Fork 1
[iss-45] OrdSetsAndMaps #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sb-graph-dev
Are you sure you want to change the base?
Conversation
Commit from Apr 10, 2025 MODIFICATIONS: Ordered intersection has been modified — not optimal yet. interForComl has been added — not the final version. Ordered complement has been modified — still not final. Multi-dimensional tests have been added to set_perf. COMMENTS: The changes to the ordered complement have resulted in improved performance during the tests — approximately 5X faster than the previous implementation. |
Commit from Apr 16, 2025 MODIFICATIONS: The ordered intersection has been updated — this is supposed to be the final version. interForComl has been modified — we removed unnecessary intersections. The ordered complement has been updated — almost final version. In the end, there's no need to use the Boost library or perform sorting, either here or in the intersection. Multi-dimensional tests have been added to set_perf — specifically those that test the conditions added to interForComl. COMMENTS: |
Commit from Apr 23, 2025 MODIFICATIONS: All operations for ordered pwmaps have been implemented except for: reduce, minMap, minAdj, and compact — these are not final versions yet. The emplaceHint function was added. It inserts a map element into an ordered pwmap in an ordered manner based on a given hint — it attempts to place the element linearly starting from the hint. COMMENTS: |
Commit from May 12, 2025 MODIFICATIONS: Minimal updates applied to orderedSet operations. Special cases added to enhance behavior in certain operations. Refactored interForCompl and intersection to separate the search criterion from the search starting point selection. Variable names updated to be more representative and improve code clarity. COMMENTS: |
Commit from May 25, 2025 MODIFICATIONS: The traverse function was removed, and its logic was directly integrated into the disjoint union function. The interForCompl function was renamed to intersectionComp and its algorithm was optimized. The algorithms for complement and intersection were modified and optimized. COMMENTS: The following results were obtained: Intersection time reduced by 93% compared to the unordered sets version. Union time reduced by 34% compared to the unordered sets version. Difference time reduced by 47% compared to the unordered sets version. Complement time reduced by 51% compared to the unordered sets version. Disjoint union time reduced by 40% compared to the unordered sets version. Time reduction of over 90% in union, intersection, difference, and complement when handling 3 dimensions, compared to the unordered sets version. |
Commit from Jun 5, 2025 MODIFICATIONS: Minor modification in intersectionComp to eliminate additional redundant cases. Adjustments to the synthetic tests to ensure fair performance measurement across operations. Fixed the use of the minimum and maximum domain bounds of a map for sorting purposes. The map structure was updated to store its peripheral minimum and maximum bounds upon creation and to leverage this information effectively. Implemented one-dimensional examples for half of the operations defined on pwmaps. COMMENTS: The mapInf operation does not perform compositions because it starts with n equal to zero. Should this be the expected behavior? |
Commit from Jun 8, 2025 MODIFICATIONS: A bug in the synthetic test cases that caused a segmentation fault was fixed. COMMENTS: The current implementation of minimum and maximum perimeter recalculates each time they are needed; it would be good to avoid this without negatively affecting the maps implementation when they are unordered. |
I suggest giving English names to all variables and functions to keep the same style for all the project. |
sbg/set.cpp
Outdated
auto liPrev = indices.before_begin(); | ||
auto liCurr = indices.begin(); | ||
|
||
bool doInt = (!(elementMax.menorThan(mdi.minElem())) && !(mdi.maxElem().menorThan(elementMin))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In line 1163 Is the left side of the &&
necessary? We check that condition while advancing pos
in line 1140.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was resolved with doInt
auxiliary function, but
Map::~Map() {} | ||
Map::Map(const SetAF &fact) : fact_(fact), dom_(fact.createSet()) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep the writing style for all Map constructors.
Commit from Jun 12, 2025 MODIFICATIONS: All changes committed are based on the previous comments. Some auxiliary functions have been added to set.cpp for OrderedSets. COMMENTS: There is a conflict with some files. I suppose this is because Git is comparing the branches in preparation for a possible merge. |
Changes in pw_map.* are missing because we are getting errors while building saying that menorThan is non-existent now. |
In general we have used camel case for function names, and for variables underscores:
|
I decided to implement a new version for all ordered set operations. I used linked lists and different conditions to minimize the number of operations in the intersection process, supporting sets with multiple dimensions and variable steps. Then, I wrote a new version for union, difference, minus, and complement operations to also support multiple dimensions and variable steps.