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 00026 #if !defined(_SPANDSP_VECTOR_FLOAT_H_) 00027 #define _SPANDSP_VECTOR_FLOAT_H_ 00028 00029 #if defined(__cplusplus) 00030 extern "C" 00031 { 00032 #endif 00033 00034 SPAN_DECLARE(void) vec_copyf(float z[], const float x[], int n); 00035 00036 SPAN_DECLARE(void) vec_copy(double z[], const double x[], int n); 00037 00038 #if defined(HAVE_LONG_DOUBLE) 00039 SPAN_DECLARE(void) vec_copyl(long double z[], const long double x[], int n); 00040 #endif 00041 00042 SPAN_DECLARE(void) vec_negatef(float z[], const float x[], int n); 00043 00044 SPAN_DECLARE(void) vec_negate(double z[], const double x[], int n); 00045 00046 #if defined(HAVE_LONG_DOUBLE) 00047 SPAN_DECLARE(void) vec_negatel(long double z[], const long double x[], int n); 00048 #endif 00049 00050 SPAN_DECLARE(void) vec_zerof(float z[], int n); 00051 00052 SPAN_DECLARE(void) vec_zero(double z[], int n); 00053 00054 #if defined(HAVE_LONG_DOUBLE) 00055 SPAN_DECLARE(void) vec_zerol(long double z[], int n); 00056 #endif 00057 00058 SPAN_DECLARE(void) vec_setf(float z[], float x, int n); 00059 00060 SPAN_DECLARE(void) vec_set(double z[], double x, int n); 00061 00062 #if defined(HAVE_LONG_DOUBLE) 00063 SPAN_DECLARE(void) vec_setl(long double z[], long double x, int n); 00064 #endif 00065 00066 SPAN_DECLARE(void) vec_addf(float z[], const float x[], const float y[], int n); 00067 00068 SPAN_DECLARE(void) vec_add(double z[], const double x[], const double y[], int n); 00069 00070 #if defined(HAVE_LONG_DOUBLE) 00071 SPAN_DECLARE(void) vec_addl(long double z[], const long double x[], const long double y[], int n); 00072 #endif 00073 00074 SPAN_DECLARE(void) vec_scaledxy_addf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n); 00075 00076 SPAN_DECLARE(void) vec_scaledxy_add(double z[], const double x[], double x_scale, const double y[], double y_scale, int n); 00077 00078 #if defined(HAVE_LONG_DOUBLE) 00079 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); 00080 #endif 00081 00082 SPAN_DECLARE(void) vec_scaledy_addf(float z[], const float x[], const float y[], float y_scale, int n); 00083 00084 SPAN_DECLARE(void) vec_scaledy_add(double z[], const double x[], const double y[], double y_scale, int n); 00085 00086 #if defined(HAVE_LONG_DOUBLE) 00087 SPAN_DECLARE(void) vec_scaledy_addl(long double z[], const long double x[], const long double y[], long double y_scale, int n); 00088 #endif 00089 00090 SPAN_DECLARE(void) vec_subf(float z[], const float x[], const float y[], int n); 00091 00092 SPAN_DECLARE(void) vec_sub(double z[], const double x[], const double y[], int n); 00093 00094 #if defined(HAVE_LONG_DOUBLE) 00095 SPAN_DECLARE(void) vec_subl(long double z[], const long double x[], const long double y[], int n); 00096 #endif 00097 00098 SPAN_DECLARE(void) vec_scaledxy_subf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n); 00099 00100 SPAN_DECLARE(void) vec_scaledxy_sub(double z[], const double x[], double x_scale, const double y[], double y_scale, int n); 00101 00102 #if defined(HAVE_LONG_DOUBLE) 00103 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); 00104 #endif 00105 00106 SPAN_DECLARE(void) vec_scaledx_subf(float z[], const float x[], float x_scale, const float y[], int n); 00107 00108 SPAN_DECLARE(void) vec_scaledx_sub(double z[], const double x[], double x_scale, const double y[], int n); 00109 00110 #if defined(HAVE_LONG_DOUBLE) 00111 SPAN_DECLARE(void) vec_scaledx_subl(long double z[], const long double x[], long double x_scale, const long double y[], int n); 00112 #endif 00113 00114 SPAN_DECLARE(void) vec_scaledy_subf(float z[], const float x[], const float y[], float y_scale, int n); 00115 00116 SPAN_DECLARE(void) vec_scaledy_sub(double z[], const double x[], const double y[], double y_scale, int n); 00117 00118 #if defined(HAVE_LONG_DOUBLE) 00119 SPAN_DECLARE(void) vec_scaledy_subl(long double z[], const long double x[], const long double y[], long double y_scale, int n); 00120 #endif 00121 00122 SPAN_DECLARE(void) vec_scalar_mulf(float z[], const float x[], float y, int n); 00123 00124 SPAN_DECLARE(void) vec_scalar_mul(double z[], const double x[], double y, int n); 00125 00126 #if defined(HAVE_LONG_DOUBLE) 00127 SPAN_DECLARE(void) vec_scalar_mull(long double z[], const long double x[], long double y, int n); 00128 #endif 00129 00130 SPAN_DECLARE(void) vec_scalar_addf(float z[], const float x[], float y, int n); 00131 00132 SPAN_DECLARE(void) vec_scalar_add(double z[], const double x[], double y, int n); 00133 00134 #if defined(HAVE_LONG_DOUBLE) 00135 SPAN_DECLARE(void) vec_scalar_addl(long double z[], const long double x[], long double y, int n); 00136 #endif 00137 00138 SPAN_DECLARE(void) vec_scalar_subf(float z[], const float x[], float y, int n); 00139 00140 SPAN_DECLARE(void) vec_scalar_sub(double z[], const double x[], double y, int n); 00141 00142 #if defined(HAVE_LONG_DOUBLE) 00143 SPAN_DECLARE(void) vec_scalar_subl(long double z[], const long double x[], long double y, int n); 00144 #endif 00145 00146 SPAN_DECLARE(void) vec_mulf(float z[], const float x[], const float y[], int n); 00147 00148 SPAN_DECLARE(void) vec_mul(double z[], const double x[], const double y[], int n); 00149 00150 #if defined(HAVE_LONG_DOUBLE) 00151 SPAN_DECLARE(void) vec_mull(long double z[], const long double x[], const long double y[], int n); 00152 #endif 00153 00154 /*! \brief Find the dot product of two float vectors. 00155 \param x The first vector. 00156 \param y The first vector. 00157 \param n The number of elements in the vectors. 00158 \return The dot product of the two vectors. */ 00159 SPAN_DECLARE(float) vec_dot_prodf(const float x[], const float y[], int n); 00160 00161 /*! \brief Find the dot product of two double vectors. 00162 \param x The first vector. 00163 \param y The first vector. 00164 \param n The number of elements in the vectors. 00165 \return The dot product of the two vectors. */ 00166 SPAN_DECLARE(double) vec_dot_prod(const double x[], const double y[], int n); 00167 00168 #if defined(HAVE_LONG_DOUBLE) 00169 /*! \brief Find the dot product of two long double vectors. 00170 \param x The first vector. 00171 \param y The first vector. 00172 \param n The number of elements in the vectors. 00173 \return The dot product of the two vectors. */ 00174 SPAN_DECLARE(long double) vec_dot_prodl(const long double x[], const long double y[], int n); 00175 #endif 00176 00177 /*! \brief Find the dot product of two float vectors, where the first is a circular buffer 00178 with an offset for the starting position. 00179 \param x The first vector. 00180 \param y The first vector. 00181 \param n The number of elements in the vectors. 00182 \param pos The starting position in the x vector. 00183 \return The dot product of the two vectors. */ 00184 SPAN_DECLARE(float) vec_circular_dot_prodf(const float x[], const float y[], int n, int pos); 00185 00186 SPAN_DECLARE(void) vec_lmsf(const float x[], float y[], int n, float error); 00187 00188 SPAN_DECLARE(void) vec_circular_lmsf(const float x[], float y[], int n, int pos, float error); 00189 00190 #if defined(__cplusplus) 00191 } 00192 #endif 00193 00194 #endif 00195 /*- End of file ------------------------------------------------------------*/