tests/geometry/test-eventqueue.cpp
author Dmitriy Morozov <dmitriy@mrzv.org>
Thu, 18 Dec 2008 16:43:42 -0800
branchdev
changeset 97 0a9bd3f34419
parent 55 7e71f5984931
child 200 73e8dce642be
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 <utilities/eventqueue.h>
#include <functional>
#include <iostream>

int main()
{
	typedef EventQueue<int, std::less<int> >			EQ;
	typedef EQ::iterator								iterator;
	 
	EQ queue;

	iterator i = queue.push(4);
	queue.push(2);
	queue.push(7);
	iterator j = queue.push(6);
	queue.push(5);

	*i = 8;
	queue.update(i);
	queue.remove(j);

	while (!queue.empty())
	{
		std::cout << *queue.top() << std::endl;
		queue.pop();
	}
}