// 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 "invert_diag.h" template IGL_INLINE void igl::invert_diag( const Eigen::SparseCompressedBase& X, MatY& Y) { typedef typename DerivedX::Scalar Scalar; #ifndef NDEBUG Eigen::SparseMatrix tmp = X; Eigen::SparseVector dX = tmp.diagonal().sparseView(); // Check that there are no zeros along the diagonal assert(dX.nonZeros() == dX.size()); #endif // http://www.alecjacobson.com/weblog/?p=2552 if((void *)&Y != (void *)&X) { Y = X; } // Iterate over outside for(int k=0; k, Eigen::SparseMatrix >(Eigen::SparseCompressedBase> const&, Eigen::SparseMatrix&); template void igl::invert_diag, Eigen::SparseMatrix >(Eigen::SparseCompressedBase> const&, Eigen::SparseMatrix&); #endif