// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2013 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 "repmat.h" template IGL_INLINE void igl::repmat( const Eigen::MatrixBase & A, const int r, const int c, Eigen::PlainObjectBase & B) { assert(r>0); assert(c>0); // Make room for output B.resize(r*A.rows(),c*A.cols()); // copy tiled blocks for(int i = 0;i IGL_INLINE void igl::repmat( const Eigen::SparseMatrix & A, const int r, const int c, Eigen::SparseMatrix & B) { assert(r>0); assert(c>0); B.resize(r*A.rows(),c*A.cols()); B.reserve(r*c*A.nonZeros()); for(int i = 0;i::InnerIterator it(A,k); it; ++it) { B.insert(i*A.rows()+it.row(),j*A.cols() + it.col()) = it.value(); } } } } B.finalize(); } #ifdef IGL_STATIC_LIBRARY // Explicit template instantiation // generated by autoexplicit.sh template void igl::repmat, Eigen::Matrix >(Eigen::MatrixBase > const&, int, int, Eigen::PlainObjectBase >&); template void igl::repmat, Eigen::Matrix >(Eigen::MatrixBase > const&, int, int, Eigen::PlainObjectBase >&); template void igl::repmat, Eigen::Matrix >(Eigen::MatrixBase > const&, int, int, Eigen::PlainObjectBase >&); #endif