e22ec775fbde41968ca64ba2ed0e09e8f5cf687d,brian2/codegen/generators/GSL_generator.py,GSLCodeGenerator,write_dataholder,#GSLCodeGenerator#,75
Before Change
def write_dataholder_single(self, var_obj):
raise NotImplementedError
def write_dataholder(self, variables_in_vector):
raise NotImplementedError
def to_replace_vector_vars(self, variables_in_vector, ignore=[]):
raise NotImplementedError
def unpack_namespace_single(self, var_obj, in_vector, in_scalar):
raise NotImplementedError
After Change
def write_dataholder(self, variables_in_vector):
end_statement = self.get_syntax("end_statement")
open_struct = self.get_syntax("open_struct")
end_struct = self.get_syntax("end_struct")
code = ["\n"+self.declare("struct", "dataholder") + open_struct]
code += ["\n\t"+self.declare("int", "_idx", in_struct=True) + end_statement]
for var_obj in variables_in_vector:
if var_obj.name == "t" or "_gsl" in var_obj.name:
continue
code += ["\t"+self.write_dataholder_single(var_obj)]
code += [end_struct]
return ("\n").join(code)
def find_undefined_variables(self, statements):
variables = self.variables
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: brian-team/brian2
Commit Name: e22ec775fbde41968ca64ba2ed0e09e8f5cf687d
Time: 2017-07-10
Author: charleetje@gmail.com
File Name: brian2/codegen/generators/GSL_generator.py
Class Name: GSLCodeGenerator
Method Name: write_dataholder
Project Name: brian-team/brian2
Commit Name: e22ec775fbde41968ca64ba2ed0e09e8f5cf687d
Time: 2017-07-10
Author: charleetje@gmail.com
File Name: brian2/codegen/generators/GSL_generator.py
Class Name: GSLCodeGenerator
Method Name: get_dimension_code
Project Name: brian-team/brian2
Commit Name: e22ec775fbde41968ca64ba2ed0e09e8f5cf687d
Time: 2017-07-10
Author: charleetje@gmail.com
File Name: brian2/codegen/generators/GSL_generator.py
Class Name: GSLCodeGenerator
Method Name: to_replace_vector_vars