some setindex methods for sparse matrix.

fixes #6647
Merge pull request #6762 from tanmaykm/sparse

some setindex methods for sparse matrix.