Ejemplo n.º 1
0
unsigned int
metric_hausdorff_angle_symmetric(const struct matrix *a,
                                 const struct matrix *b,
                                 clann_real_type limit)
{
    unsigned int ab, ba; 

    ab = metric_hausdorff_angle(a, b, limit);
    ba = metric_hausdorff_angle(b, a, limit);

    return ab > ba ? ab : ba;
}
Ejemplo n.º 2
0
Archivo: metric.c Proyecto: jpzm/clann
PyObject*
hausdorff_angle(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_angle(x, y, limit);

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