| 282 | } |
| 283 | |
| 284 | EIGEN_DONT_INLINE Scalar* setrand_eigen_google_sparse(const Coordinates& coords, const Values& vals) |
| 285 | { |
| 286 | using namespace Eigen; |
| 287 | SparseMatrix<Scalar> mat(SIZE,SIZE); |
| 288 | { |
| 289 | RandomSetter<SparseMatrix<Scalar>, GoogleSparseHashMapTraits> setter(mat); |
| 290 | for (int i=0; i<coords.size(); ++i) |
| 291 | setter(coords[i].x(), coords[i].y()) += vals[i]; |
| 292 | CHECK_MEM; |
| 293 | } |
| 294 | return &mat.coeffRef(coords[0].x(), coords[0].y()); |
| 295 | } |
| 296 | #endif |
| 297 | |
| 298 |