mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
44 lines
1.7 KiB
C
44 lines
1.7 KiB
C
/*+
|
|
VIDE -- Void IDentification and Examination -- ./c_tools/hod/complex.h
|
|
Copyright (C) 2010-2014 Guilhem Lavaux
|
|
Copyright (C) 2011-2014 P. M. Sutter
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
+*/
|
|
/* CAUTION: This is the ANSI C (only) version of the Numerical Recipes
|
|
utility file complex.h. Do not confuse this file with the same-named
|
|
file complex.h that is supplied in the 'misc' subdirectory.
|
|
*That* file is the one from the book, and contains both ANSI and
|
|
traditional K&R versions, along with #ifdef macros to select the
|
|
correct version. *This* file contains only ANSI C. */
|
|
|
|
#ifndef _NR_COMPLEX_H_
|
|
#define _NR_COMPLEX_H_
|
|
|
|
#ifndef _FCOMPLEX_DECLARE_T_
|
|
typedef struct FCOMPLEX {float r,i;} fcomplex;
|
|
#define _FCOMPLEX_DECLARE_T_
|
|
#endif /* _FCOMPLEX_DECLARE_T_ */
|
|
|
|
fcomplex Cadd(fcomplex a, fcomplex b);
|
|
fcomplex Csub(fcomplex a, fcomplex b);
|
|
fcomplex Cmul(fcomplex a, fcomplex b);
|
|
fcomplex Complex(float re, float im);
|
|
fcomplex Conjg(fcomplex z);
|
|
fcomplex Cdiv(fcomplex a, fcomplex b);
|
|
float Cabs(fcomplex z);
|
|
fcomplex Csqrt(fcomplex z);
|
|
fcomplex RCmul(float x, fcomplex a);
|
|
|
|
#endif /* _NR_COMPLEX_H_ */
|