![]() |
|
|||
File indexing completed on 2025-02-21 10:03:47
0001 /* dht/gsl_dht.h 0002 * 0003 * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman 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 /* Author: G. Jungman 0021 */ 0022 #ifndef __GSL_DHT_H__ 0023 #define __GSL_DHT_H__ 0024 0025 #include <stdlib.h> 0026 0027 #undef __BEGIN_DECLS 0028 #undef __END_DECLS 0029 #ifdef __cplusplus 0030 # define __BEGIN_DECLS extern "C" { 0031 # define __END_DECLS } 0032 #else 0033 # define __BEGIN_DECLS /* empty */ 0034 # define __END_DECLS /* empty */ 0035 #endif 0036 0037 __BEGIN_DECLS 0038 0039 0040 struct gsl_dht_struct { 0041 size_t size; /* size of the sample arrays to be transformed */ 0042 double nu; /* Bessel function order */ 0043 double xmax; /* the upper limit to the x-sampling domain */ 0044 double kmax; /* the upper limit to the k-sampling domain */ 0045 double * j; /* array of computed J_nu zeros, j_{nu,s} = j[s] */ 0046 double * Jjj; /* transform numerator, J_nu(j_i j_m / j_N) */ 0047 double * J2; /* transform denominator, J_{nu+1}^2(j_m) */ 0048 }; 0049 typedef struct gsl_dht_struct gsl_dht; 0050 0051 0052 /* Create a new transform object for a given size 0053 * sampling array on the domain [0, xmax]. 0054 */ 0055 gsl_dht * gsl_dht_alloc(size_t size); 0056 gsl_dht * gsl_dht_new(size_t size, double nu, double xmax); 0057 0058 /* Recalculate a transform object for given values of nu, xmax. 0059 * You cannot change the size of the object since the internal 0060 * allocation is reused. 0061 */ 0062 int gsl_dht_init(gsl_dht * t, double nu, double xmax); 0063 0064 /* The n'th computed x sample point for a given transform. 0065 * 0 <= n <= size-1 0066 */ 0067 double gsl_dht_x_sample(const gsl_dht * t, int n); 0068 0069 0070 /* The n'th computed k sample point for a given transform. 0071 * 0 <= n <= size-1 0072 */ 0073 double gsl_dht_k_sample(const gsl_dht * t, int n); 0074 0075 0076 /* Free a transform object. 0077 */ 0078 void gsl_dht_free(gsl_dht * t); 0079 0080 0081 /* Perform a transform on a sampled array. 0082 * f_in[0] ... f_in[size-1] and similarly for f_out[] 0083 */ 0084 int gsl_dht_apply(const gsl_dht * t, double * f_in, double * f_out); 0085 0086 0087 __END_DECLS 0088 0089 #endif /* __GSL_DHT_H__ */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |