add sparse matrix impl using triple