MCPcopy Create free account
hub / github.com/Derious/cuMPC / dostuff

Function dostuff

dependence/eigen-3.4.0/bench/sparse_randomsetter.cpp:46–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45template<typename SetterType>
46void dostuff(const char* name, EigenSparseMatrix& sm1)
47{
48 int rows = sm1.rows();
49 int cols = sm1.cols();
50 sm1.setZero();
51 BenchTimer t;
52 SetterType* set1 = new SetterType(sm1);
53 t.reset(); t.start();
54 for (int k=0; k<nentries; ++k)
55 (*set1)(internal::random<int>(0,rows-1),internal::random<int>(0,cols-1)) += 1;
56 t.stop();
57 std::cout << "std::map => \t" << t.value()-rtime
58 << " nnz=" << set1->nonZeros() << std::flush;
59
60 // getchar();
61
62 t.reset(); t.start(); delete set1; t.stop();
63 std::cout << " back: \t" << t.value() << "\n";
64}
65
66int main(int argc, char *argv[])
67{

Callers

nothing calls this directly

Calls 8

rowsMethod · 0.45
colsMethod · 0.45
setZeroMethod · 0.45
resetMethod · 0.45
startMethod · 0.45
stopMethod · 0.45
valueMethod · 0.45
nonZerosMethod · 0.45

Tested by

no test coverage detected