25ca9c249fd3e11bb166b42ffeb2433036964bd1,brian2/codegen/generators/GSL_generator.py,GSLWeaveCodeGenerator,unpack_namespace,#GSLWeaveCodeGenerator#,377
Before Change
var_obj = self.variables[var]
except:
var_obj = self.other_variables[var]
if isinstance(var_obj, ArrayVariable):
pointer_name = self.generator.get_array_name(var_obj, access_data=True)
array_name = self.generator.get_array_name(var_obj, access_data=False)
if in_vector:
return "p.{ptr} = {array};".format(ptr=pointer_name, array=array_name)
else:
return ""
else:
if in_vector:
return "p.{var} = {var};".format(var=var)
else:
return ""
After Change
return ""
def unpack_namespace(self, variables_in_vector, variables_in_scalar):
code = []
for var_obj in self.variables.values():
in_vector = var_obj in variables_in_vector
in_scalar = var_obj in variables_in_scalar
code += [self.unpack_namespace_single(var_obj, in_vector, in_scalar)]
return ("\n").join(code)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 17
Instances
Project Name: brian-team/brian2
Commit Name: 25ca9c249fd3e11bb166b42ffeb2433036964bd1
Time: 2017-07-05
Author: charleetje@gmail.com
File Name: brian2/codegen/generators/GSL_generator.py
Class Name: GSLWeaveCodeGenerator
Method Name: unpack_namespace
Project Name: brian-team/brian2
Commit Name: 25ca9c249fd3e11bb166b42ffeb2433036964bd1
Time: 2017-07-05
Author: charleetje@gmail.com
File Name: brian2/codegen/generators/GSL_generator.py
Class Name: GSLWeaveCodeGenerator
Method Name: unpack_namespace
Project Name: brian-team/brian2
Commit Name: a21b67aed967b3932019c8b0d266bf4098a55d2a
Time: 2017-07-06
Author: charleetje@gmail.com
File Name: brian2/codegen/generators/GSL_generator.py
Class Name: GSLCythonCodeGenerator
Method Name: write_dataholder
Project Name: brian-team/brian2
Commit Name: 25ca9c249fd3e11bb166b42ffeb2433036964bd1
Time: 2017-07-05
Author: charleetje@gmail.com
File Name: brian2/codegen/generators/GSL_generator.py
Class Name: GSLWeaveCodeGenerator
Method Name: write_dataholder