25ca9c249fd3e11bb166b42ffeb2433036964bd1,brian2/codegen/generators/GSL_generator.py,GSLWeaveCodeGenerator,write_dataholder,#GSLWeaveCodeGenerator#Any#,350

Before Change


        return "const double _gsl_{var}_f{ind}".format(var=var, ind=ind)

    def write_dataholder(self, var):
        try:
            var_obj = self.variables[var]
        except:
            var_obj = self.other_variables[var]
        dtype = self.generator.c_data_type(var_obj.dtype)
        if isinstance(var_obj, ArrayVariable):
            pointer_name = self.generator.get_array_name(var_obj, access_data=True)
            restrict = self.generator.restrict
            if var_obj.scalar:
                restrict = ""
            return "{dtype}* {res} {var};".format(dtype=dtype, res=restrict, var=pointer_name)
        else:

After Change


            return "{dtype} {var};".format(dtype=dtype, var=var_obj.name)

    def write_dataholder(self, variables_in_vector):
        code = ["\nstruct dataholder\n{\n\tint _idx;"]
        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 += ["\n};"]
        return ("\n").join(code)

    def to_replace_vector_vars(self, variables_in_vector):
        to_replace = {}
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

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: write_dataholder


Project Name: biolab/orange3
Commit Name: 959f696b68e68ab67ea44b49dd1070c217ee62b1
Time: 2016-09-13
Author: marko.toplak@gmail.com
File Name: Orange/preprocess/transformation.py
Class Name: Transformation
Method Name: __call__


Project Name: AlexsLemonade/refinebio
Commit Name: 86fa89f0f50e153d625108d93f1f9eb8ee59719e
Time: 2019-11-01
Author: davidsmejia@gmail.com
File Name: workers/data_refinery_workers/processors/create_compendia.py
Class Name:
Method Name: _create_result_objects