1 | /* block/gsl_block_double.h |
2 | * |
3 | * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, Brian Gough |
4 | * |
5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation; either version 3 of the License, or (at |
8 | * your option) any later version. |
9 | * |
10 | * This program is distributed in the hope that it will be useful, but |
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | * General Public License for more details. |
14 | * |
15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
18 | */ |
19 | |
20 | #ifndef __GSL_BLOCK_DOUBLE_H__ |
21 | #define __GSL_BLOCK_DOUBLE_H__ |
22 | |
23 | #include <stdlib.h> |
24 | #include <gsl/gsl_errno.h> |
25 | |
26 | #undef __BEGIN_DECLS |
27 | #undef __END_DECLS |
28 | #ifdef __cplusplus |
29 | # define __BEGIN_DECLS extern "C" { |
30 | # define __END_DECLS } |
31 | #else |
32 | # define __BEGIN_DECLS /* empty */ |
33 | # define __END_DECLS /* empty */ |
34 | #endif |
35 | |
36 | __BEGIN_DECLS |
37 | |
38 | struct gsl_block_struct |
39 | { |
40 | size_t size; |
41 | double *data; |
42 | }; |
43 | |
44 | typedef struct gsl_block_struct gsl_block; |
45 | |
46 | gsl_block *gsl_block_alloc (const size_t n); |
47 | gsl_block *gsl_block_calloc (const size_t n); |
48 | void gsl_block_free (gsl_block * b); |
49 | |
50 | int gsl_block_fread (FILE * stream, gsl_block * b); |
51 | int gsl_block_fwrite (FILE * stream, const gsl_block * b); |
52 | int gsl_block_fscanf (FILE * stream, gsl_block * b); |
53 | int gsl_block_fprintf (FILE * stream, const gsl_block * b, const char *format); |
54 | |
55 | int gsl_block_raw_fread (FILE * stream, double * b, const size_t n, const size_t stride); |
56 | int gsl_block_raw_fwrite (FILE * stream, const double * b, const size_t n, const size_t stride); |
57 | int gsl_block_raw_fscanf (FILE * stream, double * b, const size_t n, const size_t stride); |
58 | int gsl_block_raw_fprintf (FILE * stream, const double * b, const size_t n, const size_t stride, const char *format); |
59 | |
60 | size_t gsl_block_size (const gsl_block * b); |
61 | double * gsl_block_data (const gsl_block * b); |
62 | |
63 | __END_DECLS |
64 | |
65 | #endif /* __GSL_BLOCK_DOUBLE_H__ */ |
66 | |