bindings/python/utils.h
author Dmitriy Morozov <dmitriy@mrzv.org>
Tue, 14 Apr 2009 14:38:08 -0700
branchdev
changeset 129 95454ea3f9c0
child 130 580eaa850c4f
permissions -rw-r--r--
Cleaned up Python bindings to restore functionality: * StaticPersistence is iterable, its nodes are usable (sign, pair, cycle) * StaticPersistence knows how to map its nodes into Filtration indices * moved PythonCmp into utils.h * minor cosmetic changes

#ifndef __PYTHON_UTILS_H__
#define __PYTHON_UTILS_H__

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

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

    object cmp_;
};

#endif