MCPcopy Create free account
hub / github.com/bgrimstad/splinter / eval_jacobian

Method eval_jacobian

python/splinter/function.py:28–41  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

26 return c_array_to_list(res, num_points)
27
28 def eval_jacobian(self, x):
29 x = self._transform_input(x)
30
31 num_points = len(x) // self._num_variables
32 jac = splinter._call(splinter._get_handle().splinter_bspline_eval_jacobian_row_major, self._handle, (c_double * len(x))(*x), len(x))
33
34 # Convert from ctypes array to Python list of lists
35 # jacobians is a list of the jacobians in all evaluated points
36 jacobians = []
37 for i in range(num_points):
38 jacobians.append([])
39 for j in range(self._num_variables):
40 jacobians[i].append(jac[i * self._num_variables + j])
41 return jacobians
42
43 def eval_hessian(self, x):
44 x = self._transform_input(x)

Callers

nothing calls this directly

Calls 2

_transform_inputMethod · 0.95
_get_handleMethod · 0.80

Tested by

no test coverage detected