1. Description of the problem
Sparse matrices are those matrices where most of the elements are zeros. The use of "sparse" features for storage and calculation can greatly save storage space and improve computational efficiency. To implement a sparse matrix multiplication operation of the operator. The sparse matrix is represented by the ternary order table with "Logical link information" to realize the multiplication of two matrices. The sparse matrix is represented by a cross linked list, and the matrix of the result of the operation is listed in the usual array form
2 Design
2.1 Using a cross linked list to store sparse matrices
In order to effectively store the sparse matrix elements, this paper uses a cross linked list of data storage, the design of the cross-linked list of C + + language described below:
Typedef struct OLNode{
Int i , j ;
ElemType e;
Struct OLNode * right, * down;
}OLNode; *OLink;
Typedef struct{
OLink * rhead, * chead;
Int mu,nu,tu;
}CrossList;
The main algorithm design of 2.2 sparse matrix multiplication
Sparse matrix multiplication operator design is mainly designed to the sparse matrix creation and multiplication operations, the following given the two procedures of C + + language described as: