include/topology/conesimplex.h
author Dmitriy Morozov <morozov@cs.duke.edu>
Wed, 27 Feb 2008 17:44:46 -0500
branchar
changeset 78 20e1dff50d03
parent 22 c42734397d62
child 79 e48a7036cd88
permissions -rw-r--r--
ConeSimplex correctly reports dimension()

/**
 * 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 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(); }

		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__