... | ... | @@ -22,4 +22,47 @@ Generic name of a function is `wderiv_operation_Nd_t`, where: |
|
|
* `t`:
|
|
|
* `r` for real problems
|
|
|
* `c` for complex problems
|
|
|
# Examples |
|
|
# Sample declarations
|
|
|
```c
|
|
|
/**
|
|
|
* Function computes first derivative with respect to x (df/dx)
|
|
|
* of 3D real function f(x,y,z)
|
|
|
* @param f pointer to function, array of size [nx*ny*nz] (INPUT)
|
|
|
* @param df_dx pointer to function, array of size [nx*ny*nz] (OUTPUT)
|
|
|
* NOTE: dfdx can be the same pointer as f, then result overwrites input
|
|
|
* @return error code
|
|
|
* */
|
|
|
int wderiv_dfdx_3d_r(double *f, double *dfdx);
|
|
|
|
|
|
/**
|
|
|
* Function computes gradient
|
|
|
* of 3D real function f(x,y,z)
|
|
|
* @param f pointer to function, array of size [nx*ny*nz] (INPUT)
|
|
|
* @param dfdx pointer to function, array of size [nx*ny*nz] (OUTPUT)
|
|
|
* @param dfdy pointer to function, array of size [nx*ny*nz] (OUTPUT)
|
|
|
* @param dfdz pointer to function, array of size [nx*ny*nz] (OUTPUT)
|
|
|
* @return error code
|
|
|
* */
|
|
|
int wderiv_gradient_3d_r(double *f, double *dfdx, double *dfdy, double *dfdz);
|
|
|
|
|
|
/**
|
|
|
* Function computes second derivative with respect to z (d^2f/dz^2)
|
|
|
* of 3D complex function f(x,y,z)
|
|
|
* @param f pointer to function, array of size [nx*ny*nz] (INPUT)
|
|
|
* @param d2fdz2 pointer to function, array of size [nx*ny*nz] (OUTPUT)
|
|
|
* NOTE: d2fdz2 can be the same pointer as f, then result overwrites input
|
|
|
* @return error code
|
|
|
* */
|
|
|
int wderiv_d2fdz2_3d_c(double complex *f, double complex *d2fdz2);
|
|
|
|
|
|
/**
|
|
|
* Function computes n-th derivative with respect to x (d^nf/dx^n)
|
|
|
* of 1D complex function f(x)
|
|
|
* @param n order of derivative
|
|
|
* @param f pointer to function, array of size [nx] (INPUT)
|
|
|
* @param dnfdxn pointer to function, array of size [nx] (OUTPUT)
|
|
|
* NOTE: dnfdxn can be the same pointer as f, then result overwrites input
|
|
|
* @return error code
|
|
|
* */
|
|
|
int wderiv_dnfdxn_1d_c(int n, double complex *f, double complex *dnfdxn);
|
|
|
``` |