examples/rips/rips.cpp
author Dmitriy Morozov <morozov@cs.duke.edu>
Mon, 22 Sep 2008 21:53:25 -0700
branchdev
changeset 96 f283106e8124
parent 94 900f42b643de
child 100 884f70adc576
permissions -rw-r--r--
Switching README to PanDoc

#include <topology/rips.h>

struct Distances
{
    typedef         int             IndexType;
    typedef         double          DistanceType;

    DistanceType    operator()(IndexType a, IndexType b) const      { return std::abs(a - b); }

    size_t          size() const                                    { return 2000; }
    IndexType       begin() const                                   { return 0; }
    IndexType       end() const                                     { return size(); }
};

int main(int argc, char* argv[])
{
#ifdef LOGGING
	rlog::RLogInit(argc, argv);

	stdoutLog.subscribeTo( RLOG_CHANNEL("error") );
	stdoutLog.subscribeTo( RLOG_CHANNEL("rips/info") );
#endif

    Distances distances;
    
#if 0
    ExplicitDistances<Distances> explicit_distances(distances);
    Rips<ExplicitDistances<Distances> > rips(explicit_distances);
#else
    Rips<Distances> rips(distances);
#endif

    //rips.generate(3, distances.size());
    rips.generate(3, 50);
    //rips.print();
    
    std::cout << "Size: " << rips.size() << std::endl;
}