You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include, in each model template, an array containing the names of its variables and parameters:
static const std::string param_names[]={"a", "b", "c", "d"};
static const std::string var_names[]={"u", "v"};
This allows to obtain (as strings) the names of the variables/parameters (which are now only named values from the enum), which is interesting e.g. for generic loading of the initial configuration.
Also, consider the pros/cons of using a map instead of the enum+array.
Include, in each model template, an array containing the names of its variables and parameters:
static const std::string param_names[]={"a", "b", "c", "d"};
static const std::string var_names[]={"u", "v"};
This allows to obtain (as strings) the names of the variables/parameters (which are now only named values from the enum), which is interesting e.g. for generic loading of the initial configuration.
Also, consider the pros/cons of using a map instead of the enum+array.
More alternatives in: https://stackoverflow.com/questions/7354305/c-using-x-macro-to-define-enum-and-string-array-inside-class
The text was updated successfully, but these errors were encountered: