Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
eigen_sparse_triplet.h File Reference
#include <vector>
#include <Eigen/SparseCore>
Include dependency graph for eigen_sparse_triplet.h:

Namespaces

namespace  drake
namespace  drake::math

Functions

template<typename Scalar, int Options, typename StorageIndex>
std::vector< Eigen::Triplet< Scalar > > SparseMatrixToTriplets (const Eigen::SparseMatrix< Scalar, Options, StorageIndex > &matrix)
 For a sparse matrix, return a vector of triplets, such that we can reconstruct the matrix using setFromTriplet function.
template<typename Derived>
void SparseMatrixToRowColumnValueVectors (const Derived &matrix, std::vector< Eigen::Index > &row_indices, std::vector< Eigen::Index > &col_indices, std::vector< typename Derived::Scalar > &val)
 For a sparse matrix, return the row indices, the column indices, and value of the non-zero entries.