hello
I have two vectors, a {1,4,8,3,6,9} and b{ 0,1,2,3,4,5}. For accessing the 5th element inside vector a, instead of a[4] I want to use b[4] which corresponds to a[4]. how can I do this using map.
imagine I have a vector of objects, coordinate, which has x,y and z component.
std::vector<coordinate>{0,1,2,3,4,5,7,8,9}. Then I divided this vector into two processors. the first and second processors receive {2, 4, 9} and {0,1,3,5,6,7,8} into Local_Vector. Now in each processor I want to create the vector of coordinate which its size will be 3 and 7 for the first and second processors. now for example in the first processor you have coordinate 9 but the size of coordinate now is 3 and you don't have access to the x,y,z component. Easily I can find the index of 9 in local_vector and then say like coordinate [index], it gives me the x,y,z of coordinate 9. but this slow down my code. my preference was to not use std:: find or map for this purpose, but it seems i don't have any other choice
in the first processor the Local_vector is {2,4,9}.
the vector of object for this processor will be {0,1,2}, but for coordinate 2 you'll need the x,y,z of node 9. I hope I could have been able to clarify my question enough.