I apologize if the title of the question is confusing; Feel free to suggest an alternative.
I am writing data analysis code, and I have a set of data that I want to build using a map, which can be used to search for specific keys to search for specific values. But I want to be able to use a wild card for parts of a multidimensional key so that multiple values are returned. I also want a quick search and efficient use of memory.
My key is 5 dimensional. If I didn’t want to use wildcards in the search, the solution is simply to use a 5-dimensional tuple for the map key. Sometimes I only want to return a single value using a fully specified key, but in other cases I want to return an aggregation of results for a partially specified key. The value that I save is a three-dimensional tuple of floats.
If I did not need efficient use of memory, I would create a 5-dimensional array and create 5 index queries (one for each part of the key), and then wrap it all up with the appropriate access methods. To get all the values when one of the key parts is a wild card, just access the array using "0 .." and then aggregate the results as desired. In this case, most of the array will be empty. This does not seem to be a good idea, because I do not know in advance how large each size is, so the cross product may be higher than possible. The solution I am continuing with is simply to have separate maps for each type of search that interests me. For example, if my full key is k1 * k2 * k3 * k4 * k5, and part of my code wants to get aggregated data for everything,which corresponds to k1 ** k3 * k4 *, then I will create a map indexed by k1 * k3 * k4 that stores the aggregate float that he cares about. The number of combinations is quite large (32 * 3 = 96, I think), so if I wanted to access this data in all possible ways using the method I went with, I would need 96 different cards and access methods.
, , , , . , F # ?