I need to create a dictionary data structure which maps vector to unique numbers and vice versa:
For example for mapping vectors to unique numbers, I can do the following:
vector ---------> unique number
(0,7,8) 0
(0,8,10) 1
(1,2,9) 2
(1,2,10) 3
(1,3,1) 4
Then I need to map back unique numbers to vectors, e.g. given below:
unique numbers --------> vector
0 (0,7,8)
1 (0,8,10)
2 (1,2,9)
3 (1,2,10)
4 (1,3,1)
I tried to do this mapping by creating a structure of integers and vectors -- however, this turned to be very inefficient. Is there some c++ data structure which can perform the forward and reverse mapping efficiently.
Aucun commentaire:
Enregistrer un commentaire