// 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 "cumsum.h" #include #include template IGL_INLINE void igl::cumsum( const Eigen::PlainObjectBase & X, const int dim, Eigen::PlainObjectBase & Y) { using namespace Eigen; using namespace std; Y.resize(X.rows(),X.cols()); // get number of columns (or rows) int num_outer = (dim == 1 ? X.cols() : X.rows() ); // get number of rows (or columns) int num_inner = (dim == 1 ? X.rows() : X.cols() ); // This has been optimized so that dim = 1 or 2 is roughly the same cost. // (Optimizations assume ColMajor order) if(dim == 1) { #pragma omp parallel for for(int o = 0;o, Eigen::Matrix >(Eigen::PlainObjectBase > const&, int, Eigen::PlainObjectBase >&); template void igl::cumsum, Eigen::Matrix >(Eigen::PlainObjectBase > const&, int, Eigen::PlainObjectBase >&); template void igl::cumsum, Eigen::Matrix >(Eigen::PlainObjectBase > const&, int, Eigen::PlainObjectBase >&); template void igl::cumsum, Eigen::Matrix >(Eigen::PlainObjectBase > const&, int, Eigen::PlainObjectBase >&); template void igl::cumsum, Eigen::Matrix >(Eigen::PlainObjectBase > const&, int, Eigen::PlainObjectBase >&); #endif