map of name/vector<float> access?
I am declaring a type as
typdef std::map<string,std::vector<float>> StringFloatsMap
its purpose is to hold a name and vector of multiple values, which I will use to determine the sum , mean for each name and for all names and values.
my question is how to access individul vector values in the map would it be :
name_values[name_key][vector_index]=value;
my second question:
Since I will not be keeping track of the number of values per name, I want to create an iterator to each vector to step through the values for calculation of sum and mean for each name here is kind of what I had in mind.
// name_key_index is iterator to map
vector::iterator value_index = name_value[name_key_index->first].begin();
how would I do this properly and can I use the iterator in float division ie
mean=sum/value_index;