sparse_sys.h
Go to the documentation of this file.
1/*
2 Copyright 2010 SINTEF ICT, Applied Mathematics.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef OPM_SPARSE_SYS_HEADER_INCLUDED
21#define OPM_SPARSE_SYS_HEADER_INCLUDED
22
28#include <stddef.h>
29#include <stdio.h>
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
39{
40 size_t m;
41 size_t nnz;
43 int *ia;
44 int *ja;
46 double *sa;
47};
48
49
65struct CSRMatrix *
67
68
88struct CSRMatrix *
90
91
114size_t
116
117
129size_t
130csrmatrix_elm_index(int i, int j, const struct CSRMatrix *A);
131
132
147void
149
150
161void
163
164
171void
173
174
181void
182vector_zero(size_t n, double *v);
183
184
198void
199csrmatrix_write(const struct CSRMatrix *A, const char *fn);
200
201
214void
215csrmatrix_write_stream(const struct CSRMatrix *A, FILE *fp);
216
217
230void
231vector_write(size_t n, const double *v, const char *fn);
232
233
245void
246vector_write_stream(size_t n, const double *v, FILE *fp);
247
248#ifdef __cplusplus
249}
250#endif
251
252#endif /* OPM_SPARSE_SYS_HEADER_INCLUDED */
void vector_write(size_t n, const double *v, const char *fn)
struct CSRMatrix * csrmatrix_new_count_nnz(size_t m)
void vector_write_stream(size_t n, const double *v, FILE *fp)
void csrmatrix_sortrows(struct CSRMatrix *A)
size_t csrmatrix_elm_index(int i, int j, const struct CSRMatrix *A)
void vector_zero(size_t n, double *v)
void csrmatrix_delete(struct CSRMatrix *A)
void csrmatrix_zero(struct CSRMatrix *A)
void csrmatrix_write(const struct CSRMatrix *A, const char *fn)
void csrmatrix_write_stream(const struct CSRMatrix *A, FILE *fp)
struct CSRMatrix * csrmatrix_new_known_nnz(size_t m, size_t nnz)
size_t csrmatrix_new_elms_pushback(struct CSRMatrix *A)
Definition: sparse_sys.h:39
size_t m
Definition: sparse_sys.h:40
size_t nnz
Definition: sparse_sys.h:41
double * sa
Definition: sparse_sys.h:46
int * ia
Definition: sparse_sys.h:43
int * ja
Definition: sparse_sys.h:44