Description
Currently when developing there is no way to check the states of these 3 containers, indexToVertex
, vertexToIndex
and adjacencyMatrix
so there is a need to implement a function __show_states()
that prints out the states of these containers in a readable format, readable format because the data these containers store will always not be a primitive like and integer or character or float, so you need to handle it correctly, i.e you just need to print 1 or 0 is an element is present at a place in these containers or not.
In the past proposal of __show_states()
method was introduced in one of the pull requests but the idea was dropped however we are planing to implement it again, so for reference you can take a look at this pull request code from a previous PR
Appledore/include/GraphMatrix.h
Line 626 in 30ff777
Something similar should be implemented in the MatrixRep.hpp
file's MatrixRepresentation
class so that the function can be invoked by both the GraphMatrix
and MixedGraphMatrix
classes.
Below is the possible signature for this function
template<typename VertexType, typename EdgeType>
void __show_states(const std::map<VertexType, size_t> &vertexToIndex, const std::vector<VertexType> &indexToVertex, const std::vector<std::optional<EdgeInfo<EdgeType>>> &adjacencyMatrix);