Skip to content

Add __show_states() Method in GraphMatrix and MixedGraphMatrix class for Debugging #68

Open
@SharonIV0x86

Description

@SharonIV0x86

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

void __show_states()

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);

Metadata

Metadata

Labels

EasyJWOCLabel for JWOC contributorsSWOCRole for SWOC contributors.feature additionLable for a new Feature Addition

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions