// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2018 Alec Jacobson // // 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 "accumarray.h" #include template < typename DerivedS, typename DerivedV, typename DerivedA > void igl::accumarray( const Eigen::MatrixBase & S, const Eigen::MatrixBase & V, Eigen::PlainObjectBase & A) { assert(V.size() == S.size() && "S and V should be same size"); if(S.size() == 0) { A.resize(0,1); return; } A.setZero(S.maxCoeff()+1,1); for(int s = 0;s void igl::accumarray( const Eigen::MatrixBase & S, const typename DerivedA::Scalar V, Eigen::PlainObjectBase & A) { if(S.size() == 0) { A.resize(0,1); return; } A.setZero(S.maxCoeff()+1,1); for(int s = 0;s, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::Matrix::Scalar, Eigen::PlainObjectBase >&); template void igl::accumarray, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::PlainObjectBase >&); #endif