// 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 "print_ijv.h" #include "find.h" #include template IGL_INLINE void igl::print_ijv( const Eigen::SparseMatrix& X, const int offset) { Eigen::Matrix I; Eigen::Matrix J; Eigen::Matrix V; igl::find(X,I,J,V); // Concatenate I,J,V Eigen::Matrix IJV(I.size(),3); IJV.col(0) = I.cast(); IJV.col(1) = J.cast(); IJV.col(2) = V; // Offset if(offset != 0) { IJV.col(0).array() += offset; IJV.col(1).array() += offset; } std::cout<(Eigen::SparseMatrix const&, int); #endif