add/update some benchmark files used to test/compare sparse module features

This commit is contained in:
Gael Guennebaud
2008-10-19 17:06:11 +00:00
parent ecc6c43dba
commit 76fe2e1b34
6 changed files with 525 additions and 18 deletions

View File

@@ -72,3 +72,23 @@ void eiToMtl(const EigenSparseMatrix& src, MtlSparse& dst)
ins[it.index()][j] = it.value();
}
#endif
#ifdef CSPARSE
extern "C" {
#include "cs.h"
}
void eiToCSparse(const EigenSparseMatrix& src, cs* &dst)
{
cs* aux = cs_spalloc (0, 0, 1, 1, 1);
for (int j=0; j<src.cols(); ++j)
for (EigenSparseMatrix::InnerIterator it(src.derived(), j); it; ++it)
if (!cs_entry(aux, it.index(), j, it.value()))
{
std::cout << "cs_entry error\n";
exit(2);
}
dst = cs_compress(aux);
// cs_spfree(aux);
}
#endif