author Dmitriy Morozov <dmitriy@mrzv.org>
Thu, 18 Dec 2008 16:43:42 -0800
changeset 97 0a9bd3f34419
parent 94 900f42b643de
child 100 884f70adc576
permissions -rw-r--r--
Intermediate commit while converting to the new architecture * Converted Filtration into StaticPersistence and DynamicPersistenceTrails (both right now work with the underlying std::vector rather than std::list order) * Filtration is now just an auxilliary glue (a map between Complex and Persistence) * Whether chains are vectors or lists can be interchanged * Added PersistenceDiagram with a simple bottleneck_distance() function * Converted triangle, alphashapes3d, and cech-complex examples * Lots of organizational changes (factoring utilities out into containers.h, indirect.h, property-maps.h) * Trying to document along the way with NaturalDocs-type comments

#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") );

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

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