Questions tagged [bimap]

Bidirectional map is associative data structure where keys and values can switch their roles.

Bidirectional maps on wikipedia

85 questions
1
vote
1 answer

Boost bimap find with multiset_of

I have question with Boost::bimap and could not find answer from boost document. using AToBBimap = boost::bimap< boost::bimaps::unordered_set_of, boost::bimaps::multiset_of >; //hashed bimap using AToBBimapValueT = AToBBimap…
Bing Lan
  • 1,121
  • 1
  • 13
  • 26
1
vote
2 answers

Is it possible to override "find" and "erase" methods of boost::bimaps::bimap.left? How to do it?

I have following: struct foo_and_number_helper { std::string foo; uint64_t number; }; struct foo_and_number {}; struct bar {}; using my_bimap = boost::bimaps::bimap< …
Lukas Salich
  • 959
  • 2
  • 12
  • 30
1
vote
3 answers

How to get around "Erasure of method is the same as another method" when writing a Bidirectional Map

Im currently trying to write a bidirectional map since (as far as I can see) Java doesnt provide one. My code is as follows. private static final class ColourCharTwoWayMap { private ArrayList eArrayList; private ArrayList
Ewan Brown
  • 143
  • 1
  • 9
1
vote
1 answer

Add values to a multiset in a boost::bimap

I wanted to use a multimap version of a boost::bimap and I am following this, Boost::Bimap equivalent of bidirectional multimap This shows how to add and retrieve values in the structure. I am trying to look up based on a value on the right that…
s_s
  • 101
  • 9
1
vote
1 answer

C++ Bimap Left unordered_map Right sorted mutable multimap

I need to implement the following datastructure for my project. I have a relation of const MyClass* to uint64_t For every pointer I want to save a counter connected to it, which can be changed over time (in fact only incremented). This would be…
1
vote
1 answer

Searching a boost::bimap for the current class instance

Ok, so I a boost::bimap declared as so: boost::bimap object_list; Where object and position are a class and a struct, respectively. Within the current object stored in the bimap, I want to find its own entry. I am currently…
Melasoul
  • 13
  • 3
1
vote
0 answers

boost bimap with second type as a list, flattening right map view

I recently saw that boost has a bidirectional map implementation named bimap. My initial STL map was using the following 2 types: int as the key type std::weak_ptr as the value type (let's call it X) Scenario 1 To create a bimap with these…
1
vote
1 answer

Send image with made changes to another activity Android

I have problem with send image from imageView to another activity. My code works good but only for sending image given at code without changes. I add filters on the photo and I need to send image with this changes. This is my code: First…
Quicki
  • 391
  • 1
  • 5
  • 15
1
vote
1 answer

Big-O of containsValue for Guava HashBiMap

I am interested in using a Map that will contain unique keys and values. I also would like to have O(1) complexity for .containsKey() and .containsValue(). To me, it seems like a HashBiMap should be able to support this complexity because of the…
terminex9
  • 671
  • 5
  • 10
1
vote
1 answer

Boost Bimap takes too much memory in debug build

I am using quite a few containers of the form boost::bimap, boost::bimaps::set_of > I am defining them in a header file that is included in quite a few cpp files (This is after I limited the exposure…
john_zac
  • 1,241
  • 2
  • 11
  • 16
1
vote
1 answer

Error using unordered_set_of with Boost.Bimap

I'm attempting to follow this example from the documentation (see typedef for word_counter). #include #include #include typedef boost::bimap < boost::bimap::unordered_set_of<…
onezeno
  • 764
  • 1
  • 10
  • 21
1
vote
1 answer

Warnings when creating boost.bimap inside a template class (C++)

I am trying to create a template class with a boost.bimap as a member. However, when following the usual typedef protocols, my compiler (I'm using Visual Studio Express 2012) produces a whole ream of C4512 (assignment operator could not be…
DaveM
  • 205
  • 1
  • 9
1
vote
1 answer

boost::bimap not taking vector_of

typedef boost::bimap, boost::bimaps::vector_of > bimap_t; bimap_t mp; mp.left.insert(bimap_t::left_value_type(2, 2.0f)); Why doesn't this work ? and gives compiler error on insert() It cannot find any insert()…
Neel Basu
  • 12,638
  • 12
  • 82
  • 146
1
vote
0 answers

boost::bimap find a relation

I just want to ask whether boost::bimap provides a method to find the relation in the bimap? since I have a bimap with unordered_multiset at both side, I will need a function to check whether these is a relation between two objects. I read some…
cynric4sure
  • 189
  • 1
  • 12
1
vote
1 answer

questions about unordered_multiset_of in boost bimap

I am implementing a boost::bimap and I am considering using unordered_multiset_of but unordered_multiset_of need to pass a hash function and equal operator to it. And I cant get it right. class MyClass { std::string s1; std::string s2; bool…
cynric4sure
  • 189
  • 1
  • 12