# How to use the numdifftools.multicomplex.Bicomplex.__array_wrap__ function in numdifftools

## To help you get started, weâ€™ve selected a few numdifftools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

pbrod / numdifftools / src / numdifftools / finite_difference.py View on Github
``````def _multicomplex2(f, fx, x, h):
z = Bicomplex(x + 1j * h, h)
return Bicomplex.__array_wrap__(f(z)).imag12``````
pbrod / numdifftools / src / numdifftools / core.py View on Github
``````def _multicomplex2(f, fx, x, h):
z = Bicomplex(x + 1j * h, h)
return Bicomplex.__array_wrap__(f(z)).imag12``````
pbrod / numdifftools / src / numdifftools / core.py View on Github
``````def _multicomplex2(f, fx, x, h):
n = len(x)
increments = np.identity(n) * h
cmplx_wrap = Bicomplex.__array_wrap__
partials = [cmplx_wrap(f(Bicomplex(x + 1j * hi, hi))).imag12
for hi in increments]
return np.array(partials)``````
pbrod / numdifftools / src / numdifftools / finite_difference.py View on Github
``````def _multicomplex2(f, fx, x, h):
n = len(x)
increments = np.identity(n) * h
cmplx_wrap = Bicomplex.__array_wrap__
partials = [cmplx_wrap(f(Bicomplex(x + 1j * hi, hi))).imag12
for hi in increments]
return np.array(partials)``````
pbrod / numdifftools / src / numdifftools / finite_difference.py View on Github
``````def _multicomplex(f, fx, x, h):
z = Bicomplex(x + 1j * h, 0)
return Bicomplex.__array_wrap__(f(z)).imag``````
pbrod / numdifftools / src / numdifftools / core.py View on Github
``````def _multicomplex(f, fx, x, h):
z = Bicomplex(x + 1j * h, 0)
return Bicomplex.__array_wrap__(f(z)).imag``````

## numdifftools

Solves automatic numerical differentiation problems in one or more variables.

BSD-3-Clause
Latest version published 1 year ago

47 / 100