Пример #1
0
clann_real_type
metric_hausdorff_symmetric(const struct matrix *a,
                           const struct matrix *b)
{
    clann_real_type ab, ba; 

    ab = metric_hausdorff(a, b);
    ba = metric_hausdorff(b, a);

    return ab > ba ? ab : ba;
}
Пример #2
0
PyObject*
hausdorff(PyObject *self, PyObject *args)
{
    /**
     * Convert input
     */
    PyObject *a = NULL,
             *b = NULL;

    if (!PyArg_ParseTuple(args, "OO", &a, &b))
        return NULL;

    /**
     * Call the function
     */
    clann_matrix_type *x = PyCObject_AsVoidPtr(a),
                      *y = PyCObject_AsVoidPtr(b);

    clann_real_type v = metric_hausdorff(x, y);

    /**
     * Convert output
     */
    return Py_BuildValue("d", (double) v);
}