libspandsp 0.0.4
|
00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * complex_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: complex_vector_float.h,v 1.8 2008/04/17 14:27:00 steveu Exp $ 00026 */ 00027 00028 #if !defined(_SPANDSP_COMPLEX_VECTOR_FLOAT_H_) 00029 #define _SPANDSP_COMPLEX_VECTOR_FLOAT_H_ 00030 00031 #if defined(__cplusplus) 00032 extern "C" 00033 { 00034 #endif 00035 00036 static __inline__ void cvec_copyf(complexf_t z[], const complexf_t x[], int n) 00037 { 00038 int i; 00039 00040 for (i = 0; i < n; i++) 00041 z[i] = x[i]; 00042 } 00043 /*- End of function --------------------------------------------------------*/ 00044 00045 static __inline__ void cvec_copy(complex_t z[], const complex_t x[], int n) 00046 { 00047 int i; 00048 00049 for (i = 0; i < n; i++) 00050 z[i] = x[i]; 00051 } 00052 /*- End of function --------------------------------------------------------*/ 00053 00054 #if defined(HAVE_LONG_DOUBLE) 00055 static __inline__ void cvec_copyl(complexl_t z[], const complexl_t x[], int n) 00056 { 00057 int i; 00058 00059 for (i = 0; i < n; i++) 00060 z[i] = x[i]; 00061 } 00062 /*- End of function --------------------------------------------------------*/ 00063 #endif 00064 00065 static __inline__ void cvec_zerof(complexf_t z[], int n) 00066 { 00067 int i; 00068 00069 for (i = 0; i < n; i++) 00070 z[i] = complex_setf(0.0f, 0.0f); 00071 } 00072 /*- End of function --------------------------------------------------------*/ 00073 00074 static __inline__ void cvec_zero(complex_t z[], int n) 00075 { 00076 int i; 00077 00078 for (i = 0; i < n; i++) 00079 z[i] = complex_set(0.0, 0.0); 00080 } 00081 /*- End of function --------------------------------------------------------*/ 00082 00083 #if defined(HAVE_LONG_DOUBLE) 00084 static __inline__ void cvec_zerol(complexl_t z[], int n) 00085 { 00086 int i; 00087 00088 for (i = 0; i < n; i++) 00089 z[i] = complex_setl(0.0, 0.0); 00090 } 00091 /*- End of function --------------------------------------------------------*/ 00092 #endif 00093 00094 static __inline__ void cvec_setf(complexf_t z[], complexf_t *x, int n) 00095 { 00096 int i; 00097 00098 for (i = 0; i < n; i++) 00099 z[i] = *x; 00100 } 00101 /*- End of function --------------------------------------------------------*/ 00102 00103 static __inline__ void cvec_set(complex_t z[], complex_t *x, int n) 00104 { 00105 int i; 00106 00107 for (i = 0; i < n; i++) 00108 z[i] = *x; 00109 } 00110 /*- End of function --------------------------------------------------------*/ 00111 00112 #if defined(HAVE_LONG_DOUBLE) 00113 static __inline__ void cvec_setl(complexl_t z[], complexl_t *x, int n) 00114 { 00115 int i; 00116 00117 for (i = 0; i < n; i++) 00118 z[i] = *x; 00119 } 00120 /*- End of function --------------------------------------------------------*/ 00121 #endif 00122 00123 #if defined(__cplusplus) 00124 } 00125 #endif 00126 00127 #endif 00128 /*- End of file ------------------------------------------------------------*/