bindings/python/utils.h
author Christos Mantoulidis <cmad@stanford.edu>
Tue, 28 Jul 2009 10:58:53 -0700
branchdev
changeset 153 7731c42892de
parent 130 580eaa850c4f
child 143 b555e6587908
permissions -rw-r--r--
Modified WeightedRips::generate() to incorporate the simplex-appearance-value computation (before it would have to be done explicitly by the user by a for-loop after the call to generate())

#ifndef __PYTHON_UTILS_H__
#define __PYTHON_UTILS_H__

#include <boost/python.hpp>
namespace bp = boost::python;

namespace dionysus {
namespace python   {

struct PythonCmp
{
    template<class T>
    bool            operator()(T x1, T x2) const            { return cmp_(x1, x2) < 0; }

                    PythonCmp(bp::object cmp): cmp_(cmp)    {}

    bp::object cmp_;
};

} } // namespace dionysus::python

#endif