// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2016 Michael Rabinovich <michaelrabinovich27@gmail.com@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "euler_characteristic.h"

#include <igl/edge_topology.h>

template <typename Scalar, typename Index>
IGL_INLINE int igl::euler_characteristic(
  const Eigen::PlainObjectBase<Scalar> & V,
  const Eigen::PlainObjectBase<Index> & F)
{

  int euler_v = V.rows();
  Eigen::MatrixXi EV, FE, EF;
  igl::edge_topology(V, F, EV, FE, EF);
  int euler_e = EV.rows();
  int euler_f = F.rows();

  int euler_char = euler_v - euler_e + euler_f;
  return euler_char;

}

#ifdef IGL_STATIC_LIBRARY
// Explicit template specialization
// generated by autoexplicit.sh
#endif
