---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-13-2a02f39b7113> in <module>
4 xs = np.linspace(-4,4,100)
5 plt.plot(xs, [height(i) for i in xs])
----> 6 sol = minimize(height, [[-4,0]])
7 for key, val in sol.items():
8 print(key, val)
~\Documents\Mark\lpfgopt\lpfgopt\__init__.py in minimize(fun, bounds, args, points, fconstraint, discrete, maxit, tol, seedval, pointset, callback)
102 }
103
--> 104 lf = LeapFrog(**options)
105 return lf.minimize()
~\Documents\Mark\lpfgopt\lpfgopt\leapfrog.py in __init__(self, fun, bounds, args, points, fconstraint, discrete, maxit, tol, seedval, pointset, callback, **kwargs)
184 self.pointset[row][1:] = self.enforce_discrete(
185 self.pointset[row][1:])
--> 186 self.pointset[row][0] = self.f(self.pointset[row][1:])
187
188 self.enforce_constraints()
~\Documents\Mark\lpfgopt\lpfgopt\leapfrog.py in f(self, x)
207 def f(self, x):
208 self.nfev += 1
--> 209 return self.fun(x, *self.args)
210
211
<ipython-input-13-2a02f39b7113> in height(x)
1 def height(x):
----> 2 return f([x,gg(x)])
3
4 xs = np.linspace(-4,4,100)
5 plt.plot(xs, [height(i) for i in xs])
<ipython-input-3-a8687f140bbc> in <lambda>(x)
10
11 # plot the results on a contour plot
---> 12 gg = lambda x: -x**2 + 10 # for plotting purposes
13
14 plt.figure(figsize=(8,8))
TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'int'