gsl_wavelet.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* wavelet/gsl_wavelet.h
  2. *
  3. * Copyright (C) 2004 Ivo Alxneit
  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_WAVELET_H__
  20. #define __GSL_WAVELET_H__
  21. #include <stdlib.h>
  22. #include "gsl_types.h"
  23. #include "gsl_errno.h"
  24. #undef __BEGIN_DECLS
  25. #undef __END_DECLS
  26. #ifdef __cplusplus
  27. # define __BEGIN_DECLS extern "C" {
  28. # define __END_DECLS }
  29. #else
  30. # define __BEGIN_DECLS /* empty */
  31. # define __END_DECLS /* empty */
  32. #endif
  33. __BEGIN_DECLS
  34. #ifndef GSL_DISABLE_DEPRECATED
  35. typedef enum {
  36. forward = 1, backward = -1,
  37. gsl_wavelet_forward = 1, gsl_wavelet_backward = -1
  38. }
  39. gsl_wavelet_direction;
  40. #else
  41. typedef enum {
  42. gsl_wavelet_forward = 1, gsl_wavelet_backward = -1
  43. }
  44. gsl_wavelet_direction;
  45. #endif
  46. typedef struct
  47. {
  48. const char *name;
  49. int (*init) (const double **h1, const double **g1,
  50. const double **h2, const double **g2, size_t * nc,
  51. size_t * offset, size_t member);
  52. }
  53. gsl_wavelet_type;
  54. typedef struct
  55. {
  56. const gsl_wavelet_type *type;
  57. const double *h1;
  58. const double *g1;
  59. const double *h2;
  60. const double *g2;
  61. size_t nc;
  62. size_t offset;
  63. }
  64. gsl_wavelet;
  65. typedef struct
  66. {
  67. double *scratch;
  68. size_t n;
  69. }
  70. gsl_wavelet_workspace;
  71. GSL_VAR const gsl_wavelet_type *gsl_wavelet_daubechies;
  72. GSL_VAR const gsl_wavelet_type *gsl_wavelet_daubechies_centered;
  73. GSL_VAR const gsl_wavelet_type *gsl_wavelet_haar;
  74. GSL_VAR const gsl_wavelet_type *gsl_wavelet_haar_centered;
  75. GSL_VAR const gsl_wavelet_type *gsl_wavelet_bspline;
  76. GSL_VAR const gsl_wavelet_type *gsl_wavelet_bspline_centered;
  77. gsl_wavelet *gsl_wavelet_alloc (const gsl_wavelet_type * T, size_t k);
  78. void gsl_wavelet_free (gsl_wavelet * w);
  79. const char *gsl_wavelet_name (const gsl_wavelet * w);
  80. gsl_wavelet_workspace *gsl_wavelet_workspace_alloc (size_t n);
  81. void gsl_wavelet_workspace_free (gsl_wavelet_workspace * work);
  82. int gsl_wavelet_transform (const gsl_wavelet * w,
  83. double *data, size_t stride, size_t n,
  84. gsl_wavelet_direction dir,
  85. gsl_wavelet_workspace * work);
  86. int gsl_wavelet_transform_forward (const gsl_wavelet * w,
  87. double *data, size_t stride, size_t n,
  88. gsl_wavelet_workspace * work);
  89. int gsl_wavelet_transform_inverse (const gsl_wavelet * w,
  90. double *data, size_t stride, size_t n,
  91. gsl_wavelet_workspace * work);
  92. __END_DECLS
  93. #endif /* __GSL_WAVELET_H__ */