Graphviz 13.0.0~dev.20241220.2304
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#define MM_MAX_LINE_LENGTH 100025
26#define MatrixMarketBanner "%%MatrixMarket"
27#define MM_MAX_TOKEN_LENGTH 64
28
30
31typedef struct {
32 int type;
35
36int mm_read_banner(FILE * f, MM_typecode * matcode);
37int mm_read_mtx_crd_size(FILE * f, int *M, int *N, int *nz);
38
39/********************* Matrix Market error codes ***************************/
40
41
42#define MM_COULD_NOT_READ_FILE 11
43#define MM_PREMATURE_EOF 12
44#define MM_NOT_MTX 13
45#define MM_NO_HEADER 14
46#define MM_UNSUPPORTED_TYPE 15
47#define MM_LINE_TOO_LONG 16
48
49/******************** Matrix Market internal definitions ********************
50
51 MM_matrix_typecode: 4-character sequence
52
53 ojbect sparse/ data storage
54 dense type scheme
55
56 string position: [0] [1] [2] [3]
57
58 Matrix typecode: M(atrix) C(oord) R(eal) G(eneral)
59 A(array) C(omplex) H(ermitian)
60 P(attern) S(ymmetric)
61 I(nteger) K(kew)
62
63 ***********************************************************************/
64
65#define MM_MTX_STR "matrix"
66#define MM_COORDINATE_STR "coordinate"
67#define MM_SPARSE_STR "coordinate"
68#define MM_COMPLEX_STR "complex"
69#define MM_REAL_STR "real"
70#define MM_INT_STR "integer"
71#define MM_GENERAL_STR "general"
72#define MM_SYMM_STR "symmetric"
73#define MM_HERM_STR "hermitian"
74#define MM_SKEW_STR "skew-symmetric"
75#define MM_PATTERN_STR "pattern"
#define N(n)
Definition bcomps.c:58
matrix_shape_t
Definition mmio.h:29
@ MS_SYMMETRIC
Definition mmio.h:29
@ MS_SKEW
Definition mmio.h:29
@ MS_GENERAL
Definition mmio.h:29
@ MS_HERMITIAN
Definition mmio.h:29
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:33
int type
one of the MATRIX_TYPE_* values from lib/sparse
Definition mmio.h:32