Implement a custom memory-efficient data structure to represent a sparse matrix, and write a function to perform matrix-vector multiplication.