#include "harwell_boeing.h" template IGL_INLINE void igl::harwell_boeing( const Eigen::SparseMatrix & A, int & num_rows, std::vector & V, std::vector & R, std::vector & C) { num_rows = A.rows(); int num_cols = A.cols(); int nnz = A.nonZeros(); V.resize(nnz); R.resize(nnz); C.resize(num_cols+1); // Assumes outersize is columns assert(A.cols() == A.outerSize()); int column_pointer = 0; int i = 0; int k = 0; // Iterate over outside for(; k::InnerIterator it (A,k); it; ++it) { V[i] = it.value(); R[i] = it.row(); i++; // Also increment column pointer column_pointer++; } } // by convention C[num_cols] = nnz C[k] = column_pointer; } #ifndef IGL_HEADER_ONLY // Explicit template specialization // generated by autoexplicit.sh template void igl::harwell_boeing(Eigen::SparseMatrix const&, int&, std::vector >&, std::vector >&, std::vector >&); #endif