#include #include #include #include #include void sparse_matmul_coo(float *A_values,int *A_rowIndex,int *A_colIndex,int A_nonZeroCount, float *B_values,int *B_rowIndex,int *B_colIndex,int B_nonZeroCount, float *C_values,int *C_rowIndex,int *C_colIndex,int C_nonZeroCount){ int currentIndex=0; for(int i=0;iB_nonZeroCount)MAX=A_nonZeroCount; else MAX=B_nonZeroCount; float C_values[MAX]; int C_rowIndex[MAX]; int C_colIndex[MAX]; int C_nonZeroCount=0; clock_t start=clock(); sparse_matmul_coo(A_values,A_rowIndex,A_colIndex,A_nonZeroCount, B_values,B_rowIndex,B_colIndex,B_nonZeroCount, C_values,C_rowIndex,C_colIndex,C_nonZeroCount); clock_t end=clock(); std::cout<<"基础的稀疏矩阵乘法时间:"<< double(end-start)/CLOCKS_PER_SEC<<"秒"<