File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed
simple-packaging/src/rosen Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change 22import numpy as np
33
44def rosen (x ):
5- """The Rosenbrock function"""
5+ """Calculates the Rosenbrock function.
6+
7+ Parameters
8+ ----------
9+ x : numpy.ndarray
10+ Input to the Rosenbrock function
11+
12+ Returns
13+ -------
14+ numpy.float64
15+ The evaluation of the Rosenbrock function
16+ """
17+ print ('this is new' )
618 return sum (100.0 * (x [1 :] - x [:- 1 ]** 2.0 )** 2.0 + (1 - x [:- 1 ])** 2.0 )
719
820
921def rosen_der (x ):
10- """Gradient of the Rosenbrock function"""
22+ """Gradient of the Rosenbrock function
23+
24+ Parameters
25+ ----------
26+ x : numpy.ndarray
27+ Input to the Rosenbrock function
28+
29+ Returns
30+ -------
31+ numpy.ndarray
32+ The evaluation of the derivatives of the Rosenbrock function
33+ """
1134 xm = x [1 :- 1 ]
1235 xm_m1 = x [:- 2 ]
1336 xm_p1 = x [2 :]
You can’t perform that action at this time.
0 commit comments