mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
extend sparse product benchmark with ublas
This commit is contained in:
@@ -123,4 +123,18 @@ void eiToCSparse(const EigenSparseMatrix& src, cs* &dst)
|
||||
#include <boost/numeric/ublas/matrix_sparse.hpp>
|
||||
#include <boost/numeric/ublas/vector_of_vector.hpp>
|
||||
|
||||
// using namespace boost;
|
||||
// using namespace boost::numeric;
|
||||
// using namespace boost::numeric::ublas;
|
||||
|
||||
typedef boost::numeric::ublas::compressed_matrix<Scalar,boost::numeric::ublas::column_major> UblasMatrix;
|
||||
|
||||
void eiToUblas(const EigenSparseMatrix& src, UblasMatrix& dst)
|
||||
{
|
||||
for (int j=0; j<src.cols(); ++j)
|
||||
for (EigenSparseMatrix::InnerIterator it(src.derived(), j); it; ++it)
|
||||
dst(it.index(),j) = it.value();
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user