include/topology/conesimplex.h
author Dmitriy Morozov <dmitriy@mrzv.org>
Thu, 18 Dec 2008 16:43:42 -0800
branchdev
changeset 97 0a9bd3f34419
parent 79 e48a7036cd88
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

/**
 * Author: Dmitriy Morozov
 * Department of Computer Science, Duke University, 2007
 */

#ifndef __CONESIMPLEX_H__
#define __CONESIMPLEX_H__

#include <list>
#include <iostream>

#include "utilities/types.h"


template<class S>
class ConeSimplex: public S
{
	public:
		typedef		S													Parent;
		typedef		ConeSimplex<S>										Self;
		typedef		std::list<Self>										Cycle;

    public:
								ConeSimplex(const Self& s): 
                                    Parent(s), coned_(s.coned_)         {}
								ConeSimplex(const Parent& parent, 
											bool coned = false):
									Parent(parent), coned_(coned)		{}
	    
		Cycle					boundary() const;
		bool					coned() const							{ return coned_; }
        Dimension               dimension() const                       { return coned_ ? (Parent::dimension() + 1) : Parent::dimension(); }
        
        bool                    operator<(const Self& other) const      { if (coned_ ^ other.coned_) return !coned_; else return Parent::operator<(other); }
        bool                    operator==(const Self& other) const     { return !(coned_ ^ other.coned_) && Parent::operator==(other); }

		std::ostream& 			operator<<(std::ostream& out) const;
		
	private:
		bool					coned_;
};

template<class S>
std::ostream& 		operator<<(std::ostream& out, const ConeSimplex<S>& s)	{ return s.operator<<(out); }

#include "conesimplex.hpp"

#endif // __CONESIMPLEX_H__