// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2016 Michael Rabinovich // // 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 "edge_topology.h" #include "edges.h" template IGL_INLINE int igl::euler_characteristic( const Eigen::MatrixBase & F) { const int nf = F.rows(); const int nv = F.maxCoeff()+1; Eigen::Matrix E; edges(F,E); const int ne = E.rows(); return nv - ne + nf; } #ifdef IGL_STATIC_LIBRARY // Explicit template instantiation template int igl::euler_characteristic >(Eigen::MatrixBase > const&); #endif