spandsp 0.0.6
|
00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * vector_float.h 00005 * 00006 * Written by Steve Underwood <steveu@coppice.org> 00007 * 00008 * Copyright (C) 2003 Steve Underwood 00009 * 00010 * All rights reserved. 00011 * 00012 * This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License version 2.1, 00014 * as published by the Free Software Foundation. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00024 * 00025 * $Id: vector_float.h,v 1.15 2009/01/31 08:48:11 steveu Exp $ 00026 */ 00027 00028 #if !defined(_SPANDSP_VECTOR_FLOAT_H_) 00029 #define _SPANDSP_VECTOR_FLOAT_H_ 00030 00031 #if defined(__cplusplus) 00032 extern "C" 00033 { 00034 #endif 00035 00036 SPAN_DECLARE(void) vec_copyf(float z[], const float x[], int n); 00037 00038 SPAN_DECLARE(void) vec_copy(double z[], const double x[], int n); 00039 00040 #if defined(HAVE_LONG_DOUBLE) 00041 SPAN_DECLARE(void) vec_copyl(long double z[], const long double x[], int n); 00042 #endif 00043 00044 SPAN_DECLARE(void) vec_negatef(float z[], const float x[], int n); 00045 00046 SPAN_DECLARE(void) vec_negate(double z[], const double x[], int n); 00047 00048 #if defined(HAVE_LONG_DOUBLE) 00049 SPAN_DECLARE(void) vec_negatel(long double z[], const long double x[], int n); 00050 #endif 00051 00052 SPAN_DECLARE(void) vec_zerof(float z[], int n); 00053 00054 SPAN_DECLARE(void) vec_zero(double z[], int n); 00055 00056 #if defined(HAVE_LONG_DOUBLE) 00057 SPAN_DECLARE(void) vec_zerol(long double z[], int n); 00058 #endif 00059 00060 SPAN_DECLARE(void) vec_setf(float z[], float x, int n); 00061 00062 SPAN_DECLARE(void) vec_set(double z[], double x, int n); 00063 00064 #if defined(HAVE_LONG_DOUBLE) 00065 SPAN_DECLARE(void) vec_setl(long double z[], long double x, int n); 00066 #endif 00067 00068 SPAN_DECLARE(void) vec_addf(float z[], const float x[], const float y[], int n); 00069 00070 SPAN_DECLARE(void) vec_add(double z[], const double x[], const double y[], int n); 00071 00072 #if defined(HAVE_LONG_DOUBLE) 00073 SPAN_DECLARE(void) vec_addl(long double z[], const long double x[], const long double y[], int n); 00074 #endif 00075 00076 SPAN_DECLARE(void) vec_scaledxy_addf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n); 00077 00078 SPAN_DECLARE(void) vec_scaledxy_add(double z[], const double x[], double x_scale, const double y[], double y_scale, int n); 00079 00080 #if defined(HAVE_LONG_DOUBLE) 00081 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); 00082 #endif 00083 00084 SPAN_DECLARE(void) vec_scaledy_addf(float z[], const float x[], const float y[], float y_scale, int n); 00085 00086 SPAN_DECLARE(void) vec_scaledy_add(double z[], const double x[], const double y[], double y_scale, int n); 00087 00088 #if defined(HAVE_LONG_DOUBLE) 00089 SPAN_DECLARE(void) vec_scaledy_addl(long double z[], const long double x[], const long double y[], long double y_scale, int n); 00090 #endif 00091 00092 SPAN_DECLARE(void) vec_subf(float z[], const float x[], const float y[], int n); 00093 00094 SPAN_DECLARE(void) vec_sub(double z[], const double x[], const double y[], int n); 00095 00096 #if defined(HAVE_LONG_DOUBLE) 00097 SPAN_DECLARE(void) vec_subl(long double z[], const long double x[], const long double y[], int n); 00098 #endif 00099 00100 SPAN_DECLARE(void) vec_scaledxy_subf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n); 00101 00102 SPAN_DECLARE(void) vec_scaledxy_sub(double z[], const double x[], double x_scale, const double y[], double y_scale, int n); 00103 00104 #if defined(HAVE_LONG_DOUBLE) 00105 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); 00106 #endif 00107 00108 SPAN_DECLARE(void) vec_scaledx_subf(float z[], const float x[], float x_scale, const float y[], int n); 00109 00110 SPAN_DECLARE(void) vec_scaledx_sub(double z[], const double x[], double x_scale, const double y[], int n); 00111 00112 #if defined(HAVE_LONG_DOUBLE) 00113 SPAN_DECLARE(void) vec_scaledx_subl(long double z[], const long double x[], long double x_scale, const long double y[], int n); 00114 #endif 00115 00116 SPAN_DECLARE(void) vec_scaledy_subf(float z[], const float x[], const float y[], float y_scale, int n); 00117 00118 SPAN_DECLARE(void) vec_scaledy_sub(double z[], const double x[], const double y[], double y_scale, int n); 00119 00120 #if defined(HAVE_LONG_DOUBLE) 00121 SPAN_DECLARE(void) vec_scaledy_subl(long double z[], const long double x[], const long double y[], long double y_scale, int n); 00122 #endif 00123 00124 SPAN_DECLARE(void) vec_scalar_mulf(float z[], const float x[], float y, int n); 00125 00126 SPAN_DECLARE(void) vec_scalar_mul(double z[], const double x[], double y, int n); 00127 00128 #if defined(HAVE_LONG_DOUBLE) 00129 SPAN_DECLARE(void) vec_scalar_mull(long double z[], const long double x[], long double y, int n); 00130 #endif 00131 00132 SPAN_DECLARE(void) vec_scalar_addf(float z[], const float x[], float y, int n); 00133 00134 SPAN_DECLARE(void) vec_scalar_add(double z[], const double x[], double y, int n); 00135 00136 #if defined(HAVE_LONG_DOUBLE) 00137 SPAN_DECLARE(void) vec_scalar_addl(long double z[], const long double x[], long double y, int n); 00138 #endif 00139 00140 SPAN_DECLARE(void) vec_scalar_subf(float z[], const float x[], float y, int n); 00141 00142 SPAN_DECLARE(void) vec_scalar_sub(double z[], const double x[], double y, int n); 00143 00144 #if defined(HAVE_LONG_DOUBLE) 00145 SPAN_DECLARE(void) vec_scalar_subl(long double z[], const long double x[], long double y, int n); 00146 #endif 00147 00148 SPAN_DECLARE(void) vec_mulf(float z[], const float x[], const float y[], int n); 00149 00150 SPAN_DECLARE(void) vec_mul(double z[], const double x[], const double y[], int n); 00151 00152 #if defined(HAVE_LONG_DOUBLE) 00153 SPAN_DECLARE(void) vec_mull(long double z[], const long double x[], const long double y[], int n); 00154 #endif 00155 00156 /*! \brief Find the dot product of two float vectors. 00157 \param x The first vector. 00158 \param y The first vector. 00159 \param n The number of elements in the vectors. 00160 \return The dot product of the two vectors. */ 00161 SPAN_DECLARE(float) vec_dot_prodf(const float x[], const float y[], int n); 00162 00163 /*! \brief Find the dot product of two double vectors. 00164 \param x The first vector. 00165 \param y The first vector. 00166 \param n The number of elements in the vectors. 00167 \return The dot product of the two vectors. */ 00168 SPAN_DECLARE(double) vec_dot_prod(const double x[], const double y[], int n); 00169 00170 #if defined(HAVE_LONG_DOUBLE) 00171 /*! \brief Find the dot product of two long double vectors. 00172 \param x The first vector. 00173 \param y The first vector. 00174 \param n The number of elements in the vectors. 00175 \return The dot product of the two vectors. */ 00176 SPAN_DECLARE(long double) vec_dot_prodl(const long double x[], const long double y[], int n); 00177 #endif 00178 00179 /*! \brief Find the dot product of two float vectors, where the first is a circular buffer 00180 with an offset for the starting position. 00181 \param x The first vector. 00182 \param y The first vector. 00183 \param n The number of elements in the vectors. 00184 \param pos The starting position in the x vector. 00185 \return The dot product of the two vectors. */ 00186 SPAN_DECLARE(float) vec_circular_dot_prodf(const float x[], const float y[], int n, int pos); 00187 00188 SPAN_DECLARE(void) vec_lmsf(const float x[], float y[], int n, float error); 00189 00190 SPAN_DECLARE(void) vec_circular_lmsf(const float x[], float y[], int n, int pos, float error); 00191 00192 #if defined(__cplusplus) 00193 } 00194 #endif 00195 00196 #endif 00197 /*- End of file ------------------------------------------------------------*/