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