Suppose you have a sparse matrix A[i][j] defined, where there can only be values if 0 <= 2i <= j <= i+n. You could declare a rectangular array: float A[n][2n]; but that would be wasteful, since the actual content of the array is roughly a fourth of what you allocated. Instead, you can define arrays float B[m]; int offset[n]; where m is the number of pairs (i,j) in the domain of A. (In this case, m = n(n+1)/2.) in such a way that the function fetch returns the value of A[i][j] for all legal i and j. int index(int i, int j) { return offset[i] + j; } float fetch(int i, int j) { return B[index(i,j)]; } How do you compute B? For this example: B[0] = 0; B[1] = n-1; B[2] = 2*n-3; B[3] = 3*n-6; etc.