/* Copyright (c) 2018 -- 2022
   Charles Jordan (Hokkaido University, Sapporo, Japan),
   Michael Joswig, Lars Kastner (Technische Universitaet Berlin, Germany)

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 3, or (at your option) any
   later version: http://www.gnu.org/licenses/gpl.txt.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
-----------------------------------------------------------------------------
*/

#ifndef STRINGIFY_HH
#define STRINGIFY_HH

#include "mptopcom_typedefs.hh"
#include "TriangNode.hh"

template<typename Scalar> 
std::string scalar2string(const Scalar i);

template<typename VT> 
   std::string pmVector2string(const VT& v) {
      std::string result = "[";
      for(Int i=0; i<v.dim(); i++){
         result += scalar2string(v[i]);
         if(i<v.dim()-1){
            result += ",";
         }
      }
      result += "]";
      return result;
   }

pm::Set<Int> support(const TriangNode& t);

bool isFine(const TriangNode& t);

template<typename checkFine>
bool fixesFirstGKZCoord(const gkz_vector_type& flip_gkz) {
   if(checkFine::value) {
      return flip_gkz[1] == 0;
   } else {
      return flip_gkz[0] == 0;
   }
}

Symmetry inverse(const Symmetry& g);
bool refines(const signature_vector_type& sig1, const signature_vector_type& sig2);
const signature_vector_type signature(const Symmetry& g);

#endif
