Improving testing of sparse_matrix

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>