some setindex methods for sparse matrix.

fixes #6647