gsl_block_double.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #ifndef __GSL_BLOCK_DOUBLE_H__
  20. #define __GSL_BLOCK_DOUBLE_H__
  21. #include <stdlib.h>
  22. #include "gsl_errno.h"
  23. #undef __BEGIN_DECLS
  24. #undef __END_DECLS
  25. #ifdef __cplusplus
  26. # define __BEGIN_DECLS extern "C" {
  27. # define __END_DECLS }
  28. #else
  29. # define __BEGIN_DECLS /* empty */
  30. # define __END_DECLS /* empty */
  31. #endif
  32. __BEGIN_DECLS
  33. struct gsl_block_struct
  34. {
  35. size_t size;
  36. double *data;
  37. };
  38. typedef struct gsl_block_struct gsl_block;
  39. gsl_block *gsl_block_alloc (const size_t n);
  40. gsl_block *gsl_block_calloc (const size_t n);
  41. void gsl_block_free (gsl_block * b);
  42. int gsl_block_fread (FILE * stream, gsl_block * b);
  43. int gsl_block_fwrite (FILE * stream, const gsl_block * b);
  44. int gsl_block_fscanf (FILE * stream, gsl_block * b);
  45. int gsl_block_fprintf (FILE * stream, const gsl_block * b, const char *format);
  46. int gsl_block_raw_fread (FILE * stream, double * b, const size_t n, const size_t stride);
  47. int gsl_block_raw_fwrite (FILE * stream, const double * b, const size_t n, const size_t stride);
  48. int gsl_block_raw_fscanf (FILE * stream, double * b, const size_t n, const size_t stride);
  49. int gsl_block_raw_fprintf (FILE * stream, const double * b, const size_t n, const size_t stride, const char *format);
  50. size_t gsl_block_size (const gsl_block * b);
  51. double * gsl_block_data (const gsl_block * b);
  52. __END_DECLS
  53. #endif /* __GSL_BLOCK_DOUBLE_H__ */