Data structures and algorithms for sparse arrays and matrices, based on index arrays and simple triplet representations, respectively.