I suggest we convert our Vamana Index to a class. Since the whole idea of the Vamana is actually a modified graph data structure, I believe that building a suitable class for the Vamana would be a great idea, and will help us later on.
Further more I've been thinking about some extra functionalities about the Vamana that can be implemented inside the class above, which are:
Adding functionality to create a vamana graph. That could be implemented inside a method createGraph().
Adding the ability of saving a vamana graph inside a binary file, at a specific location the user choose. This can be done with a method saveGraph().
In addition to the previous functionality, we can add a method called loadGraph(), that reads a binary file at a specific location and loads the graph for further use.
The class should be something like the following:
template <typename vamana_t>
class VamanaIndex{
private:
Graph<vamana_t> graph; // The graph index of the vamana
public:
...
void createGraph(void) {
// Here the graph of the vamana is being created.
// We follow the algorithm we already have.
}
void saveGraph(const std::string& filepath) {
// Here we are saving the graph data to a file.
}
void loadGraph(const std::string& filepath) {
// Here we are loading a graph from a file and construct it.
this->graph = ...
}
};
Of course these are some examples of what we can do with the Vamana and make our work more convenient and easy. I can work on that but feel free to write down any other suggestion you come across.
I suggest we convert our Vamana Index to a class. Since the whole idea of the Vamana is actually a modified graph data structure, I believe that building a suitable class for the Vamana would be a great idea, and will help us later on.
Further more I've been thinking about some extra functionalities about the Vamana that can be implemented inside the class above, which are:
createGraph()
.saveGraph()
.loadGraph()
, that reads a binary file at a specific location and loads the graph for further use.The class should be something like the following:
Of course these are some examples of what we can do with the Vamana and make our work more convenient and easy. I can work on that but feel free to write down any other suggestion you come across.
VamanaIndex
class.createGraph()
saveGraph()
loadGraph()