My goal is to create an efficient structure to store the most relevant entries of a matrix that would (in a world without memory limitations) be approximately 10^5 x 10^5 and filled with doubles. The matrix is symmetric, so it actually would contain only (10^10)/2 values.
I need to access entries many, many times in my simulation, so fast retrieval is critical.
To keep the structure manageable, I will delete members that are unlikely to be used. If the index is (int_x1, int_x2), I will often want to delete all pairs containing, e.g., x1.
What is the best structure or set of structures for this task? What is a good hash for two ints?
For portability, I would like to avoid Boost. I am currently using TR1's unordered_map elsewhere in the program. I was thinking of using unordered_map again with the key pair, but I'm not sure how I would be able to delete entries efficiently this way, and I don't know what a good hash function would look like.
I'm a beginning programmer, so please state the obvious.