// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2017 Daniele Panozzo // // 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 "slice_cached.h" #include #include #include #include template IGL_INLINE void igl::slice_cached_precompute( const Eigen::SparseMatrix& X, const Eigen::Matrix & R, const Eigen::Matrix & C, Eigen::SparseMatrix& Y, Eigen::VectorXi& data) { // Create a sparse matrix whose entries are the ids Eigen::SparseMatrix TS = X.template cast(); TS.makeCompressed(); for (unsigned i=0;i TS_sliced; igl::slice(TS,R,C,TS_sliced); Y = TS_sliced.cast(); data.resize(TS_sliced.nonZeros()); for (unsigned i=0;i IGL_INLINE void igl::slice_cached( const Eigen::SparseMatrix& X, Eigen::SparseMatrix& Y, const Eigen::VectorXi& data) { for (unsigned i=0; i(Eigen::SparseMatrix const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::SparseMatrix&, Eigen::Matrix&); template void igl::slice_cached(Eigen::SparseMatrix const&, Eigen::SparseMatrix&, Eigen::Matrix const&); #endif