@@ -334,12 +334,14 @@ void AllSpikingSynapses::printSynapsesProps() const
334334 }
335335}
336336
337- string vectorToXML (const vector<BGFLOAT>& matrix, int rows, int cols, const string& name) {
337+ string vectorToXML (const vector<BGFLOAT> &matrix, int rows, int cols, const string &name)
338+ {
338339 ostringstream os;
339340 os << " <" << name << " rows=\" " << rows << " \" columns=\" " << cols << " \" >\n " ;
340341
341342 int index = 0 ;
342- for_each (matrix.begin (), matrix.end (), [&](BGFLOAT value) mutable {
343+ for_each (matrix.begin (), matrix.end (), [&](BGFLOAT value) mutable
344+ {
343345 os << " <value" << index << " >" << value << " </value" << index << " >\n " ;
344346 index++;
345347 });
@@ -348,12 +350,14 @@ string vectorToXML(const vector<BGFLOAT>& matrix, int rows, int cols, const stri
348350 return os.str ();
349351}
350352
351- string vectorToXML (const vector<int >& matrix, int rows, int cols, const string& name) {
353+ string vectorToXML (const vector<int > &matrix, int rows, int cols, const string &name)
354+ {
352355 ostringstream os;
353356 os << " <" << name << " rows=\" " << rows << " \" columns=\" " << cols << " \" >\n " ;
354357
355358 int index = 0 ;
356- for_each (matrix.begin (), matrix.end (), [&](int value) mutable {
359+ for_each (matrix.begin (), matrix.end (), [&](int value) mutable
360+ {
357361 os << " <value" << index << " >" << value << " </value" << index << " >\n " ;
358362 index++;
359363 });
@@ -362,11 +366,12 @@ string vectorToXML(const vector<int>& matrix, int rows, int cols, const string&
362366 return os.str ();
363367}
364368
365- void AllSpikingSynapses::outputWeights (int epochNum) {
366- const std::string filename = " ./Output/Results/weights-epoch-" + std::to_string (epochNum) + " .xml" ; // Hardcoded filename
369+ void AllSpikingSynapses::outputWeights (int epochNum)
370+ {
371+ const std::string filename = " ./Output/Results/weights-epoch-" + std::to_string (epochNum) + " .xml" ; // Hardcoded filename
367372 int vertexCount = Simulator::getInstance ().getTotalVertices ();
368-
369- ofstream outFile (filename);
373+
374+ ofstream outFile (filename);
370375 if (!outFile) {
371376 cerr << " Error: Unable to open file " << filename << endl;
372377 cerr << " Error details: " << strerror (errno) << endl;
@@ -377,7 +382,7 @@ void AllSpikingSynapses::outputWeights(int epochNum) {
377382
378383 string wContent = vectorToXML (W_, vertexCount, maxEdges, " WeightMatrix" );
379384 string srcContent = vectorToXML (sourceVertexIndex_, vertexCount, maxEdges, " SourceVertexIndex" );
380-
385+
381386 outFile << " <Graph>\n " ;
382387 outFile << wContent;
383388 outFile << srcContent;
0 commit comments