admin管理员组

文章数量:1405393

Suppose I have a bunch of high-dimensional data. Each datapoint can have a number of categorical attributes associated with it (e.g. colour, place of manufacture). The number of attributes associated with each datapoint, as well as the number of different possible attributes and what they are, is determined by the data and is not known at compile-time. For example, imagine I have a matrix of n vector embeddings with dimensionality d, and each embedding can have one or more attributes from the set red, green, blue, yellow, purple, orange, brown, white associated with it.

My goal is to be able to create indexes for different groupings of these attributes for quick lookup. For example, I want to be able to create a composite index for red, green, blue and find out which datapoints have those attributes (more generally, I want to create composite indexes for many different subgroups of attributes). However, I do not know in advance what the different possible attributes are until I process the data from a file.

I have been looking at boost::multi_index to help me do this. I have found ways to create indexes for individual named attributes and composite indexes with composite key lookup for multiple attributes, but it is unclear to me what is the best way to do this without knowing the attributes or which groupings of them I want to index in advance (for example, if I want to split the attributes in four groups and create a composite index for each group).

本文标签: cHow to create dynamic attributebased composite indexes with Boost multiindexStack Overflow