Blame dht/gsl_dht.h

Packit 67cb25
/* dht/gsl_dht.h
Packit 67cb25
 * 
Packit 67cb25
 * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman
Packit 67cb25
 * 
Packit 67cb25
 * This program is free software; you can redistribute it and/or modify
Packit 67cb25
 * it under the terms of the GNU General Public License as published by
Packit 67cb25
 * the Free Software Foundation; either version 3 of the License, or (at
Packit 67cb25
 * your option) any later version.
Packit 67cb25
 * 
Packit 67cb25
 * This program is distributed in the hope that it will be useful, but
Packit 67cb25
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 67cb25
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 67cb25
 * General Public License for more details.
Packit 67cb25
 * 
Packit 67cb25
 * You should have received a copy of the GNU General Public License
Packit 67cb25
 * along with this program; if not, write to the Free Software
Packit 67cb25
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit 67cb25
 */
Packit 67cb25
Packit 67cb25
/* Author:  G. Jungman
Packit 67cb25
 */
Packit 67cb25
#ifndef __GSL_DHT_H__
Packit 67cb25
#define __GSL_DHT_H__
Packit 67cb25
Packit 67cb25
#undef __BEGIN_DECLS
Packit 67cb25
#undef __END_DECLS
Packit 67cb25
#ifdef __cplusplus
Packit 67cb25
# define __BEGIN_DECLS extern "C" {
Packit 67cb25
# define __END_DECLS }
Packit 67cb25
#else
Packit 67cb25
# define __BEGIN_DECLS /* empty */
Packit 67cb25
# define __END_DECLS /* empty */
Packit 67cb25
#endif
Packit 67cb25
Packit 67cb25
__BEGIN_DECLS
Packit 67cb25
Packit 67cb25
Packit 67cb25
struct gsl_dht_struct {
Packit 67cb25
  size_t    size;  /* size of the sample arrays to be transformed    */
Packit 67cb25
  double    nu;    /* Bessel function order                          */
Packit 67cb25
  double    xmax;  /* the upper limit to the x-sampling domain       */
Packit 67cb25
  double    kmax;  /* the upper limit to the k-sampling domain       */
Packit 67cb25
  double *  j;     /* array of computed J_nu zeros, j_{nu,s} = j[s]  */
Packit 67cb25
  double *  Jjj;   /* transform numerator, J_nu(j_i j_m / j_N)       */
Packit 67cb25
  double *  J2;    /* transform denominator, J_{nu+1}^2(j_m)         */
Packit 67cb25
};
Packit 67cb25
typedef struct gsl_dht_struct gsl_dht;
Packit 67cb25
Packit 67cb25
Packit 67cb25
/* Create a new transform object for a given size
Packit 67cb25
 * sampling array on the domain [0, xmax].
Packit 67cb25
 */
Packit 67cb25
gsl_dht * gsl_dht_alloc(size_t size);
Packit 67cb25
gsl_dht * gsl_dht_new(size_t size, double nu, double xmax);
Packit 67cb25
Packit 67cb25
/* Recalculate a transform object for given values of nu, xmax.
Packit 67cb25
 * You cannot change the size of the object since the internal
Packit 67cb25
 * allocation is reused.
Packit 67cb25
 */
Packit 67cb25
int gsl_dht_init(gsl_dht * t, double nu, double xmax);
Packit 67cb25
Packit 67cb25
/* The n'th computed x sample point for a given transform.
Packit 67cb25
 * 0 <= n <= size-1
Packit 67cb25
 */
Packit 67cb25
double gsl_dht_x_sample(const gsl_dht * t, int n);
Packit 67cb25
Packit 67cb25
Packit 67cb25
/* The n'th computed k sample point for a given transform.
Packit 67cb25
 * 0 <= n <= size-1
Packit 67cb25
 */
Packit 67cb25
double gsl_dht_k_sample(const gsl_dht * t, int n);
Packit 67cb25
Packit 67cb25
Packit 67cb25
/* Free a transform object.
Packit 67cb25
 */
Packit 67cb25
void gsl_dht_free(gsl_dht * t);
Packit 67cb25
Packit 67cb25
Packit 67cb25
/* Perform a transform on a sampled array.
Packit 67cb25
 * f_in[0] ... f_in[size-1] and similarly for f_out[]
Packit 67cb25
 */
Packit 67cb25
int gsl_dht_apply(const gsl_dht * t, double * f_in, double * f_out);
Packit 67cb25
Packit 67cb25
Packit 67cb25
__END_DECLS
Packit 67cb25
Packit 67cb25
#endif /* __GSL_DHT_H__ */