GeNN  2.2.3
GPU enhanced Neuronal Networks (GeNN)
stringUtils.h File Reference
#include <string>
#include <sstream>
#include <vector>

Go to the source code of this file.

Macros

#define tS(X)   toString(X)
 Macro providing the abbreviated syntax tS() instead of toString(). More...
 

Functions

template<class T >
std::string toString (T t)
 template functions for conversion of various types to C++ strings More...
 
void substitute (string &s, const string &trg, const string &rep)
 Tool for substituting strings in the neuron code strings or other templates. More...
 
void name_substitutions (string &code, const string &prefix, const vector< string > &names, const string &postfix="")
 This function performs a list of name substitutions for variables in code snippets. More...
 
void value_substitutions (string &code, const vector< string > &names, const vector< double > &values)
 This function performs a list of value substitutions for parameters in code snippets. More...
 
void extended_name_substitutions (string &code, const string &prefix, const vector< string > &names, const string &ext, const string &postfix="")
 This function performs a list of name substitutions for variables in code snippets where the variables have an extension in their names (e.g. "_pre"). More...
 
void extended_value_substitutions (string &code, const vector< string > &names, const string &ext, const vector< double > &values)
 This function performs a list of value substitutions for parameters in code snippets where the parameters have an extension in their names (e.g. "_pre"). More...
 
string ensureFtype (const string &oldcode, const string &type)
 This function implements a parser that converts any floating point constant in a code snippet to a floating point constant with an explicit precision (by appending "f" or removing it). More...
 
void checkUnreplacedVariables (string code, string codeName)
 This function checks for unknown variable definitions and returns a gennError if any are found. More...
 
void neuron_substitutions_in_synaptic_code (string &wCode, const NNmodel &model, unsigned int src, unsigned int trg, unsigned int nt_pre, unsigned int nt_post, const string &offsetPre, const string &offsetPost, const string &preIdx, const string &postIdx, const string &devPrefix)
 Function for performing the code and value substitutions necessary to insert neuron related variables, parameters, and extraGlobal parameters into synaptic code. More...
 

Macro Definition Documentation

#define tS (   X)    toString(X)

Macro providing the abbreviated syntax tS() instead of toString().

Function Documentation

void checkUnreplacedVariables ( string  code,
string  codeName 
)

This function checks for unknown variable definitions and returns a gennError if any are found.

string ensureFtype ( const string &  oldcode,
const string &  type 
)

This function implements a parser that converts any floating point constant in a code snippet to a floating point constant with an explicit precision (by appending "f" or removing it).

void extended_name_substitutions ( string &  code,
const string &  prefix,
const vector< string > &  names,
const string &  ext,
const string &  postfix = "" 
)

This function performs a list of name substitutions for variables in code snippets where the variables have an extension in their names (e.g. "_pre").

void extended_value_substitutions ( string &  code,
const vector< string > &  names,
const string &  ext,
const vector< double > &  values 
)

This function performs a list of value substitutions for parameters in code snippets where the parameters have an extension in their names (e.g. "_pre").

void name_substitutions ( string &  code,
const string &  prefix,
const vector< string > &  names,
const string &  postfix = "" 
)

This function performs a list of name substitutions for variables in code snippets.

void neuron_substitutions_in_synaptic_code ( string &  wCode,
const NNmodel model,
unsigned int  src,
unsigned int  trg,
unsigned int  nt_pre,
unsigned int  nt_post,
const string &  offsetPre,
const string &  offsetPost,
const string &  preIdx,
const string &  postIdx,
const string &  devPrefix 
)

Function for performing the code and value substitutions necessary to insert neuron related variables, parameters, and extraGlobal parameters into synaptic code.

Parameters
wCodethe code string to work on
modelthe neuronal network model to generate code for
srcthe number of the src neuron population
trgthe number of the target neuron population
nt_prethe neuron type of the pre-synaptic neuron
nt_postthe neuron type of the post-synaptic neuron
offsetPredelay slot offset expression for pre-synaptic vars
offsetPostdelay slot offset expression for post-synaptic vars
preIdxindex of the pre-synaptic neuron to be accessed for _pre variables; differs for different Span)
postIdxindex of the post-synaptic neuron to be accessed for _post variables; differs for different Span)
devPrefixdevice prefix, "dd_" for GPU, nothing for CPU
void substitute ( string &  s,
const string &  trg,
const string &  rep 
)

Tool for substituting strings in the neuron code strings or other templates.

template<class T >
std::string toString ( t)

template functions for conversion of various types to C++ strings

void value_substitutions ( string &  code,
const vector< string > &  names,
const vector< double > &  values 
)

This function performs a list of value substitutions for parameters in code snippets.