NFFT  3.3.0
vector2.c
1 /*
2  * Copyright (c) 2002, 2015 Jens Keiner, Stefan Kunis, Daniel Potts
3  *
4  * This program is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU General Public License as published by the Free Software
6  * Foundation; either version 2 of the License, or (at your option) any later
7  * version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc., 51
16  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 /* $Id: util.c 3483 2010-04-23 19:02:34Z keiner $ */
20 
21 #include "infft.h"
22 
24 void Y(cp_complex)(C *x, C *y, INT n)
25 {
26  INT k;
27 
28  for (k = 0; k < n; k++)
29  x[k] = y[k];
30 }
31 
33 void Y(cp_double)(R *x, R *y, INT n)
34 {
35  INT k;
36 
37  for (k = 0; k < n; k++)
38  x[k] = y[k];
39 }
40 
42 void Y(cp_a_complex)(C *x, R a, C *y, INT n)
43 {
44  INT k;
45 
46  for (k = 0; k < n; k++)
47  x[k] = a * y[k];
48 }
49 
51 void Y(cp_a_double)(R *x, R a, R *y, INT n)
52 {
53  INT k;
54 
55  for (k = 0; k < n; k++)
56  x[k] = a * y[k];
57 }
58 
59 
61 void Y(cp_w_complex)(C *x, R *w, C *y, INT n)
62 {
63  INT k;
64 
65  for (k = 0; k < n; k++)
66  x[k] = w[k]*y[k];
67 }
68 
70 void Y(cp_w_double)(R *x, R *w, R *y, INT n)
71 {
72  INT k;
73 
74  for (k = 0; k < n; k++)
75  x[k] = w[k] * y[k];
76 }