LevelS C support library  3.50
trig_utils.h
Go to the documentation of this file.
1 /*
2  * This file is part of libc_utils.
3  *
4  * libc_utils is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * libc_utils is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with libc_utils; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 /*
20  * libc_utils is being developed at the Max-Planck-Institut fuer Astrophysik
21  * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
22  * (DLR).
23  */
24 
25 /*! \file trig_utils.h
26  *
27  * Copyright (C) 2016-2017 Max-Planck-Society
28  * \author Martin Reinecke
29  */
30 
31 #ifndef PLANCK_TRIGHELPER_H
32 #define PLANCK_TRIGHELPER_H
33 
34 #include <stdlib.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /*! Computes sin/cos(2*pi*m/n). Adapted from FFTW. */
41 void fracsincos(int m, int n, double *s, double *c);
42 
43 /*! Computes sine and cosine of \a i*alpha for \a i=[0;n[. Stores the sines
44  in \a s[i*stride] and the cosines in c[i*stride]. */
45 void sincos_multi (size_t n, double alpha, double *s, double *c, int stride);
46 
47 /*! Computes sine and cosine of \a i*2*pi*num/den for \a i=[0;n[.
48  Stores the sines in \a s[i*stride] and the cosines in c[i*stride]. */
49 void fracsincos_multi (size_t n, int num, int den, double *s, double *c,
50  int stride);
51 
52 /*! Computes sine and cosine of \a i*2pi/n for \a i=[0;nang[. Stores the sines
53  in \a s[i*stride] and the cosines in c[i*stride]. */
54 void sincos_2pibyn (size_t n, size_t nang, double *s, double *c, int stride);
55 
56 typedef struct triggen
57  {
58  size_t n, ilg, mask;
59  double *t1, *t2;
60  } triggen;
61 
62 void triggen_init (struct triggen *tg, size_t n);
63 void triggen_get (const struct triggen *tg,size_t i, double *s, double *c);
64 void triggen_destroy (struct triggen *tg);
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif
void sincos_2pibyn(size_t n, size_t nang, double *s, double *c, int stride)
Definition: trig_utils.c:185
void fracsincos(int m, int n, double *s, double *c)
Definition: trig_utils.c:40
void fracsincos_multi(size_t n, int num, int den, double *s, double *c, int stride)
Definition: trig_utils.c:131
void sincos_multi(size_t n, double alpha, double *s, double *c, int stride)
Definition: trig_utils.c:64

Generated on Mon Dec 10 2018 10:24:19 for LevelS C support library