#include "sparse.h" #define ARRAY_SIZE 10 static void SetupA(SparseArray *A) { int row; int col; int diff; *A = NewSparseArray(ARRAY_SIZE,ARRAY_SIZE,0.0); for (row=0; row= -1 && diff <= 1) { Store(*A,row,col,row+(0.01*col)); } } } } static void SetupB(SparseArray *B) { int row; int col; int diff; *B = NewSparseArray(ARRAY_SIZE,ARRAY_SIZE,0.0); for (row=0; row= -1 && diff <= 1) { Store(*B,row,col,row+(0.01*col)); } } } } static SparseArray Add(SparseArray A,SparseArray B) { SparseArray Sum; int row,col; double aval; double bval; double sum; Sum = NewSparseArray(ARRAY_SIZE,ARRAY_SIZE,0.0); for (row=0; row