inline void Compute ( const Eigen::MatrixXd& spd_mat, Linear_SolverT * linear_solver ) { linear_solver->compute(spd_mat.sparseView()); }
/** * Returns a sparse ROWS x COLS matrix of all ones. * * TODO: This function returns a sparse representation of a dense matrix, * which might not be extremely efficient, but does make it easier downstream. */ Matrix sparse_ones(int rows, int cols) { Eigen::MatrixXd ones = Eigen::MatrixXd::Ones(rows, cols); Matrix mat = ones.sparseView(); return mat; }
void setMatrix(EigenMatrix& m, Eigen::MatrixXd const& tmp) { m.getRawMatrix() = tmp.sparseView(); }