vector_float.h

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.13 2008/09/18 13:54:32 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 void vec_copyf(float z[], const float x[], int n);
00037 
00038 void vec_copy(double z[], const double x[], int n);
00039 
00040 #if defined(HAVE_LONG_DOUBLE)
00041 void vec_copyl(long double z[], const long double x[], int n);
00042 #endif
00043 
00044 void vec_zerof(float z[], int n);
00045 
00046 void vec_zero(double z[], int n);
00047 
00048 #if defined(HAVE_LONG_DOUBLE)
00049 void vec_zerol(long double z[], int n);
00050 #endif
00051 
00052 void vec_setf(float z[], float x, int n);
00053 
00054 void vec_set(double z[], double x, int n);
00055 
00056 #if defined(HAVE_LONG_DOUBLE)
00057 void vec_setl(long double z[], long double x, int n);
00058 #endif
00059 
00060 void vec_addf(float z[], const float x[], const float y[], int n);
00061 
00062 void vec_add(double z[], const double x[], const double y[], int n);
00063 
00064 #if defined(HAVE_LONG_DOUBLE)
00065 void vec_addl(long double z[], const long double x[], const long double y[], int n);
00066 #endif
00067 
00068 void vec_scaled_addf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n);
00069 
00070 void vec_scaled_add(double z[], const double x[], double x_scale, const double y[], double y_scale, int n);
00071 
00072 #if defined(HAVE_LONG_DOUBLE)
00073 void vec_scaled_addl(long double z[], const long double x[], long double x_scale, const long double y[], long double y_scale, int n);
00074 #endif
00075 
00076 void vec_subf(float z[], const float x[], const float y[], int n);
00077 
00078 void vec_sub(double z[], const double x[], const double y[], int n);
00079 
00080 #if defined(HAVE_LONG_DOUBLE)
00081 void vec_subl(long double z[], const long double x[], const long double y[], int n);
00082 #endif
00083 
00084 void vec_scaled_subf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n);
00085 
00086 void vec_scaled_sub(double z[], const double x[], double x_scale, const double y[], double y_scale, int n);
00087 
00088 #if defined(HAVE_LONG_DOUBLE)
00089 void vec_scaled_subl(long double z[], const long double x[], long double x_scale, const long double y[], long double y_scale, int n);
00090 #endif
00091 
00092 void vec_scalar_mulf(float z[], const float x[], float y, int n);
00093 
00094 void vec_scalar_mul(double z[], const double x[], double y, int n);
00095 
00096 #if defined(HAVE_LONG_DOUBLE)
00097 void vec_scalar_mull(long double z[], const long double x[], long double y, int n);
00098 #endif
00099 
00100 void vec_mulf(float z[], const float x[], const float y[], int n);
00101 
00102 void vec_mul(double z[], const double x[], const double y[], int n);
00103 
00104 #if defined(HAVE_LONG_DOUBLE)
00105 void vec_mull(long double z[], const long double x[], const long double y[], int n);
00106 #endif
00107 
00108 /*! \brief Find the dot product of two float vectors.
00109     \param x The first vector.
00110     \param y The first vector.
00111     \param n The number of elements in the vectors.
00112     \return The dot product of the two vectors. */
00113 float vec_dot_prodf(const float x[], const float y[], int n);
00114 
00115 /*! \brief Find the dot product of two double vectors.
00116     \param x The first vector.
00117     \param y The first vector.
00118     \param n The number of elements in the vectors.
00119     \return The dot product of the two vectors. */
00120 double vec_dot_prod(const double x[], const double y[], int n);
00121 
00122 #if defined(HAVE_LONG_DOUBLE)
00123 /*! \brief Find the dot product of two long double vectors.
00124     \param x The first vector.
00125     \param y The first vector.
00126     \param n The number of elements in the vectors.
00127     \return The dot product of the two vectors. */
00128 long double vec_dot_prodl(const long double x[], const long double y[], int n);
00129 #endif
00130 
00131 /*! \brief Find the dot product of two float vectors, where the first is a circular buffer
00132            with an offset for the starting position.
00133     \param x The first vector.
00134     \param y The first vector.
00135     \param n The number of elements in the vectors.
00136     \param pos The starting position in the x vector.
00137     \return The dot product of the two vectors. */
00138 float vec_circular_dot_prodf(const float x[], const float y[], int n, int pos);
00139 
00140 void vec_lmsf(const float x[], float y[], int n, float error);
00141 
00142 void vec_circular_lmsf(const float x[], float y[], int n, int pos, float error);
00143 
00144 #if defined(__cplusplus)
00145 }
00146 #endif
00147 
00148 #endif
00149 /*- End of file ------------------------------------------------------------*/

Generated on Tue Oct 7 20:25:50 2008 for spandsp by  doxygen 1.5.6