comparison spandsp-0.0.6pre17/src/spandsp/vector_float.h @ 4:26cd8f1ef0b1

import spandsp-0.0.6pre17
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Fri, 25 Jun 2010 15:50:58 +0200
parents
children
comparison
equal deleted inserted replaced
3:c6c5a16ce2f2 4:26cd8f1ef0b1
1 /*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * vector_float.h
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2003 Steve Underwood
9 *
10 * All rights reserved.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 2.1,
14 * as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 * $Id: vector_float.h,v 1.15 2009/01/31 08:48:11 steveu Exp $
26 */
27
28 #if !defined(_SPANDSP_VECTOR_FLOAT_H_)
29 #define _SPANDSP_VECTOR_FLOAT_H_
30
31 #if defined(__cplusplus)
32 extern "C"
33 {
34 #endif
35
36 SPAN_DECLARE(void) vec_copyf(float z[], const float x[], int n);
37
38 SPAN_DECLARE(void) vec_copy(double z[], const double x[], int n);
39
40 #if defined(HAVE_LONG_DOUBLE)
41 SPAN_DECLARE(void) vec_copyl(long double z[], const long double x[], int n);
42 #endif
43
44 SPAN_DECLARE(void) vec_negatef(float z[], const float x[], int n);
45
46 SPAN_DECLARE(void) vec_negate(double z[], const double x[], int n);
47
48 #if defined(HAVE_LONG_DOUBLE)
49 SPAN_DECLARE(void) vec_negatel(long double z[], const long double x[], int n);
50 #endif
51
52 SPAN_DECLARE(void) vec_zerof(float z[], int n);
53
54 SPAN_DECLARE(void) vec_zero(double z[], int n);
55
56 #if defined(HAVE_LONG_DOUBLE)
57 SPAN_DECLARE(void) vec_zerol(long double z[], int n);
58 #endif
59
60 SPAN_DECLARE(void) vec_setf(float z[], float x, int n);
61
62 SPAN_DECLARE(void) vec_set(double z[], double x, int n);
63
64 #if defined(HAVE_LONG_DOUBLE)
65 SPAN_DECLARE(void) vec_setl(long double z[], long double x, int n);
66 #endif
67
68 SPAN_DECLARE(void) vec_addf(float z[], const float x[], const float y[], int n);
69
70 SPAN_DECLARE(void) vec_add(double z[], const double x[], const double y[], int n);
71
72 #if defined(HAVE_LONG_DOUBLE)
73 SPAN_DECLARE(void) vec_addl(long double z[], const long double x[], const long double y[], int n);
74 #endif
75
76 SPAN_DECLARE(void) vec_scaledxy_addf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n);
77
78 SPAN_DECLARE(void) vec_scaledxy_add(double z[], const double x[], double x_scale, const double y[], double y_scale, int n);
79
80 #if defined(HAVE_LONG_DOUBLE)
81 SPAN_DECLARE(void) vec_scaledxy_addl(long double z[], const long double x[], long double x_scale, const long double y[], long double y_scale, int n);
82 #endif
83
84 SPAN_DECLARE(void) vec_scaledy_addf(float z[], const float x[], const float y[], float y_scale, int n);
85
86 SPAN_DECLARE(void) vec_scaledy_add(double z[], const double x[], const double y[], double y_scale, int n);
87
88 #if defined(HAVE_LONG_DOUBLE)
89 SPAN_DECLARE(void) vec_scaledy_addl(long double z[], const long double x[], const long double y[], long double y_scale, int n);
90 #endif
91
92 SPAN_DECLARE(void) vec_subf(float z[], const float x[], const float y[], int n);
93
94 SPAN_DECLARE(void) vec_sub(double z[], const double x[], const double y[], int n);
95
96 #if defined(HAVE_LONG_DOUBLE)
97 SPAN_DECLARE(void) vec_subl(long double z[], const long double x[], const long double y[], int n);
98 #endif
99
100 SPAN_DECLARE(void) vec_scaledxy_subf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n);
101
102 SPAN_DECLARE(void) vec_scaledxy_sub(double z[], const double x[], double x_scale, const double y[], double y_scale, int n);
103
104 #if defined(HAVE_LONG_DOUBLE)
105 SPAN_DECLARE(void) vec_scaledxy_subl(long double z[], const long double x[], long double x_scale, const long double y[], long double y_scale, int n);
106 #endif
107
108 SPAN_DECLARE(void) vec_scaledx_subf(float z[], const float x[], float x_scale, const float y[], int n);
109
110 SPAN_DECLARE(void) vec_scaledx_sub(double z[], const double x[], double x_scale, const double y[], int n);
111
112 #if defined(HAVE_LONG_DOUBLE)
113 SPAN_DECLARE(void) vec_scaledx_subl(long double z[], const long double x[], long double x_scale, const long double y[], int n);
114 #endif
115
116 SPAN_DECLARE(void) vec_scaledy_subf(float z[], const float x[], const float y[], float y_scale, int n);
117
118 SPAN_DECLARE(void) vec_scaledy_sub(double z[], const double x[], const double y[], double y_scale, int n);
119
120 #if defined(HAVE_LONG_DOUBLE)
121 SPAN_DECLARE(void) vec_scaledy_subl(long double z[], const long double x[], const long double y[], long double y_scale, int n);
122 #endif
123
124 SPAN_DECLARE(void) vec_scalar_mulf(float z[], const float x[], float y, int n);
125
126 SPAN_DECLARE(void) vec_scalar_mul(double z[], const double x[], double y, int n);
127
128 #if defined(HAVE_LONG_DOUBLE)
129 SPAN_DECLARE(void) vec_scalar_mull(long double z[], const long double x[], long double y, int n);
130 #endif
131
132 SPAN_DECLARE(void) vec_scalar_addf(float z[], const float x[], float y, int n);
133
134 SPAN_DECLARE(void) vec_scalar_add(double z[], const double x[], double y, int n);
135
136 #if defined(HAVE_LONG_DOUBLE)
137 SPAN_DECLARE(void) vec_scalar_addl(long double z[], const long double x[], long double y, int n);
138 #endif
139
140 SPAN_DECLARE(void) vec_scalar_subf(float z[], const float x[], float y, int n);
141
142 SPAN_DECLARE(void) vec_scalar_sub(double z[], const double x[], double y, int n);
143
144 #if defined(HAVE_LONG_DOUBLE)
145 SPAN_DECLARE(void) vec_scalar_subl(long double z[], const long double x[], long double y, int n);
146 #endif
147
148 SPAN_DECLARE(void) vec_mulf(float z[], const float x[], const float y[], int n);
149
150 SPAN_DECLARE(void) vec_mul(double z[], const double x[], const double y[], int n);
151
152 #if defined(HAVE_LONG_DOUBLE)
153 SPAN_DECLARE(void) vec_mull(long double z[], const long double x[], const long double y[], int n);
154 #endif
155
156 /*! \brief Find the dot product of two float vectors.
157 \param x The first vector.
158 \param y The first vector.
159 \param n The number of elements in the vectors.
160 \return The dot product of the two vectors. */
161 SPAN_DECLARE(float) vec_dot_prodf(const float x[], const float y[], int n);
162
163 /*! \brief Find the dot product of two double vectors.
164 \param x The first vector.
165 \param y The first vector.
166 \param n The number of elements in the vectors.
167 \return The dot product of the two vectors. */
168 SPAN_DECLARE(double) vec_dot_prod(const double x[], const double y[], int n);
169
170 #if defined(HAVE_LONG_DOUBLE)
171 /*! \brief Find the dot product of two long double vectors.
172 \param x The first vector.
173 \param y The first vector.
174 \param n The number of elements in the vectors.
175 \return The dot product of the two vectors. */
176 SPAN_DECLARE(long double) vec_dot_prodl(const long double x[], const long double y[], int n);
177 #endif
178
179 /*! \brief Find the dot product of two float vectors, where the first is a circular buffer
180 with an offset for the starting position.
181 \param x The first vector.
182 \param y The first vector.
183 \param n The number of elements in the vectors.
184 \param pos The starting position in the x vector.
185 \return The dot product of the two vectors. */
186 SPAN_DECLARE(float) vec_circular_dot_prodf(const float x[], const float y[], int n, int pos);
187
188 SPAN_DECLARE(void) vec_lmsf(const float x[], float y[], int n, float error);
189
190 SPAN_DECLARE(void) vec_circular_lmsf(const float x[], float y[], int n, int pos, float error);
191
192 #if defined(__cplusplus)
193 }
194 #endif
195
196 #endif
197 /*- End of file ------------------------------------------------------------*/

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.