907f1ea941f2293f45b0578f96b8528dda24ef8c,brian2/stateupdaters/exponential_euler.py,ExponentialEulerStateUpdater,__call__,#ExponentialEulerStateUpdater#Any#Any#Any#,63

Before Change


            A_name = "_A_" + var
            BA_name = "_BA_" + var
            // Calculate A and B/A
            code += [A_name + " = " + str(A)]
            code += [BA_name + " = " + str(B/A)]
            // The actual update step
            update = "_{var} = ({var} + {BA})*exp(-{A} * dt) - BA"

After Change


        code = []
        for var, (A, B) in system.iteritems():
            s_var = sp.Symbol(var)
            s_dt = sp.Symbol("dt")
            if B != 0:
                BA = B / A
                // Avoid calculating B/A twice
                BA_name = "_BA_" + var
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 2

Instances


Project Name: brian-team/brian2
Commit Name: 907f1ea941f2293f45b0578f96b8528dda24ef8c
Time: 2013-05-30
Author: marcel.stimberg@ens.fr
File Name: brian2/stateupdaters/exponential_euler.py
Class Name: ExponentialEulerStateUpdater
Method Name: __call__


Project Name: mathics/Mathics
Commit Name: a74a4a6c1f2b574ab039fd0d3797eaa65697b03d
Time: 2016-08-23
Author: Bernhard.Liebl@gmx.org
File Name: mathics/builtin/manipulate.py
Class Name: Manipulate
Method Name: apply


Project Name: mathics/Mathics
Commit Name: 7a629259a1c42ee25eae800f1968418b05d503ba
Time: 2016-08-16
Author: Bernhard.Liebl@gmx.org
File Name: mathics/builtin/image.py
Class Name: ImageAtom
Method Name: make_boxes


Project Name: brian-team/brian2
Commit Name: 96d693619f48a2f0ee2a5781e387d900976a01cd
Time: 2015-09-29
Author: marcel.stimberg@inserm.fr
File Name: brian2/stateupdaters/exact.py
Class Name: LinearStateUpdater
Method Name: __call__