Knight's Tour Generator
Tourneys and the Fast Generation and Obfuscation of Closed Knight's Tours
Public Member Functions | Protected Attributes | List of all members
CEdge Class Reference

Graph edge. More...

#include <Graph.h>

Inheritance diagram for CEdge:
CNeuron

Public Member Functions

 CEdge (CVertex *p0, CVertex *p1, UINT index)
 Constructor. More...
 
CVertexGetNextVertex (CVertex *p)
 Get vertex at other end of edge. More...
 
UINT GetIndex ()
 Get index;. More...
 
void Mark (bool b=true)
 Mark or unmark. More...
 
bool Marked ()
 Get mark. More...
 
void GetVertexIndices (UINT &i0, UINT &i1)
 Get vertex indices. More...
 

Protected Attributes

CVertexm_pVertex0 = nullptr
 Vertex at one end of the edge,.
 
CVertexm_pVertex1 = nullptr
 Vertex at the other end of the edge.
 
UINT m_nIndex = 0
 Index into edge list.
 
bool m_bMarked = false
 Mark flag.
 

Detailed Description

An edge consists of pointers to two vertices, an index into the edge list, and a flag that indicates whether the edge is marked or not. There are also some neuron-related values for when the graph is used to define a neural network.

Definition at line 41 of file Graph.h.

Constructor & Destructor Documentation

◆ CEdge()

CEdge::CEdge ( CVertex p0,
CVertex p1,
UINT  index 
)

The edge constructor creates an edge between two vertices.

Parameters
p0Pointer to vertex incident with edge.
p1Pointer to vertex incident with edge.
indexIndex of edge.

Definition at line 38 of file Graph.cpp.

Member Function Documentation

◆ GetIndex()

UINT CEdge::GetIndex ( )

Reader function for the index.

Returns
The index of this edge in the edge list.

Definition at line 56 of file Graph.cpp.

◆ GetNextVertex()

CVertex * CEdge::GetNextVertex ( CVertex p)

Get vertex at other end of edge from a vertex. Returns nullptr if this edge is not incident on the given vertex.

Parameters
pPointer to a vertex.
Returns
Pointer to the vertex at the other end of the edge.

Definition at line 47 of file Graph.cpp.

◆ GetVertexIndices()

void CEdge::GetVertexIndices ( UINT i0,
UINT i1 
)

Get a pair of vertex indices.

Parameters
i0[out] Index of a vertex incident with this edge.
i1[out] Index of the other vertex incident with this edge.

Definition at line 78 of file Graph.cpp.

◆ Mark()

void CEdge::Mark ( bool  b = true)

Set or unset the mark flag.

Parameters
btrue to set mark flag (default), false to unset it

Definition at line 63 of file Graph.cpp.

◆ Marked()

bool CEdge::Marked ( )

Reader function for the mark flag.

Returns
true if marked, false if unmarked.

Definition at line 70 of file Graph.cpp.