Questions tagged [bimap]

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

Bidirectional maps on wikipedia

85 questions
0
votes
1 answer

Is it legal to re-declare a member class after defining it?

I have a problem with compiling boost.bimap library. My test program is a blank main function and only one include directive(like #include ). After some investigations I found out that preprocessor had made some interesting…
alex.demid
  • 25
  • 2
0
votes
1 answer

Emboss bitmap on touch in android

I am developing color splash app. in which i use finger paint. Now i want to emboss bitmap on touch event. i have one demo here in which when i apply emboss then it draw emboss path with red color but i want to emboss behind bitmap on…
0
votes
2 answers

BiMap single function to convert values to concatenated string value?

Is there something equivalent to get all keys (or inverses) from a bit map and concat each with a special character as a completely new string (without iterating through the map and building it manually? private static final BiMap
genxgeek
  • 13,109
  • 38
  • 135
  • 217
0
votes
1 answer

boost bimap set_of with user defined comparator

I plan to use my own compare function with boost bimap. The issue i am trying to address is when i use boost bimap with a pointer, the comparison should not compare the two pointers but should compare the class which is pointed by the pointer. I…
helloworld
  • 79
  • 7
0
votes
0 answers

c++ boost insertion fails

I've defined boost::bimap- typedef boost::bimap < boost::bimaps::unordered_set_of , boost::bimaps::unordered_set_of > xBimap each time i check whether i already have the value in the bimap - // Take…
0
votes
2 answers

Get key using value from a Map containing duplicate keys or values

I have a Map having duplicate values. I now want to get the key using value without iterating through all the Map.Entries. I have more than 500 entries in the map. I do not want to iterate the whole map each time. I thought of using BiMap of google…
John
  • 541
  • 3
  • 6
  • 19
0
votes
1 answer

How can I properly relate multiple BiMap collections using shared keys?

I have the following BiMap collections: BiMap accessIds = HashBiMap.create(); accessIds.put("FOO","accessId 1"); //This access Id is common to both FOO and BAR BiMap merchants =…
Robert H
  • 11,520
  • 18
  • 68
  • 110
0
votes
2 answers

Passing a boost::bimap between functions

I'm new to the bimap functionality of the Boost libraries, and I'm having trouble passing a bimap into another function. My bimap looks like this: typedef boost::bimap< int, int > bimap_type; bimap_type bm; I have an add_values() function that adds…
user1295558
  • 117
  • 9
-1
votes
1 answer

Write a bimap to binary file and then read it

I would like to know how to write a bimap which is actually too large( 180 million to 3000 million entries) to a binary file and then read to do some operation. To create a bimap I have the following code, where I created two streams to write and…
AwaitedOne
  • 992
  • 3
  • 19
  • 42
-1
votes
4 answers

how to get key of the most nearest value of a given double value from an existing map

Since I need to get the key values of double value I' m using BiMap. BiMapmapObj = HashBiMap.create(); mapObj.put("a1",3.58654); mapObj.put("a2",4.1567); mapObj.put("a3",4.2546); For a particular value like 4.0156 I must get the key…
1 2 3 4 5
6