Go to the documentation of this file.
12 #ifndef ABSTRACTTOPOLOGY_H
13 #define ABSTRACTTOPOLOGY_H
24 #include "MemoryClustering.h"
29 const std::vector<char> GridXOffset {0,0,1, 1, 0,-1,-1};
30 const std::vector<char> GridYOffset {0,2,1,-1,-2,-1, 1};
37 extern int YFromPosition_Get(
int x,
int y);
81 int NumberOfGridPoints_Get(
void) {
return GRID_SIZE_X * GRID_SIZE_Y; }
82 int NumberOfClusters_Get(
void){
return mClusters.size();}
85 ByID_Get(
const int N);
87 ByIndex_Get(
const int X,
const int Y);
89 ByPosition_Get(
int X,
int Y);
92 LinearAddressFromCoordinates_Get(
int X,
int Y)
93 { assert(!(X<0 || X>=GRID_SIZE_X)); assert(!(Y<0 || Y>=GRID_SIZE_Y));
94 return X*GRID_SIZE_Y + Y; }
96 LinearAddressFromPosition_Get(
int X,
int Y)
97 {
return LinearAddressFromCoordinates_Get(X,Y/2); }
99 LinearAddressFromPosition_Get(
GridPoint* GP) ;
144 Cluster_Create(
int X,
int Y);
161 ClusterAddressFromLinear_Get(
int N);
166 Valuable and works, but needed only when changing the number of points or debugging
168 DrawPoint(
int i,
int j, ostringstream &oss);
177 CreateClusters(
void);
188 assert (!(N<0) || (N>=mClusters.size()));
197 StringOfClusterAddress_Get(
GridPoint* GP);
201 PC_Get() {
return mProgramCounter;}
203 PC_Set(SC_ADDRESS_TYPE PC) { mProgramCounter = PC;}
207 vector<vector<GridPoint*> >
215 #endif // ABSTRACTTOPOLOGY_H
SC_ADDRESS_TYPE mProgramCounter
The architecture itself has a global program counter.
Definition: AbstractTopology.h:212
Definition: AbstractTopology.h:52
This class handles the topological information for the modules. Provides a lot of math-only utility f...
Definition: GridPoint.h:33
vector< vector< GridPoint * > > mGrid
The gridpoints form a 2-dim grid, addressable by their index.
Definition: AbstractTopology.h:208
GridPoint * ClusterHead_Get(unsigned int N)
Return pointer to the cluster head of the Nth cluster.
Definition: AbstractTopology.h:186
ClusterNeighbor
The neighborship in the cluster: the members are referred to with their geographic direction.
Definition: Clustering.h:34
A GridPoint can be addressed also by its cluster address of type ClusterAddress_t....
Definition: Clustering.h:58
@ cm_Head
The central gridpoint.
Definition: Clustering.h:35
vector< GridPoint * > mClusters
The clustered gridpoints are accessible through their clusters, too.
Definition: AbstractTopology.h:210
ClusterStatus
The gridpoints can be the head of the cluster, a member of a cluster, or neither (stand-alone)
Definition: Clustering.h:24