Partially working TDCS sparse matrix check code