I have two 3D data-sets. Each element in these sets is a triplet of type (float,float,float)
. These data-sets have some duplicate elements. I want to merge these two data-sets in such a way so that resulting set does not have any duplicate elements.
A naive approach is to simply maintain a list of std::vector
to store these triplets, any new triplet should be inserted only if it is not already present in the list(checking using simple floating-point equality comparison)
In order to reduce insertion time, another approach can be to store a triplet in a kd-tree only after querying for the triplet in the current tree to avoid duplicates.
Question:
I would like to know if there are other approaches to effectively implement unordered set with floating-point triplet elements?