Skip to content

Commit

Permalink
Merge pull request #167 from thisandthatuser/docfix
Browse files Browse the repository at this point in the history
Fixed tutorial bug.
  • Loading branch information
bluescarni authored Aug 9, 2024
2 parents 58902a3 + 8aad979 commit 2fcf69e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/tutorials/coding_udp_simple.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,10 @@ our fitness method into C code.
>>> class jit_rosenbrock:
... def __init__(self,dim):
... self.dim = dim
... @jit
... def fitness(self,x):
... return jit_rosenbrock._fitness(x)
... @jit
... def _fitness(x):
... retval = np.zeros((1,))
... for i in range(len(x) - 1):
... retval[0] += 100.*(x[i + 1]-x[i]**2)**2+(1.-x[i])**2
Expand Down

0 comments on commit 2fcf69e

Please sign in to comment.