21 double *val =
NULL, *v;
28 if ((c = fgetc(f)) !=
'%') {
35 printf(
"Could not process Matrix Market banner.\n");
53 for (i = 0; i < nz; i++) {
54 int num = fscanf(f,
"%d %d %lg\n", &
I[i], &J[i], &val[i]);
66 for (i = 0; i < nzold; i++) {
78 for (i = 0; i < nzold; i++) {
93 for (i = 0; i < nz; i++) {
94 int num = fscanf(f,
"%d %d %d\n", &
I[i], &J[i], &vali[i]);
106 for (i = 0; i < nzold; i++) {
110 vali[nz++] = vali[i];
118 for (i = 0; i < nzold; i++) {
124 vali[nz++] = -vali[i];
132 for (i = 0; i < nz; i++) {
133 int num = fscanf(f,
"%d %d\n", &
I[i], &J[i]);
144 for (i = 0; i < nzold; i++) {
157 for (i = 0; i < nz; i++) {
158 int num = fscanf(f,
"%d %d %lg %lg\n", &
I[i], &J[i], &v[0], &v[1]);
169 val =
gv_recalloc(val, 2 * nz, 4 * nz,
sizeof(
double));
171 for (i = 0; i < nzold; i++) {
175 val[2 * nz] = val[2 * i];
176 val[2 * nz + 1] = val[2 * i + 1];
183 val =
gv_recalloc(val, 2 * nz, 4 * nz,
sizeof(
double));
185 for (i = 0; i < nzold; i++) {
191 val[2 * nz] = -val[2 * i];
192 val[2 * nz + 1] = -val[2 * i + 1];
199 val =
gv_recalloc(val, 2 * nz, 4 * nz,
sizeof(
double));
201 for (i = 0; i < nzold; i++) {
205 val[2 * nz] = val[2 * i];
206 val[2 * nz + 1] = -val[2 * i + 1];
218 type,
sizeof(
double));
225 A->is_symmetric =
true;
226 A->is_pattern_symmetric =
true;
SparseMatrix SparseMatrix_from_coordinate_arrays(int nz, int m, int n, int *irn, int *jcn, void *val0, int type, size_t sz)