#ifndef __topotypes_h__
#define __topotypes_h__

#include <cstring> // for size_t

namespace toposmooth
{
    /*
    // This typedef is only used internally; the public interfaces
    // take either float or doubles (via a template).
    // The TNC optimizer goes crazy if we use float's instead of double's.
    typedef double real_t;
    */
    
    typedef long index_t;
    
    struct edge_t
    {
        index_t v[2];
        
        index_t& start() { return v[0]; }
        const index_t& start() const { return v[0]; }
        
        index_t& end() { return v[1]; }
        const index_t& end() const { return v[1]; }
        
        edge_t()
        {
            v[0] = v[1] = -1;
        }
    };
    
    struct triangle_t
    {
        index_t v[3];
        
        index_t& i() { return v[0]; }
        const index_t& i() const { return v[0]; }
        
        index_t& j() { return v[1]; }
        const index_t& j() const { return v[1]; }
        
        index_t& k() { return v[2]; }
        const index_t& k() const { return v[2]; }
        
        triangle_t()
        {
            v[0] = v[1] = v[2] = -1;
        }
    };
}

#endif /* __topotypes_h__ */
