// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2015 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 "slice_mask.h" #include template IGL_INLINE void igl::slice_mask( const Eigen::PlainObjectBase & X, const Eigen::Array & R, const Eigen::Array & C, Eigen::PlainObjectBase & Y) { int xm = X.rows(); int xn = X.cols(); int ym = R.count(); int yn = C.count(); assert(R.size() == X.rows() && "R.size() should match X.rows()"); assert(C.size() == X.cols() && "C.size() should match X.cols()"); Y.resize(ym,yn); { int yi = 0; for(int i = 0;i IGL_INLINE void igl::slice_mask( const Eigen::PlainObjectBase & X, const Eigen::Array & R, const int dim, Eigen::PlainObjectBase & Y) { switch(dim) { case 1: { const int ym = R.count(); Y.resize(ym,X.cols()); assert(X.rows() == R.size() && "X.rows() should match R.size()"); { int yi = 0; for(int i = 0;i IGL_INLINE DerivedX igl::slice_mask( const Eigen::PlainObjectBase & X, const Eigen::Array & R, const Eigen::Array & C) { DerivedX Y; igl::slice_mask(X,R,C,Y); return Y; } template IGL_INLINE DerivedX igl::slice_mask( const Eigen::PlainObjectBase& X, const Eigen::Array & R, const int dim) { DerivedX Y; igl::slice_mask(X,R,dim,Y); return Y; } #ifdef IGL_STATIC_LIBRARY template void igl::slice_mask >(Eigen::PlainObjectBase > const&, Eigen::Array const&, int, Eigen::PlainObjectBase >&); #endif