Logical indexing for sparse matrices.
close #1994