Made interp use sparse matrices to reduce memory usage.