return MATRIX_TYPE_UNKNOWN;
}
-static void set_mm_typecode(int type, MM_typecode * typecode)
-{
- switch (type) {
- case MATRIX_TYPE_COMPLEX:
- mm_set_complex(typecode);
- break;
- case MATRIX_TYPE_REAL:
- mm_set_real(typecode);
- break;
- case MATRIX_TYPE_INTEGER:
- mm_set_integer(typecode);
- break;
- case MATRIX_TYPE_PATTERN:
- mm_set_pattern(typecode);
- break;
- default:
- break;
- }
-}
-
-
-
-
SparseMatrix SparseMatrix_import_matrix_market(FILE * f, int format)
{
int ret_code, type;
return A;
}
-
-
-static void mm_write_comment(FILE * file, char *comment)
-{
- char percent[2] = "%";
- fprintf(file, "%s %s\n", percent, comment);
-}
-
-void SparseMatrix_export_matrix_market(FILE * file, SparseMatrix A,
- char *comment)
-{
- MM_typecode matcode;
-
- mm_initialize_typecode(&matcode);
- mm_set_matrix(&matcode);
- mm_set_sparse(&matcode);
- mm_set_general(&matcode);
- set_mm_typecode(A->type, &matcode);
-
- mm_write_banner(file, matcode);
- mm_write_comment(file, comment);
-
- SparseMatrix_export(file, A);
-
-}
#include "mmio.h"
#include <sparse/SparseMatrix.h>
int mm_get_type(MM_typecode typecode);
-void SparseMatrix_export_matrix_market(FILE * file, SparseMatrix A,
- char *comment);
SparseMatrix SparseMatrix_import_matrix_market(FILE * f, int format);