Skip to content

Commit 792f49d

Browse files
author
Zaina Shaikh
committed
Refactor neuronTypeToString from Global
1 parent a5b9ee6 commit 792f49d

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

Simulator/Utils/Global.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,6 @@ string coordToString(int x, int y, int z)
5353
return ss.str();
5454
}
5555

56-
// MODEL INDEPENDENT FUNCTION NMV-BEGIN {
57-
string neuronTypeToString(vertexType t)
58-
{
59-
switch (t) {
60-
case vertexType::INH:
61-
return "INH";
62-
case vertexType::EXC:
63-
return "EXC";
64-
default:
65-
cerr << "ERROR->neuronTypeToString() failed, unknown type: " << t << endl;
66-
assert(false);
67-
return nullptr; // Must return a value -- this will probably cascade to another failure
68-
}
69-
}
70-
// } NMV-END
7156
#if defined(USE_GPU)
7257
//! CUDA device ID
7358
int g_deviceId = 0;

Simulator/Utils/Global.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@ string index2dToString(int i, int width, int height);
195195
string coordToString(int x, int y);
196196
// Converts a 3-d coordinate into a string.
197197
string coordToString(int x, int y, int z);
198-
// Converts a vertexType into a string.
199-
string neuronTypeToString(vertexType t);
200198

201199
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v)
202200
{

Simulator/Vertices/AllVertices.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@
99
#include "AllVertices.h"
1010
#include "OperationManager.h"
1111

12+
// Utility function to convert a vertexType into a string
13+
// MODEL INDEPENDENT FUNCTION NMV-BEGIN {
14+
string vertexTypeToString(vertexType t)
15+
{
16+
switch (t) {
17+
case vertexType::INH:
18+
return "INH";
19+
case vertexType::EXC:
20+
return "EXC";
21+
default:
22+
cerr << "ERROR->vertexTypeToString() failed, unknown type: " << t << endl;
23+
assert(false);
24+
return nullptr; // Must return a value -- this will probably cascade to another failure
25+
}
26+
}
27+
// } NMV-END
28+
1229
// Default constructor
1330
AllVertices::AllVertices() : size_(0)
1431
{

Simulator/Vertices/AllVertices.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ using namespace std;
3333
// cereal
3434
#include "cereal/types/vector.hpp"
3535

36+
// Utility function to convert a vertexType into a string.
37+
string vertexTypeToString(vertexType t);
38+
3639
class Layout;
3740
class AllEdges;
3841
struct AllVerticesDeviceProperties;

0 commit comments

Comments
 (0)