Graphviz 14.0.3~dev.20251029.0425
Loading...
Searching...
No Matches
mmio.h
Go to the documentation of this file.
1
6/*************************************************************************
7 * Copyright (c) 2011 AT&T Intellectual Property
8 * All rights reserved. This program and the accompanying materials
9 * are made available under the terms of the Eclipse Public License v1.0
10 * which accompanies this distribution, and is available at
11 * https://www.eclipse.org/legal/epl-v10.html
12 *
13 * Contributors: Details at https://graphviz.org
14 *************************************************************************/
15/*
16* Matrix Market I/O library for ANSI C
17*
18* See http://math.nist.gov/MatrixMarket for details.
19*
20*
21*/
22
23#pragma once
24
25#include <stdio.h>
26
27#define MM_MAX_LINE_LENGTH 100025
28#define MatrixMarketBanner "%%MatrixMarket"
29#define MM_MAX_TOKEN_LENGTH 64
30
32
33typedef struct {
34 int type;
37
38int mm_read_banner(FILE * f, MM_typecode * matcode);
39int mm_read_mtx_crd_size(FILE * f, int *M, int *N, int *nz);
40
41/********************* Matrix Market error codes ***************************/
42
43
44#define MM_COULD_NOT_READ_FILE 11
45#define MM_PREMATURE_EOF 12
46#define MM_NOT_MTX 13
47#define MM_NO_HEADER 14
48#define MM_UNSUPPORTED_TYPE 15
49#define MM_LINE_TOO_LONG 16
50
51/******************** Matrix Market internal definitions ********************
52
53 MM_matrix_typecode: 4-character sequence
54
55 ojbect sparse/ data storage
56 dense type scheme
57
58 string position: [0] [1] [2] [3]
59
60 Matrix typecode: M(atrix) C(oord) R(eal) G(eneral)
61 A(array) C(omplex) H(ermitian)
62 P(attern) S(ymmetric)
63 I(nteger) K(kew)
64
65 ***********************************************************************/
66
67#define MM_MTX_STR "matrix"
68#define MM_COORDINATE_STR "coordinate"
69#define MM_SPARSE_STR "coordinate"
70#define MM_COMPLEX_STR "complex"
71#define MM_REAL_STR "real"
72#define MM_INT_STR "integer"
73#define MM_GENERAL_STR "general"
74#define MM_SYMM_STR "symmetric"
75#define MM_HERM_STR "hermitian"
76#define MM_SKEW_STR "skew-symmetric"
77#define MM_PATTERN_STR "pattern"
#define N(n)
Definition bcomps.c:58
matrix_shape_t
Definition mmio.h:31
@ MS_SYMMETRIC
Definition mmio.h:31
@ MS_SKEW
Definition mmio.h:31
@ MS_GENERAL
Definition mmio.h:31
@ MS_HERMITIAN
Definition mmio.h:31
int mm_read_mtx_crd_size(FILE *f, int *M, int *N, int *nz)
Definition mmio.c:92
int mm_read_banner(FILE *f, MM_typecode *matcode)
Definition mmio.c:28
#define M
Definition randomkit.c:90
matrix_shape_t shape
Definition mmio.h:35
int type
one of the MATRIX_TYPE_* values from lib/sparse
Definition mmio.h:34