Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:03:57

0001 /* wavelet/gsl_wavelet.h
0002  * 
0003  * Copyright (C) 2004 Ivo Alxneit
0004  * 
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation; either version 3 of the License, or (at
0008  * your option) any later version.
0009  * 
0010  * This program is distributed in the hope that it will be useful, but
0011  * WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * General Public License for more details.
0014  * 
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program; if not, write to the Free Software
0017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef __GSL_WAVELET_H__
0021 #define __GSL_WAVELET_H__
0022 #include <stdlib.h>
0023 #include <gsl/gsl_types.h>
0024 #include <gsl/gsl_errno.h>
0025 
0026 #undef __BEGIN_DECLS
0027 #undef __END_DECLS
0028 #ifdef __cplusplus
0029 # define __BEGIN_DECLS extern "C" {
0030 # define __END_DECLS }
0031 #else
0032 # define __BEGIN_DECLS          /* empty */
0033 # define __END_DECLS            /* empty */
0034 #endif
0035 
0036 __BEGIN_DECLS
0037 
0038 typedef enum {
0039   gsl_wavelet_forward = 1, gsl_wavelet_backward = -1
0040 } 
0041 gsl_wavelet_direction;
0042 
0043 typedef struct
0044 {
0045   const char *name;
0046   int (*init) (const double **h1, const double **g1,
0047                const double **h2, const double **g2, size_t * nc,
0048                size_t * offset, size_t member);
0049 }
0050 gsl_wavelet_type;
0051 
0052 typedef struct
0053 {
0054   const gsl_wavelet_type *type;
0055   const double *h1;
0056   const double *g1;
0057   const double *h2;
0058   const double *g2;
0059   size_t nc;
0060   size_t offset;
0061 }
0062 gsl_wavelet;
0063 
0064 typedef struct
0065 {
0066   double *scratch;
0067   size_t n;
0068 }
0069 gsl_wavelet_workspace;
0070 
0071 GSL_VAR const gsl_wavelet_type *gsl_wavelet_daubechies;
0072 GSL_VAR const gsl_wavelet_type *gsl_wavelet_daubechies_centered;
0073 GSL_VAR const gsl_wavelet_type *gsl_wavelet_haar;
0074 GSL_VAR const gsl_wavelet_type *gsl_wavelet_haar_centered;
0075 GSL_VAR const gsl_wavelet_type *gsl_wavelet_bspline;
0076 GSL_VAR const gsl_wavelet_type *gsl_wavelet_bspline_centered;
0077 
0078 gsl_wavelet *gsl_wavelet_alloc (const gsl_wavelet_type * T, size_t k);
0079 void gsl_wavelet_free (gsl_wavelet * w);
0080 const char *gsl_wavelet_name (const gsl_wavelet * w);
0081 
0082 gsl_wavelet_workspace *gsl_wavelet_workspace_alloc (size_t n);
0083 void gsl_wavelet_workspace_free (gsl_wavelet_workspace * work);
0084 
0085 int gsl_wavelet_transform (const gsl_wavelet * w, 
0086                            double *data, size_t stride, size_t n,
0087                            gsl_wavelet_direction dir, 
0088                            gsl_wavelet_workspace * work);
0089 
0090 int gsl_wavelet_transform_forward (const gsl_wavelet * w, 
0091                                    double *data, size_t stride, size_t n, 
0092                                    gsl_wavelet_workspace * work);
0093 
0094 int gsl_wavelet_transform_inverse (const gsl_wavelet * w, 
0095                                     double *data, size_t stride, size_t n, 
0096                                     gsl_wavelet_workspace * work);
0097 
0098 __END_DECLS
0099 
0100 #endif /* __GSL_WAVELET_H__ */