539ca59c8193345663217018a54bc640671f2c86,scipy/optimize/optimize.py,,_minimize_bfgs,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,1058
Before Change
rhok = 1000.0
if disp:
print("Divide-by-zero encountered: rhok assumed large")
if isinf(rhok): // this is patch for NumPy
rhok = 1000.0
if disp:
print("Divide-by-zero encountered: rhok assumed large")
A1 = I - sk[:, np.newaxis] * yk[np.newaxis, :] * rhok
A2 = I - yk[:, np.newaxis] * sk[np.newaxis, :] * rhok
Hk = np.dot(A1, np.dot(Hk, A2)) + (rhok * sk[:, np.newaxis] *
sk[np.newaxis, :])
After Change
rhok_inv = np.dot(yk, sk)
// this was handled in numeric, let it remaines for more safety
if rhok_inv == 0.:
rhok = 1000.0
if disp:
print("Divide-by-zero encountered: rhok assumed large")
else:
rhok = 1. / rhok_inv
A1 = I - sk[:, np.newaxis] * yk[np.newaxis, :] * rhok
A2 = I - yk[:, np.newaxis] * sk[np.newaxis, :] * rhok
Hk = np.dot(A1, np.dot(Hk, A2)) + (rhok * sk[:, np.newaxis] *
sk[np.newaxis, :])
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: scipy/scipy
Commit Name: 539ca59c8193345663217018a54bc640671f2c86
Time: 2020-06-17
Author: koposov@ast.cam.ac.uk
File Name: scipy/optimize/optimize.py
Class Name:
Method Name: _minimize_bfgs
Project Name: scipy/scipy
Commit Name: a50ca1edd57935e1006cdb146d6c5bcf231c859f
Time: 2020-03-17
Author: andyfaff@gmail.com
File Name: scipy/optimize/_differentialevolution.py
Class Name: DifferentialEvolutionSolver
Method Name: solve
Project Name: brian-team/brian2
Commit Name: f8b5a82bde87721f9d5500c00e1505c8fd42f7b4
Time: 2018-08-28
Author: marcel.stimberg@inserm.fr
File Name: brian2/core/functions.py
Class Name:
Method Name: timestep