unsigned int metric_hausdorff_limit_symmetric(const struct matrix *a, const struct matrix *b, clann_real_type limit) { unsigned int ab, ba; ab = metric_hausdorff_limit(a, b, limit); ba = metric_hausdorff_limit(b, a, limit); return ab > ba ? ab : ba; }
PyObject* hausdorff_limit(PyObject *self, PyObject *args) { /** * Convert input */ PyObject *a = NULL, *b = NULL; clann_real_type limit; if (!PyArg_ParseTuple(args, "OOd", &a, &b, &limit)) return NULL; /** * Call the function */ clann_matrix_type *x = PyCObject_AsVoidPtr(a), *y = PyCObject_AsVoidPtr(b); clann_real_type v = metric_hausdorff_limit(x, y, limit); /** * Convert output */ return Py_BuildValue("d", (double) v); }