Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "SparseMatrix.h"
int main(int argc, char **argv) {
long m, n, nz ;
int P ;
struct sparsematrix A ;
printf("Test MMDeleteSparseMatrix: ");
MMSparseMatrixInit(&A) ;
m = 240 ;
n = 170 ;
nz = 12 ;
P = 40 ;
A.m = m ;
A.n = n ;
A.NrNzElts = nz ;
A.NrProcs = P ;
A.MMTypeCode[2] = 'C' ; /* complex matrix */
A.MMTypeCode[0] = 'D' ; /* distributed matrix, we do not test
a weighted matrix */
MMSparseMatrixAllocateMemory(&A) ;
MMDeleteSparseMatrix(&A) ;
/* Check result values */
if (A.MMTypeCode[0] != ' ' ||
A.MMTypeCode[1] != ' ' ||
A.MMTypeCode[2] != ' ' ||
A.MMTypeCode[3] != ' ' ||
strcmp(A.Banner,"") != 0 ||
strcmp(A.Object,"") != 0 ||
strcmp(A.Format,"") != 0 ||
strcmp(A.Field,"") != 0 ||
strcmp(A.Symmetry,"") != 0 ||
A.NrNzElts != 0 ||
A.m != 0 ||
A.n != 0 ||
A.NrDummies != 0 ||
A.NrProcs != 0 ||
A.i != NULL ||
A.j != NULL ||
A.ReValue != NULL ||
A.ImValue != NULL ||
A.dummy != NULL ||
A.Pstart != NULL ||
A.header != NULL ||
A.tail != NULL ||
A.NrRowWeights != 0 ||
A.NrColWeights != 0 ||
A.RowWeights != NULL ||
A.ColWeights != NULL ||
A.RowLambda != NULL ||
A.ColLambda != NULL ||
A.RowMark != NULL ||
A.ColMark != NULL ) {
printf("Error\n") ;
exit(1) ;
}
printf("OK\n") ;
exit(0);
} /* end main */