778 questions
1 vote
1 answer
141 views
Are the map/multimap iterators interchangeable?
In the code below I'm defining a map and a multimap. Then I'm defining four iterators assigning them values from these containers: std::map<int, double> m; std::multimap<int, double> mm; ...
-2 votes
1 answer
168 views
Removing elements from std::multimap [closed]
I'm using std::multimap with tens of millions of elements. The key is a pointer, and the data is a shared pointer to a class. Sometimes I need to remove a few elements, sometimes many elements, and ...
0 votes
0 answers
30 views
How to call existing function on value of ImmutableListMultimap instead of Map
I currently have this function: ImmutableMap<String, ImmutableList<ImpactSummary>> toSummariesByKey(ImmutableMap<String, ImmutableList<Impact>> impactsByKey) return ...
1 vote
0 answers
59 views
How to query frequently a MultiMap in Hazelcast?
I am using Hazelcast 5, for most of our use cases IMaps were satisfactory. However I have an IMap where the value is a Collection currently, so I am looking to switch that to MultiMap. This map is ...
0 votes
2 answers
113 views
Filter entries in Multimap to remove duplicates
I have a Google Guava MultiMap, namely com.google.common.collect.ArrayListMultimap, in Java that has a lot of entries. The entries are string, like this: URL1=URL2 URL2=URL1 URL4=URL3 URL3=URL4 As ...
1 vote
0 answers
98 views
Java Map with Multimap values - how to efficient split the true entries from the false ones
I have a Map made up of this structure Map<String, Multimap<Boolean, String>> . I want to separate all the true entries in one new map and the false ones in a second. I have the following (...
0 votes
1 answer
90 views
Need for lock on key when trying to update Multimap value
We have a use case where we are using the Hazelcast Multimap. We’re spawning one thread each for every element within the Collection for every key. For instance, if key1 has, say, 10 values, then we ...
0 votes
0 answers
82 views
Error in custom comparator for multimap stl c++11
I am trying to run the following code where I create the multimap structure with key and value as pair of two integer values. I want the stucture to be sorted (without using explicit sorting ...
0 votes
0 answers
60 views
Best structure of Multiple indexed map
Problem Multiple indexed map : A value has several key, that can be used to find the value in a short time (may be less than O(n)). The key is NON-UNIQUE, which means key1: val1, key1: val2, key1: ...
0 votes
1 answer
180 views
Search by value in a multimap in O(log(n)) complexity
How can I efficiently search for a value in a multimap with a time complexity of O(log(n))? I have a multimap where the keys represent locations and the values represent city names. I want to ...
0 votes
2 answers
76 views
How do I remove a specific item from my multimap?
#include <map> #include <iostream> int main() { std::multimap <int, int> map; // insert the values in multimap map.insert(std::make_pair(1, 10)); map.insert(std::...
0 votes
0 answers
142 views
how to let jackson deserialize guava multimap using the '@class' field inside json to deside the target class?
I have a json like this: { '@class':'A', 'aProperty':{ '@class': 'com.google.common.collect.ArrayListMultimap', 'a':[1,2,3], 'b':[22] } } and the class A like this: class A{ ...
0 votes
2 answers
215 views
How to calculate average from Collection of HashMap<String, Double>
I have a Collection of HashMap<String, Duble> which I am getting from multimap. I want to calculate the average on Maps values and calculate which Map key is having minimum average. The data ...
-2 votes
1 answer
692 views
Iterate over all the elements in a std::multimap with the same key
I want to add objects so a multi-map and some should have the same key how can I get access to all the elements which the same key? Can I do a ranged fore lope over only the specific keys or something ...
1 vote
1 answer
520 views
Finding a key-value-pair within a std::multimap with key of type int
I have a std::multimap<int, X*> where X is a user-defined type. I want to find a specific key-value-pair within this multimap (i.e. an iterator pointing to this pair). (A) Complete Example: #...