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

Hopfield network. More...

#include <NeuralNet.h>

Inheritance diagram for CNeuralNet:
CGraph CTakefujiLee

Public Member Functions

 CNeuralNet (UINT n, int seed)
 Constructor. More...
 
void InsertNeuron (UINT i, UINT j)
 Insert a neuron. More...
 
- Public Member Functions inherited from CGraph
 CGraph (const UINT n)
 Constructor. More...
 
 ~CGraph ()
 Destructor. More...
 
void InsertEdge (const UINT i, const UINT j)
 Insert an edge. More...
 
UINT BFSF (std::vector< UINT > &result)
 Breadth-first spanning forest. More...
 
void PrintGraph ()
 Print the graph to a text file. More...
 

Additional Inherited Members

- Protected Attributes inherited from CGraph
std::vector< CEdge * > m_vEdgeList
 Edge list.
 
UINT m_nNumEdges = 0
 Number of edges.
 
CVertexm_pVertexList = nullptr
 Vertex list.
 
UINT m_nNumVerts = 0
 Number of vertices.
 
std::queue< CVertex * > m_qBFSQueue
 Queue for breadth-first search.
 
CRandom m_cRandom
 Random number generator.
 

Detailed Description

A Hopfield network is a graph in which the edges represent neurons.

Definition at line 64 of file NeuralNet.h.

Constructor & Destructor Documentation

◆ CNeuralNet()

CNeuralNet::CNeuralNet ( UINT  n,
int  seed 
)

Allocate space for and initialize the vertex list by calling CGraph constructor to do the actual work.

Parameters
nNumber of vertices.
seedPRNG seed.

Definition at line 85 of file NeuralNet.cpp.

Member Function Documentation

◆ InsertNeuron()

void CNeuralNet::InsertNeuron ( UINT  i,
UINT  j 
)

This is the equivalent of CGraph::InsertEdge for CNeuralNet. Insert a neuron between two vertices by appending an instance of CNeuron at the end of the edge list and appending the index of that neuron (which is the size of the edge list before insertion) to the incidence lists of the vertices. Self-edges and vertices out of range are ignored.

Parameters
iThe vertex at one end of the edge to be inserted.
jThe vertex at the other end of the edge to be inserted.

Definition at line 99 of file NeuralNet.cpp.