python_c_extension/_disptools.c
/*!
 * Method to apply a lower threshold to the Jacobian.
 */
Method to apply a lower threshold to the Jacobian.
Method to apply a lower threshold to the Jacobian .
static PyObject *method_regularise(PyObject *self, PyObject *args)
{
    FLOATING epsilon;
    PyArrayObject *jacobian = NULL;
    (void) self;
    if (!PyArg_ParseTuple(args, PY_FMT_REGULARISE, &jacobian, &epsilon)) {
        return NULL;
    }
    if (!jacobian) {
        return NULL;
    }
    const int nz = PyArray_DIM(jacobian, 0);
    const int ny = PyArray_DIM(jacobian, 1);
    const int nx = PyArray_DIM(jacobian, 2);
    FLOATING *jacobian_data = (FLOATING*) PyArray_DATA(jacobian);
    regularise(nx, ny, nz, (void*)jacobian_data, epsilon);
    return Py_None;
}
static PyObject * method_regularise ( PyObject * self , PyObject * args ) { FLOATING epsilon ; PyArrayObject * jacobian = NULL ; ( void ) self ; if ( ! PyArg_ParseTuple ( args , PY_FMT_REGULARISE , & jacobian , & epsilon ) ) { return NULL ; } if ( ! jacobian ) { return NULL ; } const int nz = PyArray_DIM ( jacobian , 0 ) ; const int ny = PyArray_DIM ( jacobian , 1 ) ; const int nx = PyArray_DIM ( jacobian , 2 ) ; FLOATING * jacobian_data = ( FLOATING * ) PyArray_DATA ( jacobian ) ; regularise ( nx , ny , nz , ( void * ) jacobian_data , epsilon ) ; return Py_None ; }
Method to apply a lower threshold to the Jacobian.
Method to apply a lower threshold to the Jacobian .
/* Parse arguments */ /* Error check */ /* Get the shape */ /* Get the data pointers */ /* Call the library function to compute the Jacobian */