bindings/python/distances.cpp
author Dmitriy Morozov <dmitriy@mrzv.org>
Sat, 28 Nov 2009 16:45:42 -0800
branchdev
changeset 174 3f1034dca432
parent 147 d39a20acb253
permissions -rw-r--r--
Instrumented code for counting: * added counters to addition in cohomology and ChainWrapper * rips-pairwise-cohomology counts the maximum elements stored in the cycles * added alphashapes3d-cohomology * moved progress_display from DynamicPersistence to StaticPersistence

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

#include "distances.h"
namespace dp = dionysus::python;

boost::shared_ptr<dp::ListPointPairwiseDistances>       init_from_list(bp::list lst)
{
    boost::shared_ptr<dp::ListPointPairwiseDistances>   p(new dp::ListPointPairwiseDistances(lst));
    return p;
}

void export_pairwise_distances()
{
    bp::class_<dp::ListPointPairwiseDistances>("PairwiseDistances", bp::no_init)
        .def("__init__",        bp::make_constructor(&init_from_list))
        .def("__len__",         &dp::ListPointPairwiseDistances::size)
        .def("__call__",        &dp::ListPointPairwiseDistances::operator())
    ;
}