From 879e2ac0a540fa1b199e20d47830aa5eea484a4c Mon Sep 17 00:00:00 2001 From: cornet Date: Wed, 22 Apr 2009 05:54:43 +0000 Subject: build with visual studio (dynamic libraries) --- src/auxiliaryFunctions/auxiliaryFunctions.vcproj | 1179 ++++++ src/auxiliaryFunctions/includes/abs.h | 24 +- src/auxiliaryFunctions/includes/conj.h | 19 +- .../includes/dynlib_auxiliaryfunctions.h | 26 + src/auxiliaryFunctions/includes/find.h | 18 +- src/auxiliaryFunctions/includes/find2d.h | 17 +- src/auxiliaryFunctions/includes/frexp.h | 13 +- src/auxiliaryFunctions/includes/isempty.h | 3 +- src/auxiliaryFunctions/includes/isnan.h | 28 +- src/auxiliaryFunctions/includes/length.h | 2 + src/auxiliaryFunctions/includes/pythag.h | 18 +- src/auxiliaryFunctions/includes/rand.h | 26 +- src/auxiliaryFunctions/includes/sign.h | 26 +- src/auxiliaryFunctions/isnan/cisnans.c | 10 +- src/auxiliaryFunctions/isnan/disnans.c | 5 + src/auxiliaryFunctions/isnan/sisnans.c | 5 + src/auxiliaryFunctions/isnan/zisnans.c | 5 + src/elementaryFunctions/acos/testAcos.h | 2 - .../acos/test_cplxacos/test_cplxacos.vcproj | 217 + .../acos/testrealsacos/testrealsacos.vcproj | 213 + src/elementaryFunctions/acosh/dacoshs.c | 7 + src/elementaryFunctions/acosh/sacoshs.c | 7 + src/elementaryFunctions/acosh/testAcosh.h | 1 - src/elementaryFunctions/acosh/testDoubleAcosh.c | 5 + .../acosh/test_doubleacosh/test_doubleacosh.vcproj | 212 + src/elementaryFunctions/elementaryFunctions.vcproj | 4457 ++++++++++++++++++++ src/elementaryFunctions/includes/acos.h | 17 +- src/elementaryFunctions/includes/acosh.h | 17 +- src/elementaryFunctions/includes/asin.h | 17 +- src/elementaryFunctions/includes/asinh.h | 17 +- src/elementaryFunctions/includes/atan.h | 17 +- src/elementaryFunctions/includes/atan2.h | 9 +- src/elementaryFunctions/includes/atanh.h | 17 +- src/elementaryFunctions/includes/ceil.h | 17 +- src/elementaryFunctions/includes/cos.h | 17 +- src/elementaryFunctions/includes/cosh.h | 17 +- .../includes/dynlib_elementaryfunctions.h | 26 + src/elementaryFunctions/includes/exp.h | 17 +- src/elementaryFunctions/includes/exp10.h | 17 +- src/elementaryFunctions/includes/fix.h | 17 +- src/elementaryFunctions/includes/floor.h | 17 +- src/elementaryFunctions/includes/int.h | 17 +- src/elementaryFunctions/includes/lnp1m1.h | 5 +- src/elementaryFunctions/includes/log.h | 17 +- src/elementaryFunctions/includes/log10.h | 17 +- src/elementaryFunctions/includes/log1p.h | 17 +- src/elementaryFunctions/includes/pow.h | 17 +- src/elementaryFunctions/includes/round.h | 17 +- src/elementaryFunctions/includes/sin.h | 17 +- src/elementaryFunctions/includes/sinh.h | 17 +- src/elementaryFunctions/includes/sqrt.h | 17 +- src/elementaryFunctions/includes/tan.h | 17 +- src/elementaryFunctions/includes/tanh.h | 17 +- src/elementaryFunctions/sqrt/csqrts.c | 215 +- src/elementaryFunctions/sqrt/zsqrts.c | 215 +- src/includes/lapack.h | 49 +- src/lib/blas/blas_f/blasplus_DLL.vfproj | 3 +- src/lib/lapack/lapack_f/lapack.def | 303 +- src/matrixOperations/chol/cchola.c | 11 +- src/matrixOperations/chol/dchola.c | 2 +- src/matrixOperations/chol/schola.c | 2 +- src/matrixOperations/determ/cdeterma.c | 8 +- src/matrixOperations/determ/ddeterma.c | 6 +- src/matrixOperations/determ/sdeterma.c | 6 +- src/matrixOperations/determ/zdeterma.c | 8 +- src/matrixOperations/dist/cdista.c | 10 +- src/matrixOperations/dist/ddista.c | 12 +- src/matrixOperations/dist/sdista.c | 12 +- src/matrixOperations/dist/zdista.c | 10 +- src/matrixOperations/division/cldivma.c | 2 + src/matrixOperations/division/crdivma.c | 2 +- src/matrixOperations/division/dldivma.c | 2 +- src/matrixOperations/division/drdivma.c | 2 +- src/matrixOperations/division/sldivma.c | 2 +- src/matrixOperations/division/srdivma.c | 2 +- src/matrixOperations/division/zldivma.c | 5 +- src/matrixOperations/division/zrdivma.c | 2 +- src/matrixOperations/hilbert/dhilba.c | 4 +- src/matrixOperations/hilbert/shilba.c | 4 +- src/matrixOperations/includes/cat.h | 42 +- src/matrixOperations/includes/chol.h | 20 +- src/matrixOperations/includes/determ.h | 18 +- src/matrixOperations/includes/dist.h | 24 +- .../includes/dynlib_matrixoperations.h | 26 + src/matrixOperations/includes/eye.h | 17 +- src/matrixOperations/includes/fill.h | 17 +- src/matrixOperations/includes/hilbert.h | 13 +- src/matrixOperations/includes/infiniteNorm.h | 17 +- src/matrixOperations/includes/jmat.h | 14 +- src/matrixOperations/includes/logm.h | 17 +- src/matrixOperations/includes/matrixDivision.h | 25 +- src/matrixOperations/includes/matrixExponential.h | 16 +- src/matrixOperations/includes/matrixInversion.h | 15 +- src/matrixOperations/includes/matrixMagnitude.h | 25 +- .../includes/matrixMultiplication.h | 17 +- src/matrixOperations/includes/matrixPow.h | 17 +- .../includes/matrixSquaredMagnitude.h | 25 +- src/matrixOperations/includes/matrixTrace.h | 16 +- src/matrixOperations/includes/matrixTranspose.h | 17 +- src/matrixOperations/includes/ones.h | 18 +- src/matrixOperations/includes/spec.h | 24 +- src/matrixOperations/includes/zeros.h | 17 +- src/matrixOperations/inversion/cinverma.c | 2 +- src/matrixOperations/inversion/dinverma.c | 2 +- src/matrixOperations/inversion/zinverma.c | 2 +- src/matrixOperations/logm/clogma.c | 4 +- src/matrixOperations/logm/dlogma.c | 4 +- src/matrixOperations/logm/slogma.c | 4 +- src/matrixOperations/logm/zlogma.c | 6 +- src/matrixOperations/matrixOperations.vcproj | 2483 +++++++++++ src/matrixOperations/multiplication/dmulma.c | 2 +- src/matrixOperations/multiplication/zmulma.c | 17 +- src/matrixOperations/powm/cpowma.c | 8 +- src/matrixOperations/powm/dpowma.c | 10 +- src/matrixOperations/powm/spowma.c | 10 +- src/matrixOperations/powm/zpowma.c | 8 +- src/matrixOperations/spec/cspeca.c | 6 +- src/matrixOperations/spec/dspeca.c | 10 +- src/matrixOperations/spec/sspeca.c | 6 +- src/matrixOperations/spec/zspeca.c | 17 +- src/matrixOperations/spec2/cspec2a.c | 8 +- src/matrixOperations/spec2/dspec2a.c | 12 +- src/matrixOperations/spec2/sspec2a.c | 8 +- src/matrixOperations/spec2/zspec2a.c | 14 +- src/operations/includes/addition.h | 25 +- src/operations/includes/division.h | 39 +- src/operations/includes/dynlib_operations.h | 26 + src/operations/includes/multiplication.h | 28 +- src/operations/includes/subtraction.h | 24 +- src/operations/operations.vcproj | 1087 +++++ src/type/doubleComplex.h | 10 +- src/type/floatComplex.h | 7 + 132 files changed, 11147 insertions(+), 1091 deletions(-) create mode 100644 src/auxiliaryFunctions/auxiliaryFunctions.vcproj create mode 100644 src/auxiliaryFunctions/includes/dynlib_auxiliaryfunctions.h create mode 100644 src/elementaryFunctions/acos/test_cplxacos/test_cplxacos.vcproj create mode 100644 src/elementaryFunctions/acos/testrealsacos/testrealsacos.vcproj create mode 100644 src/elementaryFunctions/acosh/test_doubleacosh/test_doubleacosh.vcproj create mode 100644 src/elementaryFunctions/elementaryFunctions.vcproj create mode 100644 src/elementaryFunctions/includes/dynlib_elementaryfunctions.h create mode 100644 src/matrixOperations/includes/dynlib_matrixoperations.h create mode 100644 src/matrixOperations/matrixOperations.vcproj create mode 100644 src/operations/includes/dynlib_operations.h create mode 100644 src/operations/operations.vcproj (limited to 'src') diff --git a/src/auxiliaryFunctions/auxiliaryFunctions.vcproj b/src/auxiliaryFunctions/auxiliaryFunctions.vcproj new file mode 100644 index 00000000..357096c1 --- /dev/null +++ b/src/auxiliaryFunctions/auxiliaryFunctions.vcproj @@ -0,0 +1,1179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/auxiliaryFunctions/includes/abs.h b/src/auxiliaryFunctions/includes/abs.h index bd75ba54..00565e39 100644 --- a/src/auxiliaryFunctions/includes/abs.h +++ b/src/auxiliaryFunctions/includes/abs.h @@ -13,10 +13,14 @@ #ifndef __ABS_H__ #define __ABS_H__ +#include "dynlib_auxiliaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" #include "sqrt.h" +#ifdef __cplusplus +extern "C" { +#endif /** ** \brief Float Absolute Value function @@ -24,7 +28,7 @@ ** \param in : the float we must determine abs. ** \return -in or in depending on the sign of in. **/ -float sabss(float in); +EXTERN_AUXFUNCT float sabss(float in); /** ** \brief Double Absolute Value function @@ -32,7 +36,7 @@ float sabss(float in); ** \param in : the double we must determine abs. ** \return -in or +in depending on the abs of in. **/ -double dabss(double in); +EXTERN_AUXFUNCT double dabss(double in); /** ** \brief Float Complex Absolute Value function @@ -40,7 +44,7 @@ double dabss(double in); ** \param in : the float complex we must determine abs i.e. module. ** \return |in|. **/ -float cabss(floatComplex in); +EXTERN_AUXFUNCT float cabss(floatComplex in); /** ** \brief Double Complex Absolute Value function @@ -48,7 +52,7 @@ float cabss(floatComplex in); ** \param in : the double complex we must determine abs i.e. module. ** \return |in|. **/ -double zabss(doubleComplex in); +EXTERN_AUXFUNCT double zabss(doubleComplex in); /** ** \brief Float Array Absolute Value function @@ -56,7 +60,7 @@ double zabss(doubleComplex in); ** \param in : the float array we must determine abs. ** \param out : the float array result. **/ -void sabsa(float *in, int size, float* out); +EXTERN_AUXFUNCT void sabsa(float *in, int size, float* out); /** ** \brief Double Array Absolute Value function @@ -64,7 +68,7 @@ void sabsa(float *in, int size, float* out); ** \param in : the double array we must determine abs. ** \param out : the double array result. **/ -void dabsa(double *in, int size, double* out); +EXTERN_AUXFUNCT void dabsa(double *in, int size, double* out); /** ** \brief Float Complex Array Absolute Value function @@ -72,7 +76,7 @@ void dabsa(double *in, int size, double* out); ** \param in : the float complex array we must determine abs i.e. module. ** \param out : the float complex array result i.e out[n] = |in[n]|. **/ -void cabsa(floatComplex *in, int size, float* out); +EXTERN_AUXFUNCT void cabsa(floatComplex *in, int size, float* out); /** ** \brief Double Complex Array Absolute Value function @@ -80,6 +84,10 @@ void cabsa(floatComplex *in, int size, float* out); ** \param in : the double complex array we must determine abs i.e. module. ** \param out : the double complex array result i.e out[n] = |in[n]|. **/ -void zabsa(doubleComplex *in, int size, double* out); +EXTERN_AUXFUNCT void zabsa(doubleComplex *in, int size, double* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__ABS_H__ */ diff --git a/src/auxiliaryFunctions/includes/conj.h b/src/auxiliaryFunctions/includes/conj.h index ee777578..b49855bf 100644 --- a/src/auxiliaryFunctions/includes/conj.h +++ b/src/auxiliaryFunctions/includes/conj.h @@ -13,14 +13,25 @@ #ifndef __CONJ_H__ #define __CONJ_H__ +#include "dynlib_auxiliaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" -floatComplex cconjs( floatComplex in ) ; +#ifdef __cplusplus +extern "C" { +#endif -void cconja ( floatComplex* in , int size, floatComplex* out ); +EXTERN_AUXFUNCT floatComplex cconjs( floatComplex in ) ; + +EXTERN_AUXFUNCT void cconja ( floatComplex* in , int size, floatComplex* out ); + +EXTERN_AUXFUNCT doubleComplex zconjs ( doubleComplex in) ; + +EXTERN_AUXFUNCT void zconja ( doubleComplex* in , int size, doubleComplex* out ) ; + +#ifdef __cplusplus +} /* extern "C" */ +#endif -doubleComplex zconjs ( doubleComplex in) ; -void zconja ( doubleComplex* in , int size, doubleComplex* out ) ; #endif /* !__CONJ_H__ */ diff --git a/src/auxiliaryFunctions/includes/dynlib_auxiliaryfunctions.h b/src/auxiliaryFunctions/includes/dynlib_auxiliaryfunctions.h new file mode 100644 index 00000000..b2002944 --- /dev/null +++ b/src/auxiliaryFunctions/includes/dynlib_auxiliaryfunctions.h @@ -0,0 +1,26 @@ +/* +* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +* Copyright (C) 2009 - DIGITEO - Allan CORNET +* +* This file must be used under the terms of the CeCILL. +* This source file is licensed as described in the file COPYING, which +* you should have received as part of this distribution. The terms +* are also available at +* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +* +*/ + +#ifndef __DYNLIB_AUXILIARYFUNCTIONS_H__ +#define __DYNLIB_AUXILIARYFUNCTIONS_H__ + +#ifdef _MSC_VER + #if AUXILIARYFUNCTIONS_EXPORTS + #define EXTERN_AUXFUNCT __declspec (dllexport) + #else + #define EXTERN_AUXFUNCT __declspec (dllimport) + #endif +#else + #define EXTERN_AUXFUNCT +#endif + +#endif /* __DYNLIB_AUXILIARYFUNCTIONS_H__ */ \ No newline at end of file diff --git a/src/auxiliaryFunctions/includes/find.h b/src/auxiliaryFunctions/includes/find.h index 8683d1a0..202219c8 100644 --- a/src/auxiliaryFunctions/includes/find.h +++ b/src/auxiliaryFunctions/includes/find.h @@ -13,26 +13,36 @@ #ifndef __FIND_H__ #define __FIND_H__ +#include "dynlib_auxiliaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" +#ifdef __cplusplus +extern "C" { +#endif /* ** \brief Float Find function */ -void sfinda(float* x, int size, float *out, int *sizeOut); +EXTERN_AUXFUNCT void sfinda(float* x, int size, float *out, int *sizeOut); /* ** \brief Double Find function */ -void dfinda(double*x, int size, double *out, int *sizeOut); +EXTERN_AUXFUNCT void dfinda(double*x, int size, double *out, int *sizeOut); /* ** \brief Float Complex Find function */ -void cfinda(floatComplex* z, int size, float *out, int *sizeOut); +EXTERN_AUXFUNCT void cfinda(floatComplex* z, int size, float *out, int *sizeOut); /* ** \brief Double Complex Find function */ -void zfinda(doubleComplex* z, int size, double *out, int *sizeOut); +EXTERN_AUXFUNCT void zfinda(doubleComplex* z, int size, double *out, int *sizeOut); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + #endif /* !__FIND_H__ */ diff --git a/src/auxiliaryFunctions/includes/find2d.h b/src/auxiliaryFunctions/includes/find2d.h index 264d49d2..72c036d5 100644 --- a/src/auxiliaryFunctions/includes/find2d.h +++ b/src/auxiliaryFunctions/includes/find2d.h @@ -13,27 +13,36 @@ #ifndef __FIND2D_H__ #define __FIND2D_H__ +#include "dynlib_auxiliaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" +#ifdef __cplusplus +extern "C" { +#endif /* ** \brief Float Find function */ -void sfind2da(float* x, int rows, int columns, float* out1, int* sizeOut1, float* out2, int* sizeOut2); +EXTERN_AUXFUNCT void sfind2da(float* x, int rows, int columns, float* out1, int* sizeOut1, float* out2, int* sizeOut2); /* ** \brief Double Find function */ -void dfind2da(double* x, int rows, int columns, double* out1, int* sizeOut1, double* out2, int* sizeOut2); +EXTERN_AUXFUNCT void dfind2da(double* x, int rows, int columns, double* out1, int* sizeOut1, double* out2, int* sizeOut2); /* ** \brief Float Complex Find function */ -void cfind2da(floatComplex* z, int rows, int columns, float* out1, int* sizeOut1, float* out2, int* sizeOut2); +EXTERN_AUXFUNCT void cfind2da(floatComplex* z, int rows, int columns, float* out1, int* sizeOut1, float* out2, int* sizeOut2); /* ** \brief Double Complex Find function */ -void zfind2da(doubleComplex* z, int rows, int columns, double* out1, int* sizeOut1, double* out2, int* sizeOut2); +EXTERN_AUXFUNCT void zfind2da(doubleComplex* z, int rows, int columns, double* out1, int* sizeOut1, double* out2, int* sizeOut2); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* !__FIND2D_H__ */ diff --git a/src/auxiliaryFunctions/includes/frexp.h b/src/auxiliaryFunctions/includes/frexp.h index 1c3e6410..cb4d8f32 100644 --- a/src/auxiliaryFunctions/includes/frexp.h +++ b/src/auxiliaryFunctions/includes/frexp.h @@ -14,10 +14,19 @@ #define __FREXP_H__ #include +#include "dynlib_auxiliaryfunctions.h" -float sfrexps(float _fltVal, float *_pfltExp); +#ifdef __cplusplus +extern "C" { +#endif -double dfrexps(double _dblVal, double *_pdblExp); +EXTERN_AUXFUNCT float sfrexps(float _fltVal, float *_pfltExp); + +EXTERN_AUXFUNCT double dfrexps(double _dblVal, double *_pdblExp); + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/src/auxiliaryFunctions/includes/isempty.h b/src/auxiliaryFunctions/includes/isempty.h index daa21fa7..4248200a 100644 --- a/src/auxiliaryFunctions/includes/isempty.h +++ b/src/auxiliaryFunctions/includes/isempty.h @@ -13,13 +13,14 @@ #ifndef __IS_EMPTY_H__ #define __IS_EMPTY_H__ -#include + #include "floatComplex.h" #include "doubleComplex.h" #include "notFound.h" #include "find.h" + /* ** \brief Float Is Empty function */ diff --git a/src/auxiliaryFunctions/includes/isnan.h b/src/auxiliaryFunctions/includes/isnan.h index 889328bd..e0975c23 100644 --- a/src/auxiliaryFunctions/includes/isnan.h +++ b/src/auxiliaryFunctions/includes/isnan.h @@ -13,51 +13,59 @@ #ifndef __IS_NAN_H__ #define __IS_NAN_H__ -#include #include - +#include "dynlib_auxiliaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" +#ifdef __cplusplus +extern "C" { +#endif + /* ** \brief Float Is Nan function */ -float sisnans(float x); +EXTERN_AUXFUNCT float sisnans(float x); /* ** \brief Double Is Nan function */ -double disnans(double x); +EXTERN_AUXFUNCT double disnans(double x); /* ** \brief Float Complex Is Nan function */ -float cisnans(floatComplex z); +EXTERN_AUXFUNCT float cisnans(floatComplex z); /* ** \brief Double Complex Is Nan function */ -double zisnans(doubleComplex z); +EXTERN_AUXFUNCT double zisnans(doubleComplex z); /* ** \brief Float Is Nan function */ -void sisnana(float* x, int size, float* out); +EXTERN_AUXFUNCT void sisnana(float* x, int size, float* out); /* ** \brief Double Is Nan function */ -void disnana(double* x, int size, double* out); +EXTERN_AUXFUNCT void disnana(double* x, int size, double* out); /* ** \brief Float Complex Is Nan function */ -void cisnana(floatComplex* z, int size, float* out); +EXTERN_AUXFUNCT void cisnana(floatComplex* z, int size, float* out); /* ** \brief Double Complex Is Nan function */ -void zisnana(doubleComplex* z, int size, double* out); +EXTERN_AUXFUNCT void zisnana(doubleComplex* z, int size, double* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* !__IS_NAN_H__ */ diff --git a/src/auxiliaryFunctions/includes/length.h b/src/auxiliaryFunctions/includes/length.h index 8402a05e..f8939f18 100644 --- a/src/auxiliaryFunctions/includes/length.h +++ b/src/auxiliaryFunctions/includes/length.h @@ -14,6 +14,8 @@ #ifndef __LENGTH_H__ #define __LENGTH_H__ +#include "dynlib_auxiliaryfunctions.h" + /** ** WARNING : ** We assume size of arrays are known, so we diff --git a/src/auxiliaryFunctions/includes/pythag.h b/src/auxiliaryFunctions/includes/pythag.h index a6e469eb..9535a354 100644 --- a/src/auxiliaryFunctions/includes/pythag.h +++ b/src/auxiliaryFunctions/includes/pythag.h @@ -13,28 +13,38 @@ #ifndef __PYTHAG_H__ #define __PYTHAG_H__ +#include "dynlib_auxiliaryfunctions.h" #include "multiplication.h" #include "addition.h" #include "sqrt.h" +#ifdef __cplusplus +extern "C" { +#endif + /* ** \brief Float Pythag function */ -float spythags(float x, float y); +EXTERN_AUXFUNCT float spythags(float x, float y); /* ** \brief Double Pythag function */ -double dpythags(double x, double y); +EXTERN_AUXFUNCT double dpythags(double x, double y); /* ** \brief Float Complex Pythag function */ -floatComplex cpythags(floatComplex x, floatComplex y); +EXTERN_AUXFUNCT floatComplex cpythags(floatComplex x, floatComplex y); /* ** \brief Double Complex Pythag function */ -doubleComplex zpythags(doubleComplex x, doubleComplex y); +EXTERN_AUXFUNCT doubleComplex zpythags(doubleComplex x, doubleComplex y); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* !__PYTHAG_H__ */ diff --git a/src/auxiliaryFunctions/includes/rand.h b/src/auxiliaryFunctions/includes/rand.h index 1c6fc727..4716cbba 100644 --- a/src/auxiliaryFunctions/includes/rand.h +++ b/src/auxiliaryFunctions/includes/rand.h @@ -14,57 +14,65 @@ #define __RAND_H__ #include - +#include "dynlib_auxiliaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" +#ifdef __cplusplus +extern "C" { +#endif + /** ** \brief Float Rand function ** \return A random float. **/ -float srands(void); +EXTERN_AUXFUNCT float srands(void); /** ** \brief Double Rand function ** \return A random double. **/ -double drands(void); +EXTERN_AUXFUNCT double drands(void); /** ** \brief Float Complex Rand function ** \return A random float complex. **/ -floatComplex crands(void); +EXTERN_AUXFUNCT floatComplex crands(void); /** ** \brief Double Complex Rand function ** \return A random double complex. **/ -doubleComplex zrands(void); +EXTERN_AUXFUNCT doubleComplex zrands(void); /** ** \brief Float Array Rand function ** \return A random float array. **/ -void sranda(float *out, int size); +EXTERN_AUXFUNCT void sranda(float *out, int size); /** ** \brief Double Array Rand function ** \return A random double array. **/ -void dranda(double *out, int size); +EXTERN_AUXFUNCT void dranda(double *out, int size); /** ** \brief Float Complex Array Rand function ** \return A random float complex array. **/ -void cranda(floatComplex *out, int size); +EXTERN_AUXFUNCT void cranda(floatComplex *out, int size); /** ** \brief Double Complex Array Rand function ** \return A random double complex array. **/ -void zranda(doubleComplex *out, int size); +EXTERN_AUXFUNCT void zranda(doubleComplex *out, int size); + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/src/auxiliaryFunctions/includes/sign.h b/src/auxiliaryFunctions/includes/sign.h index 46f9a765..0f69b4b7 100644 --- a/src/auxiliaryFunctions/includes/sign.h +++ b/src/auxiliaryFunctions/includes/sign.h @@ -15,16 +15,21 @@ #include +#include "dynlib_auxiliaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" +#ifdef __cplusplus +extern "C" { +#endif + /** ** \brief Float Signe function ** Determine the sign of in (assume that 0 is positive). ** \param in : the float we must determine sign. ** \return -1 or +1 depending on the sign of in. **/ -float ssigns(float in); +EXTERN_AUXFUNCT float ssigns(float in); /** ** \brief Double Signe function @@ -32,7 +37,7 @@ float ssigns(float in); ** \param in : the double we must determine sign. ** \return -1 or +1 depending on the sign of in. **/ -double dsigns(double in); +EXTERN_AUXFUNCT double dsigns(double in); /** ** \brief Float Complex Signe function @@ -40,7 +45,7 @@ double dsigns(double in); ** \param in : the float we must determine sign. ** \return -1 or +1 depending on the sign of in. **/ -floatComplex csigns(floatComplex in); +EXTERN_AUXFUNCT floatComplex csigns(floatComplex in); /** ** \brief Double Complex Signe function @@ -48,7 +53,7 @@ floatComplex csigns(floatComplex in); ** \param in : the double we must determine sign. ** \return -1 or +1 depending on the sign of in. **/ -doubleComplex zsigns(doubleComplex in); +EXTERN_AUXFUNCT doubleComplex zsigns(doubleComplex in); /** ** \brief Float Signe Array function @@ -57,7 +62,7 @@ doubleComplex zsigns(doubleComplex in); ** \param size : the number of elements. ** \return -1 or +1 depending on the sign of in elements. **/ -void ssigna(float *in, int size, float *out); +EXTERN_AUXFUNCT void ssigna(float *in, int size, float *out); /** ** \brief Double Signe Array function @@ -66,7 +71,7 @@ void ssigna(float *in, int size, float *out); ** \param size : the number of elements. ** \return -1 or +1 depending on the sign of in elements. **/ -void dsigna(double *in, int size, double *out); +EXTERN_AUXFUNCT void dsigna(double *in, int size, double *out); /** ** \brief Float Signe Complex Array function @@ -75,7 +80,7 @@ void dsigna(double *in, int size, double *out); ** \param size : the number of elements. ** \return -1 or +1 depending on the sign of in elements. **/ -void csigna(floatComplex *in, int size, floatComplex *out); +EXTERN_AUXFUNCT void csigna(floatComplex *in, int size, floatComplex *out); /** ** \brief Double Signe Complex Array function @@ -84,6 +89,11 @@ void csigna(floatComplex *in, int size, floatComplex *out); ** \param size : the number of elements. ** \return -1 or +1 depending on the sign of in elements. **/ -void zsigna(doubleComplex *in, int size, doubleComplex *out); +EXTERN_AUXFUNCT void zsigna(doubleComplex *in, int size, doubleComplex *out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* !__SIGN_H__ */ diff --git a/src/auxiliaryFunctions/isnan/cisnans.c b/src/auxiliaryFunctions/isnan/cisnans.c index 527ff21a..7fc0759f 100644 --- a/src/auxiliaryFunctions/isnan/cisnans.c +++ b/src/auxiliaryFunctions/isnan/cisnans.c @@ -10,7 +10,15 @@ * */ -#include "isnan.h" + + +#ifdef _MSC_VER +#include +#define isnan(x) _isnan((double)x) +#endif + +#include "isnan.h" + float cisnans(floatComplex in) { if ((int)(isnan(creals(in))) && (int)(isnan(cimags(in)))) return 1; diff --git a/src/auxiliaryFunctions/isnan/disnans.c b/src/auxiliaryFunctions/isnan/disnans.c index 981cbae4..0d0a5699 100644 --- a/src/auxiliaryFunctions/isnan/disnans.c +++ b/src/auxiliaryFunctions/isnan/disnans.c @@ -10,6 +10,11 @@ * */ +#ifdef _MSC_VER +#include +#define isnan(x) _isnan((double)x) +#endif + #include "isnan.h" double disnans(double in) { diff --git a/src/auxiliaryFunctions/isnan/sisnans.c b/src/auxiliaryFunctions/isnan/sisnans.c index cd646cd8..07d56538 100644 --- a/src/auxiliaryFunctions/isnan/sisnans.c +++ b/src/auxiliaryFunctions/isnan/sisnans.c @@ -10,6 +10,11 @@ * */ +#ifdef _MSC_VER +#include +#define isnan(x) _isnan((double)x) +#endif + #include "isnan.h" float sisnans(float in) { diff --git a/src/auxiliaryFunctions/isnan/zisnans.c b/src/auxiliaryFunctions/isnan/zisnans.c index a2b1a0a4..b7ebc1bb 100644 --- a/src/auxiliaryFunctions/isnan/zisnans.c +++ b/src/auxiliaryFunctions/isnan/zisnans.c @@ -10,6 +10,11 @@ * */ +#ifdef _MSC_VER +#include +#define isnan(x) _isnan((double)x) +#endif + #include "isnan.h" double zisnans(doubleComplex in) { diff --git a/src/elementaryFunctions/acos/testAcos.h b/src/elementaryFunctions/acos/testAcos.h index bb2d21ef..781c9cb9 100644 --- a/src/elementaryFunctions/acos/testAcos.h +++ b/src/elementaryFunctions/acos/testAcos.h @@ -16,8 +16,6 @@ #include #include #include "acos.h" -#include "constant.h" - void sacossTest(void); diff --git a/src/elementaryFunctions/acos/test_cplxacos/test_cplxacos.vcproj b/src/elementaryFunctions/acos/test_cplxacos/test_cplxacos.vcproj new file mode 100644 index 00000000..42277f3c --- /dev/null +++ b/src/elementaryFunctions/acos/test_cplxacos/test_cplxacos.vcproj @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/elementaryFunctions/acos/testrealsacos/testrealsacos.vcproj b/src/elementaryFunctions/acos/testrealsacos/testrealsacos.vcproj new file mode 100644 index 00000000..dfcd055b --- /dev/null +++ b/src/elementaryFunctions/acos/testrealsacos/testrealsacos.vcproj @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/elementaryFunctions/acosh/dacoshs.c b/src/elementaryFunctions/acosh/dacoshs.c index 978a0b59..a5c13c8b 100644 --- a/src/elementaryFunctions/acosh/dacoshs.c +++ b/src/elementaryFunctions/acosh/dacoshs.c @@ -13,6 +13,13 @@ #include #include "acosh.h" +#ifdef _MSC_VER +double acosh(double x) +{ + return log(x + sqrt(x * x - 1)); +} +#endif + double dacoshs(double x) { return (acosh(x)); } diff --git a/src/elementaryFunctions/acosh/sacoshs.c b/src/elementaryFunctions/acosh/sacoshs.c index a9ef9811..d2a9ae53 100644 --- a/src/elementaryFunctions/acosh/sacoshs.c +++ b/src/elementaryFunctions/acosh/sacoshs.c @@ -13,6 +13,13 @@ #include #include "acosh.h" +#ifdef _MSC_VER +float acoshf (float x) +{ + return (float) log(x + sqrt(x * x - 1)); +} +#endif + float sacoshs(float x) { return (acoshf(x)); } diff --git a/src/elementaryFunctions/acosh/testAcosh.h b/src/elementaryFunctions/acosh/testAcosh.h index 023aff6e..04f91707 100644 --- a/src/elementaryFunctions/acosh/testAcosh.h +++ b/src/elementaryFunctions/acosh/testAcosh.h @@ -16,7 +16,6 @@ #include #include #include "acosh.h" -#include "constant.h" void sacoshsTest(void); diff --git a/src/elementaryFunctions/acosh/testDoubleAcosh.c b/src/elementaryFunctions/acosh/testDoubleAcosh.c index 9ed77b3c..92cb9c66 100644 --- a/src/elementaryFunctions/acosh/testDoubleAcosh.c +++ b/src/elementaryFunctions/acosh/testDoubleAcosh.c @@ -14,6 +14,11 @@ #include "isnan.h" #include "testAcosh.h" +#ifdef _MSC_VER +#include +#define isnan(x) _isnan((double)x) +#endif + #define IN {38.746443623676896095276,39.8779044859111309052,99.6399083640426397324,\ 93.207842670381069183350,6.8147667217999696731567,71.874653641134500503540,\ diff --git a/src/elementaryFunctions/acosh/test_doubleacosh/test_doubleacosh.vcproj b/src/elementaryFunctions/acosh/test_doubleacosh/test_doubleacosh.vcproj new file mode 100644 index 00000000..247d8a79 --- /dev/null +++ b/src/elementaryFunctions/acosh/test_doubleacosh/test_doubleacosh.vcproj @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/elementaryFunctions/elementaryFunctions.vcproj b/src/elementaryFunctions/elementaryFunctions.vcproj new file mode 100644 index 00000000..4a710999 --- /dev/null +++ b/src/elementaryFunctions/elementaryFunctions.vcproj @@ -0,0 +1,4457 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/elementaryFunctions/includes/acos.h b/src/elementaryFunctions/includes/acos.h index 39787cd2..ab8baf0e 100644 --- a/src/elementaryFunctions/includes/acos.h +++ b/src/elementaryFunctions/includes/acos.h @@ -13,6 +13,7 @@ #ifndef __ACOS_H__ #define __ACOS_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float ArcCosine function ** \param in : input array value. */ -float sacoss(float in); +EXTERN_ELEMFUNCT float sacoss(float in); /* ** \brief Double ArcCosine function ** \param in : input array value. */ -double dacoss(double in); +EXTERN_ELEMFUNCT double dacoss(double in); /* ** \brief Float Complex ArcCosine function ** \param in : input array value. */ -floatComplex cacoss(floatComplex in); +EXTERN_ELEMFUNCT floatComplex cacoss(floatComplex in); /* ** \brief Double Complex ArcCosine function ** \param in : input array value. */ -doubleComplex zacoss(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zacoss(doubleComplex in); /* ** \brief Float Matrix ArcCosine function @@ -50,7 +51,7 @@ doubleComplex zacoss(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void sacosa(float* in, int size, float* out); +EXTERN_ELEMFUNCT void sacosa(float* in, int size, float* out); /* ** \brief Double Matrix ArcCosine function @@ -58,7 +59,7 @@ void sacosa(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dacosa(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dacosa(double* in, int size, double* out); /* ** \brief Float Complex Matrix ArcCosine function @@ -66,7 +67,7 @@ void dacosa(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void cacosa(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void cacosa(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix ArcCosine function @@ -74,6 +75,6 @@ void cacosa(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zacosa(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zacosa(doubleComplex* in, int size, doubleComplex* out); #endif /* !__ACOS_H__ */ diff --git a/src/elementaryFunctions/includes/acosh.h b/src/elementaryFunctions/includes/acosh.h index 2f089bd2..4492b35d 100644 --- a/src/elementaryFunctions/includes/acosh.h +++ b/src/elementaryFunctions/includes/acosh.h @@ -13,6 +13,7 @@ #ifndef __ACOSH_H__ #define __ACOSH_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Hyperbolic ArcCosine function ** \param in : input array value. */ -float sacoshs(float in); +EXTERN_ELEMFUNCT float sacoshs(float in); /* ** \brief Double Hyperbolic ArcCosine function ** \param in : input array value. */ -double dacoshs(double in); +EXTERN_ELEMFUNCT double dacoshs(double in); /* ** \brief Float Complex Hyperbolic ArcCosine function ** \param in : input array value. */ -floatComplex cacoshs(floatComplex in); +EXTERN_ELEMFUNCT floatComplex cacoshs(floatComplex in); /* ** \brief Double Complex Hyperbolic ArcCosine function ** \param in : input array value. */ -doubleComplex zacoshs(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zacoshs(doubleComplex in); /* ** \brief Float Matrix Hyperbolic ArcCosine function @@ -50,7 +51,7 @@ doubleComplex zacoshs(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void sacosha(float* in, int size, float* out); +EXTERN_ELEMFUNCT void sacosha(float* in, int size, float* out); /* ** \brief Double Matrix Hyperbolic ArcCosine function @@ -58,7 +59,7 @@ void sacosha(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dacosha(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dacosha(double* in, int size, double* out); /* ** \brief Float Complex Matrix Hyperbolic ArcCosine function @@ -66,7 +67,7 @@ void dacosha(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void cacosha(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void cacosha(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Hyperbolic ArcCosine function @@ -74,6 +75,6 @@ void cacosha(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zacosha(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zacosha(doubleComplex* in, int size, doubleComplex* out); #endif /* !__ACOSH_H__ */ diff --git a/src/elementaryFunctions/includes/asin.h b/src/elementaryFunctions/includes/asin.h index 1b0b9a74..ebaaf434 100644 --- a/src/elementaryFunctions/includes/asin.h +++ b/src/elementaryFunctions/includes/asin.h @@ -13,6 +13,7 @@ #ifndef __ASIN_H__ #define __ASIN_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float ArcSine function ** \param in : input value. */ -float sasins(float in); +EXTERN_ELEMFUNCT float sasins(float in); /* ** \brief Double ArcSine function ** \param in : input value. */ -double dasins(double in); +EXTERN_ELEMFUNCT double dasins(double in); /* ** \brief Float Complex ArcSine function ** \param in : input value. */ -floatComplex casins(floatComplex in); +EXTERN_ELEMFUNCT floatComplex casins(floatComplex in); /* ** \brief Double Complex ArcSine function ** \param in : input value. */ -doubleComplex zasins(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zasins(doubleComplex in); /* ** \brief Float Matrix ArcSine function @@ -50,7 +51,7 @@ doubleComplex zasins(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void sasina(float* in, int size, float* out); +EXTERN_ELEMFUNCT void sasina(float* in, int size, float* out); /* ** \brief Double Matrix ArcSine function @@ -58,7 +59,7 @@ void sasina(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dasina(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dasina(double* in, int size, double* out); /* ** \brief Float Complex Matrix ArcSine function @@ -66,7 +67,7 @@ void dasina(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void casina(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void casina(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix ArcSine function @@ -74,6 +75,6 @@ void casina(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zasina(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zasina(doubleComplex* in, int size, doubleComplex* out); #endif /* !__ASIN_H__ */ diff --git a/src/elementaryFunctions/includes/asinh.h b/src/elementaryFunctions/includes/asinh.h index f7cd2b5b..7f4ec287 100644 --- a/src/elementaryFunctions/includes/asinh.h +++ b/src/elementaryFunctions/includes/asinh.h @@ -13,6 +13,7 @@ #ifndef __ASINH_H__ #define __ASINH_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Hyperbolic ArcSine function ** \param in : input value. */ -float sasinhs(float in); +EXTERN_ELEMFUNCT float sasinhs(float in); /* ** \brief Double Hyperbolic ArcSine function ** \param in : input value. */ -double dasinhs(double in); +EXTERN_ELEMFUNCT double dasinhs(double in); /* ** \brief Float Complex Hyperbolic ArcSine function ** \param in : input value. */ -floatComplex casinhs(floatComplex in); +EXTERN_ELEMFUNCT floatComplex casinhs(floatComplex in); /* ** \brief Double Complex Hyperbolic ArcSine function ** \param in : input value. */ -doubleComplex zasinhs(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zasinhs(doubleComplex in); /* ** \brief Float Matrix Hyperbolic ArcSine function @@ -50,7 +51,7 @@ doubleComplex zasinhs(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void sasinha(float* in, int size, float* out); +EXTERN_ELEMFUNCT void sasinha(float* in, int size, float* out); /* ** \brief Double Matrix Hyperbolic ArcSine function @@ -58,7 +59,7 @@ void sasinha(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dasinha(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dasinha(double* in, int size, double* out); /* ** \brief Float Complex Matrix Hyperbolic ArcSine function @@ -66,7 +67,7 @@ void dasinha(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void casinha(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void casinha(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Hyperbolic ArcSine function @@ -74,6 +75,6 @@ void casinha(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zasinha(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zasinha(doubleComplex* in, int size, doubleComplex* out); #endif /* !__ASINH_H__ */ diff --git a/src/elementaryFunctions/includes/atan.h b/src/elementaryFunctions/includes/atan.h index 05b853bb..34992119 100644 --- a/src/elementaryFunctions/includes/atan.h +++ b/src/elementaryFunctions/includes/atan.h @@ -13,6 +13,7 @@ #ifndef __ATAN_H__ #define __ATAN_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float ArcTangeant function ** \param in : input value. */ -float satans(float in); +EXTERN_ELEMFUNCT float satans(float in); /* ** \brief Double ArcTangeant function ** \param in : input value. */ -double datans(double in); +EXTERN_ELEMFUNCT double datans(double in); /* ** \brief Float Complex ArcTangeant function ** \param in : input value. */ -floatComplex catans(floatComplex in); +EXTERN_ELEMFUNCT floatComplex catans(floatComplex in); /* ** \brief Double Complex ArcTangeant function ** \param in : input value. */ -doubleComplex zatans(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zatans(doubleComplex in); /* ** \brief Float Matrix ArcTangeant function @@ -50,7 +51,7 @@ doubleComplex zatans(doubleComplex in); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void satana(float* in, int size, float* out); +EXTERN_ELEMFUNCT void satana(float* in, int size, float* out); /* ** \brief Double Matrix ArcTangeant function @@ -58,7 +59,7 @@ void satana(float* in, int size, float* out); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void datana(double* in, int size, double* out); +EXTERN_ELEMFUNCT void datana(double* in, int size, double* out); /* ** \brief Float Complex Matrix ArcTangeant function @@ -66,7 +67,7 @@ void datana(double* in, int size, double* out); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void catana(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void catana(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix ArcTangeant function @@ -74,6 +75,6 @@ void catana(floatComplex* in, int size, floatComplex* out); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void zatana(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zatana(doubleComplex* in, int size, doubleComplex* out); #endif /* !__ATAN_H__ */ diff --git a/src/elementaryFunctions/includes/atan2.h b/src/elementaryFunctions/includes/atan2.h index e746a915..2915fb2c 100644 --- a/src/elementaryFunctions/includes/atan2.h +++ b/src/elementaryFunctions/includes/atan2.h @@ -13,6 +13,7 @@ #ifndef __ATAN2_H__ #define __ATAN2_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" #include @@ -24,23 +25,23 @@ /* ** \brief Float arc tangent function */ -float satan2s ( float x , float y ); +EXTERN_ELEMFUNCT float satan2s ( float x , float y ); /* ** \brief Double arc tangent function */ -double datan2s ( double x , double y); +EXTERN_ELEMFUNCT double datan2s ( double x , double y); /* ** \brief array's Float arc tangent function */ -void satan2a (float* in1, int size1, float* in2, int size2, float* out) ; +EXTERN_ELEMFUNCT void satan2a (float* in1, int size1, float* in2, int size2, float* out) ; /* ** \brief array's Double arc tangent function */ -void datan2a (double* in1, int size1, double* in2, int size2, double* out) ; +EXTERN_ELEMFUNCT void datan2a (double* in1, int size1, double* in2, int size2, double* out) ; diff --git a/src/elementaryFunctions/includes/atanh.h b/src/elementaryFunctions/includes/atanh.h index 9669fbe9..12a4c487 100644 --- a/src/elementaryFunctions/includes/atanh.h +++ b/src/elementaryFunctions/includes/atanh.h @@ -13,6 +13,7 @@ #ifndef __ATANH_H__ #define __ATANH_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Hyperbolic ArcTangeant function ** \param in : input value. */ -float satanhs(float in); +EXTERN_ELEMFUNCT float satanhs(float in); /* ** \brief Double Hyperbolic ArcTangeant function ** \param in : input value. */ -double datanhs(double in); +EXTERN_ELEMFUNCT double datanhs(double in); /* ** \brief Float Complex Hyperbolic ArcTangeant function ** \param in : input value. */ -floatComplex catanhs(floatComplex in); +EXTERN_ELEMFUNCT floatComplex catanhs(floatComplex in); /* ** \brief Double Complex Hyperbolic ArcTangeant function ** \param in : input value. */ -doubleComplex zatanhs(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zatanhs(doubleComplex in); /* ** \brief Float Matrix Hyperbolic ArcTangeant function @@ -50,7 +51,7 @@ doubleComplex zatanhs(doubleComplex in); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void satanha(float* in, int size, float* out); +EXTERN_ELEMFUNCT void satanha(float* in, int size, float* out); /* ** \brief Double Matrix Hyperbolic ArcTangeant function @@ -58,7 +59,7 @@ void satanha(float* in, int size, float* out); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void datanha(double* in, int size, double* out); +EXTERN_ELEMFUNCT void datanha(double* in, int size, double* out); /* ** \brief Float Complex Matrix Hyperbolic ArcTangeant function @@ -66,7 +67,7 @@ void datanha(double* in, int size, double* out); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void catanha(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void catanha(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Hyperbolic ArcTangeant function @@ -74,7 +75,7 @@ void catanha(floatComplex* in, int size, floatComplex* out); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void zatanha(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zatanha(doubleComplex* in, int size, doubleComplex* out); #endif /* !__ATANH_H__ */ diff --git a/src/elementaryFunctions/includes/ceil.h b/src/elementaryFunctions/includes/ceil.h index 4e64f26e..1a0fb5c9 100644 --- a/src/elementaryFunctions/includes/ceil.h +++ b/src/elementaryFunctions/includes/ceil.h @@ -13,6 +13,7 @@ #ifndef __CEIL_H__ #define __CEIL_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -20,21 +21,21 @@ ceil(x) returns an integer matrix made of rounded up elements */ -float sceils(float in); +EXTERN_ELEMFUNCT float sceils(float in); -double dceils(double in); +EXTERN_ELEMFUNCT double dceils(double in); -floatComplex cceils(floatComplex in); +EXTERN_ELEMFUNCT floatComplex cceils(floatComplex in); -doubleComplex zceils(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zceils(doubleComplex in); -void sceila(float* in, int size, float* out); +EXTERN_ELEMFUNCT void sceila(float* in, int size, float* out); -void dceila(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dceila(double* in, int size, double* out); -void cceila(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void cceila(floatComplex* in, int size, floatComplex* out); -void zceila(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zceila(doubleComplex* in, int size, doubleComplex* out); #endif /* !__CEIL_H__ */ diff --git a/src/elementaryFunctions/includes/cos.h b/src/elementaryFunctions/includes/cos.h index 546ca5c8..65f85e33 100644 --- a/src/elementaryFunctions/includes/cos.h +++ b/src/elementaryFunctions/includes/cos.h @@ -13,6 +13,7 @@ #ifndef __COS_H__ #define __COS_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Cosine function ** \param in : input value. */ -float scoss(float in); +EXTERN_ELEMFUNCT float scoss(float in); /* ** \brief Double Cosine function ** \param in : input value. */ -double dcoss(double in); +EXTERN_ELEMFUNCT double dcoss(double in); /* ** \brief Float Complex Cosine function ** \param in : input value. */ -floatComplex ccoss(floatComplex in); +EXTERN_ELEMFUNCT floatComplex ccoss(floatComplex in); /* ** \brief Double Complex Cosine function ** \param in : input value. */ -doubleComplex zcoss(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zcoss(doubleComplex in); /* ** \brief Float Matrix Cosine function @@ -50,7 +51,7 @@ doubleComplex zcoss(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void scosa(float* in, int size, float* out); +EXTERN_ELEMFUNCT void scosa(float* in, int size, float* out); /* ** \brief Double Matrix Cosine function @@ -58,7 +59,7 @@ void scosa(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dcosa(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dcosa(double* in, int size, double* out); /* ** \brief Float Complex Matrix Cosine function @@ -66,7 +67,7 @@ void dcosa(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void ccosa(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void ccosa(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Cosine function @@ -74,6 +75,6 @@ void ccosa(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zcosa(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zcosa(doubleComplex* in, int size, doubleComplex* out); #endif /* !__COS_H__ */ diff --git a/src/elementaryFunctions/includes/cosh.h b/src/elementaryFunctions/includes/cosh.h index 1f46136c..97d6d5e0 100644 --- a/src/elementaryFunctions/includes/cosh.h +++ b/src/elementaryFunctions/includes/cosh.h @@ -13,6 +13,7 @@ #ifndef __COSH_H__ #define __COSH_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Cosine function ** \param in : input value. */ -float scoshs(float in); +EXTERN_ELEMFUNCT float scoshs(float in); /* ** \brief Double Cosine function ** \param in : input value. */ -double dcoshs(double in); +EXTERN_ELEMFUNCT double dcoshs(double in); /* ** \brief Float Complex Cosine function ** \param in : input value. */ -floatComplex ccoshs(floatComplex in); +EXTERN_ELEMFUNCT floatComplex ccoshs(floatComplex in); /* ** \brief Double Complex Cosine function ** \param in : input value. */ -doubleComplex zcoshs(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zcoshs(doubleComplex in); /* ** \brief Float Matrix Cosine function @@ -50,7 +51,7 @@ doubleComplex zcoshs(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void scosha(float* in, int size, float* out); +EXTERN_ELEMFUNCT void scosha(float* in, int size, float* out); /* ** \brief Double Matrix Cosine function @@ -58,7 +59,7 @@ void scosha(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dcosha(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dcosha(double* in, int size, double* out); /* ** \brief Float Complex Matrix Cosine function @@ -66,7 +67,7 @@ void dcosha(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void ccosha(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void ccosha(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Cosine function @@ -74,7 +75,7 @@ void ccosha(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zcosha(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zcosha(doubleComplex* in, int size, doubleComplex* out); #endif /* !__COSH_H__ */ diff --git a/src/elementaryFunctions/includes/dynlib_elementaryfunctions.h b/src/elementaryFunctions/includes/dynlib_elementaryfunctions.h new file mode 100644 index 00000000..d91da87e --- /dev/null +++ b/src/elementaryFunctions/includes/dynlib_elementaryfunctions.h @@ -0,0 +1,26 @@ +/* +* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +* Copyright (C) 2009 - DIGITEO - Allan CORNET +* +* This file must be used under the terms of the CeCILL. +* This source file is licensed as described in the file COPYING, which +* you should have received as part of this distribution. The terms +* are also available at +* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +* +*/ + +#ifndef __DYNLIB_ELEMENTARYFUNCTIONS_H__ +#define __DYNLIB_ELEMENTARYFUNCTIONS_H__ + +#ifdef _MSC_VER + #if ELEMENTARYFUNCTIONS_EXPORTS + #define EXTERN_ELEMFUNCT __declspec (dllexport) + #else + #define EXTERN_ELEMFUNCT __declspec (dllimport) + #endif +#else + #define EXTERN_ELEMFUNCT +#endif + +#endif /* __DYNLIB_ELEMENTARYFUNCTIONS_H__ */ \ No newline at end of file diff --git a/src/elementaryFunctions/includes/exp.h b/src/elementaryFunctions/includes/exp.h index f515d06e..25b13141 100644 --- a/src/elementaryFunctions/includes/exp.h +++ b/src/elementaryFunctions/includes/exp.h @@ -13,6 +13,7 @@ #ifndef __EXP_H__ #define __EXP_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Exponential function ** \param in : input value. */ -float sexps(float in); +EXTERN_ELEMFUNCT float sexps(float in); /* ** \brief Double Exponential function ** \param in : input value. */ -double dexps(double in); +EXTERN_ELEMFUNCT double dexps(double in); /* ** \brief Float Complex Exponential function ** \param in : input value. */ -floatComplex cexps(floatComplex in); +EXTERN_ELEMFUNCT floatComplex cexps(floatComplex in); /* ** \brief Double Complex Exponential function ** \param in : input value. */ -doubleComplex zexps(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zexps(doubleComplex in); /* ** \brief Float Matrix Exponential function @@ -50,7 +51,7 @@ doubleComplex zexps(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void sexpa(float* in, int size, float* out); +EXTERN_ELEMFUNCT void sexpa(float* in, int size, float* out); /* ** \brief Double Matrix Exponential function @@ -58,7 +59,7 @@ void sexpa(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dexpa(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dexpa(double* in, int size, double* out); /* ** \brief Float Complex Matrix Exponential function @@ -66,7 +67,7 @@ void dexpa(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void cexpa(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void cexpa(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Exponential function @@ -74,7 +75,7 @@ void cexpa(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zexpa(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zexpa(doubleComplex* in, int size, doubleComplex* out); #endif /* !__EXP_H__ */ diff --git a/src/elementaryFunctions/includes/exp10.h b/src/elementaryFunctions/includes/exp10.h index 949a49dd..7d50871f 100644 --- a/src/elementaryFunctions/includes/exp10.h +++ b/src/elementaryFunctions/includes/exp10.h @@ -13,6 +13,7 @@ #ifndef __EXP10_H__ #define __EXP10_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float 10 based Exponential function ** \param in : input value. */ -float sexp10s(float in); +EXTERN_ELEMFUNCT float sexp10s(float in); /* ** \brief Double Exp10onential function ** \param in : input value. */ -double dexp10s(double in); +EXTERN_ELEMFUNCT double dexp10s(double in); /* ** \brief Float Complex 10 based Exponential function ** \param in : input value. */ -floatComplex cexp10s(floatComplex in); +EXTERN_ELEMFUNCT floatComplex cexp10s(floatComplex in); /* ** \brief Double Complex 10 based Exponential function ** \param in : input value. */ -doubleComplex zexp10s(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zexp10s(doubleComplex in); /* ** \brief Float Matrix 10 based Exponential function @@ -50,7 +51,7 @@ doubleComplex zexp10s(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void sexp10a(float* in, int size, float* out); +EXTERN_ELEMFUNCT void sexp10a(float* in, int size, float* out); /* ** \brief Double Matrix 10 based Exponential function @@ -58,7 +59,7 @@ void sexp10a(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dexp10a(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dexp10a(double* in, int size, double* out); /* ** \brief Float Complex Matrix 10 based Exponential function @@ -66,7 +67,7 @@ void dexp10a(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void cexp10a(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void cexp10a(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix 10 based Exponential function @@ -74,7 +75,7 @@ void cexp10a(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zexp10a(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zexp10a(doubleComplex* in, int size, doubleComplex* out); #endif /* !__EXP10_H__ */ diff --git a/src/elementaryFunctions/includes/fix.h b/src/elementaryFunctions/includes/fix.h index db4c8ca6..7c5bb20a 100644 --- a/src/elementaryFunctions/includes/fix.h +++ b/src/elementaryFunctions/includes/fix.h @@ -13,6 +13,7 @@ #ifndef __FIX_H__ #define __FIX_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -23,21 +24,21 @@ else y=ceil(x) */ -float sfixs(float in); +EXTERN_ELEMFUNCT float sfixs(float in); -double dfixs(double in); +EXTERN_ELEMFUNCT double dfixs(double in); -floatComplex cfixs(floatComplex in); +EXTERN_ELEMFUNCT floatComplex cfixs(floatComplex in); -doubleComplex zfixs(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zfixs(doubleComplex in); -void sfixa(float* in, int size, float* out); +EXTERN_ELEMFUNCT void sfixa(float* in, int size, float* out); -void dfixa(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dfixa(double* in, int size, double* out); -void cfixa(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void cfixa(floatComplex* in, int size, floatComplex* out); -void zfixa(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zfixa(doubleComplex* in, int size, doubleComplex* out); #endif /* !__FIX_H__ */ diff --git a/src/elementaryFunctions/includes/floor.h b/src/elementaryFunctions/includes/floor.h index d33d2370..a3de3717 100644 --- a/src/elementaryFunctions/includes/floor.h +++ b/src/elementaryFunctions/includes/floor.h @@ -13,6 +13,7 @@ #ifndef __FLOOR_H__ #define __FLOOR_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -20,21 +21,21 @@ floor(x) returns an integer matrix made of nearest rounded down integers. */ -float sfloors(float in); +EXTERN_ELEMFUNCT float sfloors(float in); -double dfloors(double in); +EXTERN_ELEMFUNCT double dfloors(double in); -floatComplex cfloors(floatComplex in); +EXTERN_ELEMFUNCT floatComplex cfloors(floatComplex in); -doubleComplex zfloors(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zfloors(doubleComplex in); -void sfloora(float* in, int size, float* out); +EXTERN_ELEMFUNCT void sfloora(float* in, int size, float* out); -void dfloora(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dfloora(double* in, int size, double* out); -void cfloora(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void cfloora(floatComplex* in, int size, floatComplex* out); -void zfloora(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zfloora(doubleComplex* in, int size, doubleComplex* out); #endif /* !__FLOOR_H__ */ diff --git a/src/elementaryFunctions/includes/int.h b/src/elementaryFunctions/includes/int.h index 9ac461a7..6614fcfe 100644 --- a/src/elementaryFunctions/includes/int.h +++ b/src/elementaryFunctions/includes/int.h @@ -13,6 +13,7 @@ #ifndef __INT_H__ #define __INT_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -20,21 +21,21 @@ int(X) returns the integer part of the real matrix X. Same as fix. */ -float sints(float in); +EXTERN_ELEMFUNCT float sints(float in); -double dints(double in); +EXTERN_ELEMFUNCT double dints(double in); -floatComplex cints(floatComplex in); +EXTERN_ELEMFUNCT floatComplex cints(floatComplex in); -doubleComplex zints(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zints(doubleComplex in); -void sinta(float* in, int size, float* out); +EXTERN_ELEMFUNCT void sinta(float* in, int size, float* out); -void dinta(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dinta(double* in, int size, double* out); -void cinta(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void cinta(floatComplex* in, int size, floatComplex* out); -void zinta(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zinta(doubleComplex* in, int size, doubleComplex* out); #endif /* !__INT_H__ */ diff --git a/src/elementaryFunctions/includes/lnp1m1.h b/src/elementaryFunctions/includes/lnp1m1.h index 4aae3cbf..c05257eb 100644 --- a/src/elementaryFunctions/includes/lnp1m1.h +++ b/src/elementaryFunctions/includes/lnp1m1.h @@ -13,6 +13,7 @@ #ifndef __LNP1M1_H__ #define __LNP1M1_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,13 +25,13 @@ ** \brief Float Lnp1m1 function ** \param in : input value. */ -float slnp1m1s(float in); +EXTERN_ELEMFUNCT float slnp1m1s(float in); /* ** \brief Double Lnp1m1 function ** \param in : input value. */ -double dlnp1m1s(double in); +EXTERN_ELEMFUNCT double dlnp1m1s(double in); #endif /* !__LNP1M1_H__ */ diff --git a/src/elementaryFunctions/includes/log.h b/src/elementaryFunctions/includes/log.h index ee41ea3c..890f8eca 100644 --- a/src/elementaryFunctions/includes/log.h +++ b/src/elementaryFunctions/includes/log.h @@ -13,6 +13,7 @@ #ifndef __LOG_H__ #define __LOG_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Logarithm function ** \param in : input value. */ -float slogs(float in); +EXTERN_ELEMFUNCT float slogs(float in); /* ** \brief Double Logarithm function ** \param in : input value. */ -double dlogs(double in); +EXTERN_ELEMFUNCT double dlogs(double in); /* ** \brief Float Complex Logarithm function ** \param in : input value. */ -floatComplex clogs(floatComplex in); +EXTERN_ELEMFUNCT floatComplex clogs(floatComplex in); /* ** \brief Double Complex Logarithm function ** \param in : input value. */ -doubleComplex zlogs(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zlogs(doubleComplex in); /* ** \brief Float Matrix Logarithm function @@ -50,7 +51,7 @@ doubleComplex zlogs(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void sloga(float* in, int size, float* out); +EXTERN_ELEMFUNCT void sloga(float* in, int size, float* out); /* ** \brief Double Matrix Logarithm function @@ -58,7 +59,7 @@ void sloga(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dloga(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dloga(double* in, int size, double* out); /* ** \brief Float Complex Matrix Logarithm function @@ -66,7 +67,7 @@ void dloga(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void cloga(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void cloga(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Logarithm function @@ -74,7 +75,7 @@ void cloga(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zloga(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zloga(doubleComplex* in, int size, doubleComplex* out); #endif /* !__LOG_H__ */ diff --git a/src/elementaryFunctions/includes/log10.h b/src/elementaryFunctions/includes/log10.h index a68810a9..89324179 100644 --- a/src/elementaryFunctions/includes/log10.h +++ b/src/elementaryFunctions/includes/log10.h @@ -13,6 +13,7 @@ #ifndef __LOG10_H__ #define __LOG10_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Ten based Logarithm function ** \param in : input value. */ -float slog10s(float in); +EXTERN_ELEMFUNCT float slog10s(float in); /* ** \brief Double Ten based Logarithm function ** \param in : input value. */ -double dlog10s(double in); +EXTERN_ELEMFUNCT double dlog10s(double in); /* ** \brief Float Complex Ten based Logarithm function ** \param in : input value. */ -floatComplex clog10s(floatComplex in); +EXTERN_ELEMFUNCT floatComplex clog10s(floatComplex in); /* ** \brief Double Complex Ten based Logarithm function ** \param in : input value. */ -doubleComplex zlog10s(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zlog10s(doubleComplex in); /* ** \brief Float Matrix Ten based Logarithm function @@ -50,7 +51,7 @@ doubleComplex zlog10s(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void slog10a(float* in, int size, float* out); +EXTERN_ELEMFUNCT void slog10a(float* in, int size, float* out); /* ** \brief Double Matrix Ten based Logarithm function @@ -58,7 +59,7 @@ void slog10a(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dlog10a(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dlog10a(double* in, int size, double* out); /* ** \brief Float Complex Matrix Ten based Logarithm function @@ -66,7 +67,7 @@ void dlog10a(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void clog10a(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void clog10a(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Ten based Logarithm function @@ -74,7 +75,7 @@ void clog10a(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zlog10a(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zlog10a(doubleComplex* in, int size, doubleComplex* out); #endif /* !__LOG10_H__ */ diff --git a/src/elementaryFunctions/includes/log1p.h b/src/elementaryFunctions/includes/log1p.h index b9ba8acd..82ba3008 100644 --- a/src/elementaryFunctions/includes/log1p.h +++ b/src/elementaryFunctions/includes/log1p.h @@ -13,6 +13,7 @@ #ifndef __LOG1P_H__ #define __LOG1P_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Logarithm function ** \param in : input value. */ -float slog1ps(float in); +EXTERN_ELEMFUNCT float slog1ps(float in); /* ** \brief Double Logarithm function ** \param in : input value. */ -double dlog1ps(double in); +EXTERN_ELEMFUNCT double dlog1ps(double in); /* ** \brief Float Complex Logarithm function ** \param in : input value. */ -floatComplex clog1ps(floatComplex in); +EXTERN_ELEMFUNCT floatComplex clog1ps(floatComplex in); /* ** \brief Double Complex Logarithm function ** \param in : input value. */ -doubleComplex zlog1ps(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zlog1ps(doubleComplex in); /* ** \brief Float Matrix Logarithm function @@ -50,7 +51,7 @@ doubleComplex zlog1ps(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void slog1pa(float* in, int size, float* out); +EXTERN_ELEMFUNCT void slog1pa(float* in, int size, float* out); /* ** \brief Double Matrix Logarithm function @@ -58,7 +59,7 @@ void slog1pa(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dlog1pa(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dlog1pa(double* in, int size, double* out); /* ** \brief Float Complex Matrix Logarithm function @@ -66,7 +67,7 @@ void dlog1pa(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void clog1pa(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void clog1pa(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Logarithm function @@ -74,7 +75,7 @@ void clog1pa(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zlog1pa(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zlog1pa(doubleComplex* in, int size, doubleComplex* out); #endif /* !__LOG1P_H__ */ diff --git a/src/elementaryFunctions/includes/pow.h b/src/elementaryFunctions/includes/pow.h index ea32d962..f1d3191f 100644 --- a/src/elementaryFunctions/includes/pow.h +++ b/src/elementaryFunctions/includes/pow.h @@ -13,22 +13,23 @@ #ifndef __POW_H__ #define __POW_H__ +#include "dynlib_elementaryfunctions.h" #include "multiplication.h" -float spows(float value, float expand); +EXTERN_ELEMFUNCT float spows(float value, float expand); -double dpows(double value, double expand); +EXTERN_ELEMFUNCT double dpows(double value, double expand); -floatComplex cpows(floatComplex value, floatComplex expand); +EXTERN_ELEMFUNCT floatComplex cpows(floatComplex value, floatComplex expand); -doubleComplex zpows(doubleComplex value, doubleComplex expand); +EXTERN_ELEMFUNCT doubleComplex zpows(doubleComplex value, doubleComplex expand); -void spowa(float *value, int size, float* expand, float *out); +EXTERN_ELEMFUNCT void spowa(float *value, int size, float* expand, float *out); -void dpowa(double *value, int size, double* expand, double *out); +EXTERN_ELEMFUNCT void dpowa(double *value, int size, double* expand, double *out); -void cpowa(floatComplex *value, int size, floatComplex* expand, floatComplex *out); +EXTERN_ELEMFUNCT void cpowa(floatComplex *value, int size, floatComplex* expand, floatComplex *out); -void zpowa(doubleComplex *value, int size, doubleComplex* expand, doubleComplex *out); +EXTERN_ELEMFUNCT void zpowa(doubleComplex *value, int size, doubleComplex* expand, doubleComplex *out); #endif /* !__POW_H__ */ diff --git a/src/elementaryFunctions/includes/round.h b/src/elementaryFunctions/includes/round.h index fd98c546..edb6ee62 100644 --- a/src/elementaryFunctions/includes/round.h +++ b/src/elementaryFunctions/includes/round.h @@ -13,6 +13,7 @@ #ifndef __ROUND_H__ #define __ROUND_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -20,21 +21,21 @@ round(x) rounds the elements of x to the nearest integers. */ -float srounds(float in); +EXTERN_ELEMFUNCT float srounds(float in); -double drounds(double in); +EXTERN_ELEMFUNCT double drounds(double in); -floatComplex crounds(floatComplex in); +EXTERN_ELEMFUNCT floatComplex crounds(floatComplex in); -doubleComplex zrounds(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zrounds(doubleComplex in); -void srounda(float* in, int size, float* out); +EXTERN_ELEMFUNCT void srounda(float* in, int size, float* out); -void drounda(double* in, int size, double* out); +EXTERN_ELEMFUNCT void drounda(double* in, int size, double* out); -void crounda(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void crounda(floatComplex* in, int size, floatComplex* out); -void zrounda(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zrounda(doubleComplex* in, int size, doubleComplex* out); #endif /* !__ROUND_H__ */ diff --git a/src/elementaryFunctions/includes/sin.h b/src/elementaryFunctions/includes/sin.h index 023bd2e6..c0d48ae3 100644 --- a/src/elementaryFunctions/includes/sin.h +++ b/src/elementaryFunctions/includes/sin.h @@ -13,6 +13,7 @@ #ifndef __SIN_H__ #define __SIN_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Sine function ** \param in : input value. */ -float ssins(float in); +EXTERN_ELEMFUNCT float ssins(float in); /* ** \brief Double Sine function ** \param in : input value. */ -double dsins(double in); +EXTERN_ELEMFUNCT double dsins(double in); /* ** \brief Float Complex Sine function ** \param in : input value. */ -floatComplex csins(floatComplex in); +EXTERN_ELEMFUNCT floatComplex csins(floatComplex in); /* ** \brief Double Complex Sine function ** \param in : input value. */ -doubleComplex zsins(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zsins(doubleComplex in); /* ** \brief Float Matrix Sine function @@ -50,7 +51,7 @@ doubleComplex zsins(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void ssina(float* in, int size, float* out); +EXTERN_ELEMFUNCT void ssina(float* in, int size, float* out); /* ** \brief Double Matrix Sine function @@ -58,7 +59,7 @@ void ssina(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dsina(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dsina(double* in, int size, double* out); /* ** \brief Float Complex Matrix Sine function @@ -66,7 +67,7 @@ void dsina(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void csina(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void csina(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Sine function @@ -74,7 +75,7 @@ void csina(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zsina(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zsina(doubleComplex* in, int size, doubleComplex* out); #endif /* !__SIN_H__ */ diff --git a/src/elementaryFunctions/includes/sinh.h b/src/elementaryFunctions/includes/sinh.h index 105bf8d2..31eb1924 100644 --- a/src/elementaryFunctions/includes/sinh.h +++ b/src/elementaryFunctions/includes/sinh.h @@ -13,6 +13,7 @@ #ifndef __SINH_H__ #define __SINH_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Sine function ** \param in : input value. */ -float ssinhs(float in); +EXTERN_ELEMFUNCT float ssinhs(float in); /* ** \brief Double Sine function ** \param in : input value. */ -double dsinhs(double in); +EXTERN_ELEMFUNCT double dsinhs(double in); /* ** \brief Float Complex Sine function ** \param in : input value. */ -floatComplex csinhs(floatComplex in); +EXTERN_ELEMFUNCT floatComplex csinhs(floatComplex in); /* ** \brief Double Complex Sine function ** \param in : input value. */ -doubleComplex zsinhs(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zsinhs(doubleComplex in); /* ** \brief Float Matrix Sine function @@ -50,7 +51,7 @@ doubleComplex zsinhs(doubleComplex in); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void ssinha(float* in, int size, float* out); +EXTERN_ELEMFUNCT void ssinha(float* in, int size, float* out); /* ** \brief Double Matrix Sine function @@ -58,7 +59,7 @@ void ssinha(float* in, int size, float* out); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void dsinha(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dsinha(double* in, int size, double* out); /* ** \brief Float Complex Matrix Sine function @@ -66,7 +67,7 @@ void dsinha(double* in, int size, double* out); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void csinha(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void csinha(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Sine function @@ -74,6 +75,6 @@ void csinha(floatComplex* in, int size, floatComplex* out); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void zsinha(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zsinha(doubleComplex* in, int size, doubleComplex* out); #endif /* !__SINH_H__ */ diff --git a/src/elementaryFunctions/includes/sqrt.h b/src/elementaryFunctions/includes/sqrt.h index 7ae0a369..048b1a48 100644 --- a/src/elementaryFunctions/includes/sqrt.h +++ b/src/elementaryFunctions/includes/sqrt.h @@ -13,6 +13,7 @@ #ifndef __SQRT_H__ #define __SQRT_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Square Root function ** \param in : input value. */ -float ssqrts(float in); +EXTERN_ELEMFUNCT float ssqrts(float in); /* ** \brief Double Square Root function ** \param in : input value. */ -double dsqrts(double in); +EXTERN_ELEMFUNCT double dsqrts(double in); /* ** \brief Float Complex Square Root function ** \param in : input value. */ -floatComplex csqrts(floatComplex in); +EXTERN_ELEMFUNCT floatComplex csqrts(floatComplex in); /* ** \brief Double Complex Square Root function ** \param in : input value. */ -doubleComplex zsqrts(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex zsqrts(doubleComplex in); /* ** \brief Float Matrix Square Root function @@ -50,7 +51,7 @@ doubleComplex zsqrts(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void ssqrta(float* in, int size, float* out); +EXTERN_ELEMFUNCT void ssqrta(float* in, int size, float* out); /* ** \brief Double Matrix Square Root function @@ -58,7 +59,7 @@ void ssqrta(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dsqrta(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dsqrta(double* in, int size, double* out); /* ** \brief Float Complex Matrix Square Root function @@ -66,7 +67,7 @@ void dsqrta(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void csqrta(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void csqrta(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Square Root function @@ -74,6 +75,6 @@ void csqrta(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void zsqrta(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void zsqrta(doubleComplex* in, int size, doubleComplex* out); #endif /* !__SQRT_H__ */ diff --git a/src/elementaryFunctions/includes/tan.h b/src/elementaryFunctions/includes/tan.h index b9be081e..6e3a434b 100644 --- a/src/elementaryFunctions/includes/tan.h +++ b/src/elementaryFunctions/includes/tan.h @@ -13,6 +13,7 @@ #ifndef __TAN_H__ #define __TAN_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Tangeant function ** \param in : input value. */ -float stans(float in); +EXTERN_ELEMFUNCT float stans(float in); /* ** \brief Double Tangeant function ** \param in : input value. */ -double dtans(double in); +EXTERN_ELEMFUNCT double dtans(double in); /* ** \brief Float Complex Tangeant function ** \param in : input value. */ -floatComplex ctans(floatComplex in); +EXTERN_ELEMFUNCT floatComplex ctans(floatComplex in); /* ** \brief Double Complex Tangeant function ** \param in : input value. */ -doubleComplex ztans(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex ztans(doubleComplex in); /* ** \brief Float Matrix Tangeant function @@ -50,7 +51,7 @@ doubleComplex ztans(doubleComplex in); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void stana(float* in, int size, float* out); +EXTERN_ELEMFUNCT void stana(float* in, int size, float* out); /* ** \brief Double Matrix Tangeant function @@ -58,7 +59,7 @@ void stana(float* in, int size, float* out); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void dtana(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dtana(double* in, int size, double* out); /* ** \brief Float Complex Matrix Tangeant function @@ -66,7 +67,7 @@ void dtana(double* in, int size, double* out); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void ctana(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void ctana(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Tangeant function @@ -74,7 +75,7 @@ void ctana(floatComplex* in, int size, floatComplex* out); ** \param out : input array value. ** \param size : the size of in and out arrays. */ -void ztana(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void ztana(doubleComplex* in, int size, doubleComplex* out); #endif /* !__TAN_H__ */ diff --git a/src/elementaryFunctions/includes/tanh.h b/src/elementaryFunctions/includes/tanh.h index 32b78b03..9f3dae52 100644 --- a/src/elementaryFunctions/includes/tanh.h +++ b/src/elementaryFunctions/includes/tanh.h @@ -13,6 +13,7 @@ #ifndef __TANH_H__ #define __TANH_H__ +#include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" @@ -24,25 +25,25 @@ ** \brief Float Hyperbolic Tangeant function ** \param in : input value. */ -float stanhs(float in); +EXTERN_ELEMFUNCT float stanhs(float in); /* ** \brief Double Hyperbolic Tangeant function ** \param in : input value. */ -double dtanhs(double in); +EXTERN_ELEMFUNCT double dtanhs(double in); /* ** \brief Float Complex Hyperbolic Tangeant function ** \param in : input value. */ -floatComplex ctanhs(floatComplex in); +EXTERN_ELEMFUNCT floatComplex ctanhs(floatComplex in); /* ** \brief Double Complex Hyperbolic Tangeant function ** \param in : input value. */ -doubleComplex ztanhs(doubleComplex in); +EXTERN_ELEMFUNCT doubleComplex ztanhs(doubleComplex in); /* ** \brief Float Matrix Hyperbolic Tangeant function @@ -50,7 +51,7 @@ doubleComplex ztanhs(doubleComplex in); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void stanha(float* in, int size, float* out); +EXTERN_ELEMFUNCT void stanha(float* in, int size, float* out); /* ** \brief Double Matrix Hyperbolic Tangeant function @@ -58,7 +59,7 @@ void stanha(float* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void dtanha(double* in, int size, double* out); +EXTERN_ELEMFUNCT void dtanha(double* in, int size, double* out); /* ** \brief Float Complex Matrix Hyperbolic Tangeant function @@ -66,7 +67,7 @@ void dtanha(double* in, int size, double* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void ctanha(floatComplex* in, int size, floatComplex* out); +EXTERN_ELEMFUNCT void ctanha(floatComplex* in, int size, floatComplex* out); /* ** \brief Double Complex Matrix Hyperbolic Tangeant function @@ -74,6 +75,6 @@ void ctanha(floatComplex* in, int size, floatComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -void ztanha(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void ztanha(doubleComplex* in, int size, doubleComplex* out); #endif /* !__TANH_H__ */ diff --git a/src/elementaryFunctions/sqrt/csqrts.c b/src/elementaryFunctions/sqrt/csqrts.c index f06d2dd1..a2ed819e 100644 --- a/src/elementaryFunctions/sqrt/csqrts.c +++ b/src/elementaryFunctions/sqrt/csqrts.c @@ -1,105 +1,110 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#include -#include "sqrt.h" -#include "lapack.h" -#include "abs.h" -#include "sign.h" -#include "pythag.h" - -#define _sign(a, b) b >=0 ? a : -a - -floatComplex csqrts(floatComplex in) { - float RMax = (float) getOverflowThreshold(); - float BRMin = 2.0f * (float) getUnderflowThreshold(); - - float RealIn = creals(in); - float ImgIn = cimags(in); - - float RealOut = 0; - float ImgOut = 0; - - if(RealIn == 0) - {/* pure imaginary case */ - if(dabss(ImgIn >= BRMin)) - RealOut = ssqrts(0.5f * sabss(ImgIn)); - else - RealOut = ssqrts(sabss(ImgIn)) * ssqrts(0.5); - - ImgOut = _sign(1, ImgIn) * RealOut; - } - else if( sabss(RealIn) <= RMax && sabss(ImgIn) <= RMax) - {/* standard case : a (not zero) and b are finite */ - float Temp = ssqrts(2.0f * (sabss(RealIn) + spythags(RealIn, ImgIn))); - /* overflow test */ - if(Temp > RMax) - {/* handle (spurious) overflow by scaling a and b */ - float RealTemp = RealIn / 16.0f; - float ImgTemp = ImgIn / 16.0f; - Temp = ssqrts(2.0f * (sabss(RealIn) + spythags(RealIn, ImgTemp))); - if(RealTemp >= 0) - { - RealOut = 2 * Temp; - ImgOut = 4 * ImgTemp / Temp; - } - else - { - RealOut = 4 * sabss(ImgIn) / Temp; - ImgOut = _sign(2, ImgIn) * Temp; - } - } - else if(RealIn >= 0) /* classic switch to get the stable formulas */ - { - RealOut = 0.5f * Temp; - ImgOut = ImgIn / Temp; - } - else - { - RealOut = sabss(ImgIn) / Temp; - ImgOut = (_sign(0.5f, ImgIn)) * Temp; - } - } - else - { - /* - //Here we treat the special cases where a and b are +- 00 or NaN. - //The following is the treatment recommended by the C99 standard - //with the simplification of returning NaN + i NaN if the - //the real part or the imaginary part is NaN (C99 recommends - //something more complicated) - */ - - if(isnan(RealIn) == 1 || isnan(ImgIn) == 1) - {/* got NaN + i NaN */ - RealOut = RealIn + ImgIn; - ImgOut = RealOut; - } - else if( dabss(ImgIn) > RMax) - {/* case a +- i oo -> result must be +oo +- i oo for all a (finite or not) */ - RealOut = sabss(ImgIn); - ImgOut = ImgIn; - } - else if(RealIn < -RMax) - {/* here a is -Inf and b is finite */ - RealOut = 0; - ImgOut = _sign(1, ImgIn) * sabss(RealIn); - } - else - {/* here a is +Inf and b is finite */ - RealOut = RealIn; - ImgOut = 0; - } - } - - return FloatComplex(RealOut, ImgOut); -} +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include +#include "sqrt.h" +#include "lapack.h" +#include "abs.h" +#include "sign.h" +#include "pythag.h" + +#ifdef _MSC_VER +#include +#define isnan(x) _isnan((double)x) +#endif + +#define _sign(a, b) b >=0 ? a : -a + +floatComplex csqrts(floatComplex in) { + float RMax = (float) getOverflowThreshold(); + float BRMin = 2.0f * (float) getUnderflowThreshold(); + + float RealIn = creals(in); + float ImgIn = cimags(in); + + float RealOut = 0; + float ImgOut = 0; + + if(RealIn == 0) + {/* pure imaginary case */ + if(dabss(ImgIn >= BRMin)) + RealOut = ssqrts(0.5f * sabss(ImgIn)); + else + RealOut = ssqrts(sabss(ImgIn)) * ssqrts(0.5); + + ImgOut = _sign(1, ImgIn) * RealOut; + } + else if( sabss(RealIn) <= RMax && sabss(ImgIn) <= RMax) + {/* standard case : a (not zero) and b are finite */ + float Temp = ssqrts(2.0f * (sabss(RealIn) + spythags(RealIn, ImgIn))); + /* overflow test */ + if(Temp > RMax) + {/* handle (spurious) overflow by scaling a and b */ + float RealTemp = RealIn / 16.0f; + float ImgTemp = ImgIn / 16.0f; + Temp = ssqrts(2.0f * (sabss(RealIn) + spythags(RealIn, ImgTemp))); + if(RealTemp >= 0) + { + RealOut = 2 * Temp; + ImgOut = 4 * ImgTemp / Temp; + } + else + { + RealOut = 4 * sabss(ImgIn) / Temp; + ImgOut = _sign(2, ImgIn) * Temp; + } + } + else if(RealIn >= 0) /* classic switch to get the stable formulas */ + { + RealOut = 0.5f * Temp; + ImgOut = ImgIn / Temp; + } + else + { + RealOut = sabss(ImgIn) / Temp; + ImgOut = (_sign(0.5f, ImgIn)) * Temp; + } + } + else + { + /* + //Here we treat the special cases where a and b are +- 00 or NaN. + //The following is the treatment recommended by the C99 standard + //with the simplification of returning NaN + i NaN if the + //the real part or the imaginary part is NaN (C99 recommends + //something more complicated) + */ + + if(isnan(RealIn) == 1 || isnan(ImgIn) == 1) + {/* got NaN + i NaN */ + RealOut = RealIn + ImgIn; + ImgOut = RealOut; + } + else if( dabss(ImgIn) > RMax) + {/* case a +- i oo -> result must be +oo +- i oo for all a (finite or not) */ + RealOut = sabss(ImgIn); + ImgOut = ImgIn; + } + else if(RealIn < -RMax) + {/* here a is -Inf and b is finite */ + RealOut = 0; + ImgOut = _sign(1, ImgIn) * sabss(RealIn); + } + else + {/* here a is +Inf and b is finite */ + RealOut = RealIn; + ImgOut = 0; + } + } + + return FloatComplex(RealOut, ImgOut); +} diff --git a/src/elementaryFunctions/sqrt/zsqrts.c b/src/elementaryFunctions/sqrt/zsqrts.c index bdfc7a49..f1a2b05c 100644 --- a/src/elementaryFunctions/sqrt/zsqrts.c +++ b/src/elementaryFunctions/sqrt/zsqrts.c @@ -1,105 +1,110 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ -#include -#include -#include "sqrt.h" -#include "lapack.h" -#include "abs.h" -#include "sign.h" -#include "pythag.h" - -#define _sign(a, b) b >=0 ? a : -a - -doubleComplex zsqrts(doubleComplex in) { - double RMax = getOverflowThreshold(); - double BRMin = 2 * getUnderflowThreshold(); - - double RealIn = zreals(in); - double ImgIn = zimags(in); - - double RealOut = 0; - double ImgOut = 0; - - if(RealIn == 0) - {/* pure imaginary case */ - if(dabss(ImgIn >= BRMin)) - RealOut = dsqrts(0.5 * dabss(ImgIn)); - else - RealOut = dsqrts(dabss(ImgIn)) * dsqrts(0.5); - - ImgOut = _sign(1, ImgIn) * RealOut; - } - else if( dabss(RealIn) <= RMax && dabss(ImgIn) <= RMax) - {/* standard case : a (not zero) and b are finite */ - double Temp = dsqrts(2 * (dabss(RealIn) + dpythags(RealIn, ImgIn))); - /* overflow test */ - if(Temp > RMax) - {/* handle (spurious) overflow by scaling a and b */ - double RealTemp = RealIn / 16; - double ImgTemp = ImgIn / 16; - Temp = dsqrts(2 * (dabss(RealIn) + dpythags(RealIn, ImgTemp))); - if(RealTemp >= 0) - { - RealOut = 2 * Temp; - ImgOut = 4 * ImgTemp / Temp; - } - else - { - RealOut = 4 * dabss(ImgIn) / Temp; - ImgOut = _sign(2, ImgIn) * Temp; - } - } - else if(RealIn >= 0) /* classic switch to get the stable formulas */ - { - RealOut = 0.5 * Temp; - ImgOut = ImgIn / Temp; - } - else - { - RealOut = dabss(ImgIn) / Temp; - ImgOut = (_sign(0.5, ImgIn)) * Temp; - } - } - else - { - /* - //Here we treat the special cases where a and b are +- 00 or NaN. - //The following is the treatment recommended by the C99 standard - //with the simplification of returning NaN + i NaN if the - //the real part or the imaginary part is NaN (C99 recommends - //something more complicated) - */ - - if(isnan(RealIn) == 1 || isnan(ImgIn) == 1) - {/* got NaN + i NaN */ - RealOut = RealIn + ImgIn; - ImgOut = RealOut; - } - else if( dabss(ImgIn) > RMax) - {/* case a +- i oo -> result must be +oo +- i oo for all a (finite or not) */ - RealOut = dabss(ImgIn); - ImgOut = ImgIn; - } - else if(RealIn < -RMax) - {/* here a is -Inf and b is finite */ - RealOut = 0; - ImgOut = _sign(1, ImgIn) * dabss(RealIn); - } - else - {/* here a is +Inf and b is finite */ - RealOut = RealIn; - ImgOut = 0; - } - } - - return DoubleComplex(RealOut, ImgOut); -} +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ +#include +#include +#include "sqrt.h" +#include "lapack.h" +#include "abs.h" +#include "sign.h" +#include "pythag.h" + +#ifdef _MSC_VER +#include +#define isnan(x) _isnan((double)x) +#endif + +#define _sign(a, b) b >=0 ? a : -a + +doubleComplex zsqrts(doubleComplex in) { + double RMax = getOverflowThreshold(); + double BRMin = 2 * getUnderflowThreshold(); + + double RealIn = zreals(in); + double ImgIn = zimags(in); + + double RealOut = 0; + double ImgOut = 0; + + if(RealIn == 0) + {/* pure imaginary case */ + if(dabss(ImgIn >= BRMin)) + RealOut = dsqrts(0.5 * dabss(ImgIn)); + else + RealOut = dsqrts(dabss(ImgIn)) * dsqrts(0.5); + + ImgOut = _sign(1, ImgIn) * RealOut; + } + else if( dabss(RealIn) <= RMax && dabss(ImgIn) <= RMax) + {/* standard case : a (not zero) and b are finite */ + double Temp = dsqrts(2 * (dabss(RealIn) + dpythags(RealIn, ImgIn))); + /* overflow test */ + if(Temp > RMax) + {/* handle (spurious) overflow by scaling a and b */ + double RealTemp = RealIn / 16; + double ImgTemp = ImgIn / 16; + Temp = dsqrts(2 * (dabss(RealIn) + dpythags(RealIn, ImgTemp))); + if(RealTemp >= 0) + { + RealOut = 2 * Temp; + ImgOut = 4 * ImgTemp / Temp; + } + else + { + RealOut = 4 * dabss(ImgIn) / Temp; + ImgOut = _sign(2, ImgIn) * Temp; + } + } + else if(RealIn >= 0) /* classic switch to get the stable formulas */ + { + RealOut = 0.5 * Temp; + ImgOut = ImgIn / Temp; + } + else + { + RealOut = dabss(ImgIn) / Temp; + ImgOut = (_sign(0.5, ImgIn)) * Temp; + } + } + else + { + /* + //Here we treat the special cases where a and b are +- 00 or NaN. + //The following is the treatment recommended by the C99 standard + //with the simplification of returning NaN + i NaN if the + //the real part or the imaginary part is NaN (C99 recommends + //something more complicated) + */ + + if(isnan(RealIn) == 1 || isnan(ImgIn) == 1) + {/* got NaN + i NaN */ + RealOut = RealIn + ImgIn; + ImgOut = RealOut; + } + else if( dabss(ImgIn) > RMax) + {/* case a +- i oo -> result must be +oo +- i oo for all a (finite or not) */ + RealOut = dabss(ImgIn); + ImgOut = ImgIn; + } + else if(RealIn < -RMax) + {/* here a is -Inf and b is finite */ + RealOut = 0; + ImgOut = _sign(1, ImgIn) * dabss(RealIn); + } + else + {/* here a is +Inf and b is finite */ + RealOut = RealIn; + ImgOut = 0; + } + } + + return DoubleComplex(RealOut, ImgOut); +} diff --git a/src/includes/lapack.h b/src/includes/lapack.h index b08fc3b7..4b995bd0 100644 --- a/src/includes/lapack.h +++ b/src/includes/lapack.h @@ -18,6 +18,11 @@ #define C2F(name) name##_ #endif +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif #define getRelativeMachinePrecision() dlamch_("e", 1L) #define getOverflowThreshold() dlamch_("o", 1L) @@ -96,22 +101,22 @@ extern double dgetri_ (int* N , double* A , int* LDA , int* IPIV , double* /****** doubleComplex fortran function ************/ -extern double zgelsy_ () ; +extern double zgelsy_ (int*,int*,int*,doubleComplex*,int*,doubleComplex*,int*,int*,double*,int*,doubleComplex*,int*,double*,int*) ; extern double zlamch_ (); -extern double zlange_ (); +extern double zlange_ (char*,int*,int*,doubleComplex*,int*,doubleComplex*); -extern double zgetrf_ (); +extern double zgetrf_ (int *, int *, doubleComplex *, int *, int *, int *); -extern double zgecon_ ( ) ; +extern double zgecon_ ( char*,int*,doubleComplex*,int*,double*,double*,doubleComplex*,double*,int*) ; -extern double zgetrs_ ( ) ; +extern double zgetrs_ ( char *,int*,int*,doubleComplex*,int*,int*,doubleComplex*,int*,int*) ; -extern double zlacpy_ (); +extern double zlacpy_ (char*,int*,int*,doubleComplex*,int*,doubleComplex*,int*); -extern double zgetri_ () ; +extern double zgetri_ (int*,doubleComplex*,int*,int*,doubleComplex*,int*,int*) ; /*extern int zgelsy_ ();*/ /*certainly have some blas functions in */ @@ -137,19 +142,27 @@ extern int C2F(intexpm) (); extern int C2F(zcopy)(); -extern int C2F(dgemm)(); -extern int C2F(idamax)() ;/* could be transcribe easaly in c */ -extern int C2F(daxpy) () ;/* could be transcribe easaly in c */ -extern int C2F(dscal) () ;/* could be transcribe easaly in c */ -extern int C2F(dasum) () ;/* could be transcribe easaly in c */ +extern int C2F(dgemm)(char *,char*,int*,int*,int*,double*,double*,int*,double*,int*,double*,double*,int*); +extern int C2F(idamax)() ;/* could be transcribe easily in c */ +extern int C2F(daxpy) () ;/* could be transcribe easily in c */ +extern int C2F(dscal) () ;/* could be transcribe easily in c */ +extern int C2F(dasum) () ;/* could be transcribe easily in c */ /* used in chol */ -extern int C2F(dpotrf)(); -extern int C2F(zpotrf)(); +extern int C2F(dpotrf)(char*,int*,double*,int*,int*); +extern int C2F(zpotrf)(char*,int*,doubleComplex*,int*,int*); + /* used in logm */ -extern int C2F(zgeev)(); -extern int C2F(zheev)(); +extern int C2F(zgeev)(char*,char*,int*,doubleComplex*,int*,doubleComplex*, + doubleComplex*,int*,doubleComplex*,int*,doubleComplex*,int *,doubleComplex*,int*); + +extern int C2F(zheev)(char*,char*,int*,doubleComplex*,int*,double*,doubleComplex*,int*,double*,int*); + /* used in spec */ -extern int C2F(dgeev)(); -extern int C2F(dsyev)(); +extern int C2F(dgeev)(char*,char*,int*,double*,int*,double*,double*,double*,int*,double*,int*,double*,int*,int*); +extern int C2F(dsyev)(char*,char*,int*,double*,int*,double*,double*,int*,int*); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__LAPACK_H__ */ diff --git a/src/lib/blas/blas_f/blasplus_DLL.vfproj b/src/lib/blas/blas_f/blasplus_DLL.vfproj index 7435e925..148ace9b 100644 --- a/src/lib/blas/blas_f/blasplus_DLL.vfproj +++ b/src/lib/blas/blas_f/blasplus_DLL.vfproj @@ -115,5 +115,6 @@ - + + diff --git a/src/lib/lapack/lapack_f/lapack.def b/src/lib/lapack/lapack_f/lapack.def index 5a7d3451..a6ce5165 100644 --- a/src/lib/lapack/lapack_f/lapack.def +++ b/src/lib/lapack/lapack_f/lapack.def @@ -303,305 +303,4 @@ EXPORTS zunmqr_ zunmr3_ zunmrz_ - - dbdsqr = dbdsqr_ - dgebak = dgebak_ - dgebal = dgebal_ - dgebd2 = dgebd2_ - dgebrd = dgebrd_ - dgecon = dgecon_ - dgeequ = dgeequ_ - dgees = dgees_ - dgeesx = dgeesx_ - dgeev = dgeev_ - dgegs = dgegs_ - dgehd2 = dgehd2_ - dgehrd = dgehrd_ - dgelq2 = dgelq2_ - dgelqf = dgelqf_ - dgels = dgels_ - dgelss = dgelss_ - dgelsx = dgelsx_ - dgelsy = dgelsy_ - dgeql2 = dgeql2_ - dgeqlf = dgeqlf_ - dgeqp3 = dgeqp3_ - dgeqpf = dgeqpf_ - dgeqr2 = dgeqr2_ - dgeqrf = dgeqrf_ - dgerfs = dgerfs_ - dgerq2 = dgerq2_ - dgerqf = dgerqf_ - dgesc2 = dgesc2_ - dgesv = dgesv_ - dgesvd = dgesvd_ - dgesvx = dgesvx_ - dgetc2 = dgetc2_ - dgetf2 = dgetf2_ - dgetrf = dgetrf_ - dgetri = dgetri_ - dgetrs = dgetrs_ - dggbak = dggbak_ - dggbal = dggbal_ - dgges = dgges_ - dggev = dggev_ - dgghrd = dgghrd_ - dhgeqz = dhgeqz_ - dhseqr = dhseqr_ - disnan = disnan_ - dlabad = dlabad_ - dlabrd = dlabrd_ - dlacn2 = dlacn2_ - dlacon = dlacon_ - dlacpy = dlacpy_ - dladiv = dladiv_ - dlae2 = dlae2_ - dlaev2 = dlaev2_ - dlaexc = dlaexc_ - dlag2 = dlag2_ - dlagv2 = dlagv2_ - dlahqr = dlahqr_ - dlahr2 = dlahr2_ - dlahrd = dlahrd_ - dlaic1 = dlaic1_ - dlaisnan = dlaisnan_ - dlaln2 = dlaln2_ - dlamch = dlamch_ - dlamc2 = dlamc2_ - dlamc1 = dlamc1_ - dlamc3 = dlamc3_ - dlamc4 = dlamc4_ - dlamc5 = dlamc5_ - dlange = dlange_ - dlanhs = dlanhs_ - dlansp = dlansp_ - dlanst = dlanst_ - dlansy = dlansy_ - dlantr = dlantr_ - dlanv2 = dlanv2_ - dlapmt = dlapmt_ - dlapy2 = dlapy2_ - dlapy3 = dlapy3_ - dlaqge = dlaqge_ - dlaqp2 = dlaqp2_ - dlaqps = dlaqps_ - dlaqr0 = dlaqr0_ - dlaqr1 = dlaqr1_ - dlaqr2 = dlaqr2_ - dlaqr3 = dlaqr3_ - dlaqr4 = dlaqr4_ - dlaqr5 = dlaqr5_ - dlarf = dlarf_ - dlarfb = dlarfb_ - dlarfg = dlarfg_ - dlarft = dlarft_ - dlarfx = dlarfx_ - dlartg = dlartg_ - dlarz = dlarz_ - dlarzb = dlarzb_ - dlarzt = dlarzt_ - dlas2 = dlas2_ - dlascl = dlascl_ - dlaset = dlaset_ - dlasq1 = dlasq1_ - dlasq2 = dlasq2_ - dlasq3 = dlasq3_ - dlasq4 = dlasq4_ - dlasq5 = dlasq5_ - dlasq6 = dlasq6_ - dlasr = dlasr_ - dlasrt = dlasrt_ - dlassq = dlassq_ - dlasv2 = dlasv2_ - dlaswp = dlaswp_ - dlasy2 = dlasy2_ - dlasyf = dlasyf_ - dlatdf = dlatdf_ - dlatrd = dlatrd_ - dlatrs = dlatrs_ - dlatrz = dlatrz_ - dlatzm = dlatzm_ - dlazq3 = dlazq3_ - dlazq4 = dlazq4_ - dopgtr = dopgtr_ - dorg2l = dorg2l_ - dorg2r = dorg2r_ - dorgbr = dorgbr_ - dorghr = dorghr_ - dorgl2 = dorgl2_ - dorglq = dorglq_ - dorgql = dorgql_ - dorgqr = dorgqr_ - dorgr2 = dorgr2_ - dorgrq = dorgrq_ - dorgtr = dorgtr_ - dorm2l = dorm2l_ - dorm2r = dorm2r_ - dormbr = dormbr_ - dormhr = dormhr_ - dorml2 = dorml2_ - dormlq = dormlq_ - dormql = dormql_ - dormqr = dormqr_ - dormr2 = dormr2_ - dormr3 = dormr3_ - dormrq = dormrq_ - dormrz = dormrz_ - dpocon = dpocon_ - dpotf2 = dpotf2_ - dpotrf = dpotrf_ - dpotrs = dpotrs_ - dpptrf = dpptrf_ - drscl = drscl_ - dspev = dspev_ - dspgst = dspgst_ - dspgv = dspgv_ - dsptrd = dsptrd_ - dsptrf = dsptrf_ - dsteqr = dsteqr_ - dsterf = dsterf_ - dsycon = dsycon_ - dsyev = dsyev_ - dsysv = dsysv_ - dsytd2 = dsytd2_ - dsytf2 = dsytf2_ - dsytrd = dsytrd_ - dsytrf = dsytrf_ - dsytri = dsytri_ - dsytrs = dsytrs_ - dtgevc = dtgevc_ - dtgex2 = dtgex2_ - dtgexc = dtgexc_ - dtgsen = dtgsen_ - dtgsy2 = dtgsy2_ - dtgsyl = dtgsyl_ - dtrcon = dtrcon_ - dtrevc = dtrevc_ - dtrexc = dtrexc_ - dtrsen = dtrsen_ - dtrsyl = dtrsyl_ - dtrti2 = dtrti2_ - dtrtri = dtrtri_ - dtrtrs = dtrtrs_ - dtzrqf = dtzrqf_ - dtzrzf = dtzrzf_ - dzsum1 = dzsum1_ - ieeeck = ieeeck_ - ilaenv = ilaenv_ - iparmq = iparmq_ - izmax1 = izmax1_ - lsame = lsame_ - slamch = slamch_ - slamc2 = slamc2_ - slamc1 = slamc1_ - slamc3 = slamc3_ - slamc4 = slamc4_ - slamc5 = slamc5_ - zbdsqr = zbdsqr_ - zdrot = zdrot_ - zdrscl = zdrscl_ - zgebak = zgebak_ - zgebal = zgebal_ - zgebd2 = zgebd2_ - zgebrd = zgebrd_ - zgecon = zgecon_ - zgees = zgees_ - zgeev = zgeev_ - zgehd2 = zgehd2_ - zgehrd = zgehrd_ - zgelq2 = zgelq2_ - zgelqf = zgelqf_ - zgelsy = zgelsy_ - zgeqp3 = zgeqp3_ - zgeqpf = zgeqpf_ - zgeqr2 = zgeqr2_ - zgeqrf = zgeqrf_ - zgesc2 = zgesc2_ - zgesvd = zgesvd_ - zgetc2 = zgetc2_ - zgetf2 = zgetf2_ - zgetrf = zgetrf_ - zgetri = zgetri_ - zgetrs = zgetrs_ - zggbak = zggbak_ - zggbal = zggbal_ - zgges = zgges_ - zggev = zggev_ - zgghrd = zgghrd_ - zheev = zheev_ - zhetd2 = zhetd2_ - zhetrd = zhetrd_ - zhgeqz = zhgeqz_ - zhseqr = zhseqr_ - zlabrd = zlabrd_ - zlacgv = zlacgv_ - zlacn2 = zlacn2_ - zlacon = zlacon_ - zlacpy = zlacpy_ - zladiv = zladiv_ - zlahqr = zlahqr_ - zlahr2 = zlahr2_ - zlahrd = zlahrd_ - zlaic1 = zlaic1_ - zlange = zlange_ - zlanhe = zlanhe_ - zlanhs = zlanhs_ - zlaqp2 = zlaqp2_ - zlaqps = zlaqps_ - zlaqr0 = zlaqr0_ - zlaqr1 = zlaqr1_ - zlaqr2 = zlaqr2_ - zlaqr3 = zlaqr3_ - zlaqr4 = zlaqr4_ - zlaqr5 = zlaqr5_ - zlarf = zlarf_ - zlarfb = zlarfb_ - zlarfg = zlarfg_ - zlarft = zlarft_ - zlarfx = zlarfx_ - zlartg = zlartg_ - zlarz = zlarz_ - zlarzb = zlarzb_ - zlarzt = zlarzt_ - zlascl = zlascl_ - zlaset = zlaset_ - zlasr = zlasr_ - zlassq = zlassq_ - zlaswp = zlaswp_ - zlatdf = zlatdf_ - zlatrd = zlatrd_ - zlatrs = zlatrs_ - zlatrz = zlatrz_ - zpotf2 = zpotf2_ - zpotrf = zpotrf_ - zrot = zrot_ - zsteqr = zsteqr_ - ztgevc = ztgevc_ - ztgex2 = ztgex2_ - ztgexc = ztgexc_ - ztgsen = ztgsen_ - ztgsy2 = ztgsy2_ - ztgsyl = ztgsyl_ - ztrevc = ztrevc_ - ztrexc = ztrexc_ - ztrsen = ztrsen_ - ztrsyl = ztrsyl_ - ztrti2 = ztrti2_ - ztrtri = ztrtri_ - ztzrzf = ztzrzf_ - zung2l = zung2l_ - zung2r = zung2r_ - zungbr = zungbr_ - zunghr = zunghr_ - zungl2 = zungl2_ - zunglq = zunglq_ - zungql = zungql_ - zungqr = zungqr_ - zungtr = zungtr_ - zunm2r = zunm2r_ - zunmbr = zunmbr_ - zunml2 = zunml2_ - zunmlq = zunmlq_ - zunmqr = zunmqr_ - zunmr3 = zunmr3_ - zunmrz = zunmrz_ + \ No newline at end of file diff --git a/src/matrixOperations/chol/cchola.c b/src/matrixOperations/chol/cchola.c index 0de211be..ab576515 100644 --- a/src/matrixOperations/chol/cchola.c +++ b/src/matrixOperations/chol/cchola.c @@ -10,6 +10,9 @@ * */ +#include +#include + #ifndef WITHOUT_LAPACK #include "lapack.h" #else @@ -18,10 +21,8 @@ #include "subtraction.h" #include "sqrt.h" #endif - #include "chol.h" -#include -#include + void cchola(floatComplex * in, int size, floatComplex *out){ /* param in : input matrix (square matrix) @@ -41,10 +42,10 @@ void cchola(floatComplex * in, int size, floatComplex *out){ doubleComplex* tmp; int i=0, j=0, info=0; - tmp=malloc((unsigned int)(size*size)*sizeof(doubleComplex)); + tmp=(doubleComplex*)malloc((unsigned int)(size*size)*sizeof(doubleComplex)); for(i=0;i #ifndef WITHOUT_LAPACK #include "lapack.h" #else @@ -58,11 +58,11 @@ doubleComplex zdeterma(doubleComplex * in, int size){ default : /*Allocate inCopy and Copy in in inCopy*/ - inCopy=malloc((uint)(size*size)*sizeof(doubleComplex)); + inCopy=(doubleComplex*)malloc((unsigned int)(size*size)*sizeof(doubleComplex)); for (i=0;i #include "dist.h" #include "matrixTranspose.h" #include "matrixMultiplication.h" @@ -27,10 +27,10 @@ float cdista(floatComplex* in1,floatComplex* in2, int lines, int columns){ /* FIXME : malloc here*/ - a=malloc((uint)(lines*columns)*sizeof(floatComplex)); - at=malloc((uint)(lines*columns)*sizeof(floatComplex)); - mul=malloc((uint)(lines*lines)*sizeof(floatComplex)); - eigenvalues=malloc((uint)(lines)*sizeof(floatComplex)); + a=(floatComplex*)malloc((unsigned int)(lines*columns)*sizeof(floatComplex)); + at=(floatComplex*)malloc((unsigned int)(lines*columns)*sizeof(floatComplex)); + mul=(floatComplex*)malloc((unsigned int)(lines*lines)*sizeof(floatComplex)); + eigenvalues=(floatComplex*)malloc((unsigned int)(lines)*sizeof(floatComplex)); for (i=0;i #include "dist.h" #include "matrixTranspose.h" #include "matrixMultiplication.h" @@ -25,11 +25,11 @@ double ddista(double* in1,double* in2, int lines, int columns){ /* FIXME : malloc here*/ - a=malloc((uint)(lines*columns)*sizeof(double)); - at=malloc((uint)(lines*columns)*sizeof(double)); - mul=malloc((uint)(lines*lines)*sizeof(double)); - eigenvalues=malloc((uint)(lines)*sizeof(doubleComplex)); - mulCpx=malloc((uint)(lines*lines)*sizeof(doubleComplex)); + a=(double*)malloc((unsigned int)(lines*columns)*sizeof(double)); + at=(double*)malloc((unsigned int)(lines*columns)*sizeof(double)); + mul=(double*)malloc((unsigned int)(lines*lines)*sizeof(double)); + eigenvalues=(doubleComplex*)malloc((unsigned int)(lines)*sizeof(doubleComplex)); + mulCpx=(doubleComplex*)malloc((unsigned int)(lines*lines)*sizeof(doubleComplex)); for (i=0;i #include "dist.h" #include "matrixTranspose.h" #include "matrixMultiplication.h" @@ -25,11 +25,11 @@ float sdista(float* in1,float* in2, int lines, int columns){ /* FIXME : malloc here*/ - a=malloc((uint)(lines*columns)*sizeof(float)); - at=malloc((uint)(lines*columns)*sizeof(float)); - mul=malloc((uint)(lines*lines)*sizeof(float)); - eigenvalues=malloc((uint)(lines)*sizeof(floatComplex)); - mulCpx=malloc((uint)(lines*lines)*sizeof(floatComplex)); + a=(float*)malloc((unsigned int)(lines*columns)*sizeof(float)); + at=(float*)malloc((unsigned int)(lines*columns)*sizeof(float)); + mul=(float*)malloc((unsigned int)(lines*lines)*sizeof(float)); + eigenvalues=(floatComplex*)malloc((unsigned int)(lines)*sizeof(floatComplex)); + mulCpx=(floatComplex*)malloc((unsigned int)(lines*lines)*sizeof(floatComplex)); for (i=0;i #include "dist.h" #include "matrixTranspose.h" #include "matrixMultiplication.h" @@ -27,10 +27,10 @@ double zdista(doubleComplex* in1,doubleComplex* in2, int lines, int columns){ /* FIXME : malloc here*/ - a=malloc((uint)(lines*columns)*sizeof(doubleComplex)); - at=malloc((uint)(lines*columns)*sizeof(doubleComplex)); - mul=malloc((uint)(lines*lines)*sizeof(doubleComplex)); - eigenvalues=malloc((uint)(lines)*sizeof(doubleComplex)); + a=(doubleComplex*)malloc((unsigned int)(lines*columns)*sizeof(doubleComplex)); + at=(doubleComplex*)malloc((unsigned int)(lines*columns)*sizeof(doubleComplex)); + mul=(doubleComplex*)malloc((unsigned int)(lines*lines)*sizeof(doubleComplex)); + eigenvalues=(doubleComplex*)malloc((unsigned int)(lines)*sizeof(doubleComplex)); for (i=0;i + /******FIXME********/ /**** WARNING NOT WORK AT ALL FOR THE MOMENT ***/ /**** Because of problem of conversion float-> double ****/ diff --git a/src/matrixOperations/division/crdivma.c b/src/matrixOperations/division/crdivma.c index ba1850df..dea6741a 100644 --- a/src/matrixOperations/division/crdivma.c +++ b/src/matrixOperations/division/crdivma.c @@ -11,7 +11,7 @@ */ - +#include #include "matrixDivision.h" #include "lapack.h" #include diff --git a/src/matrixOperations/division/dldivma.c b/src/matrixOperations/division/dldivma.c index 18c124c1..e69b86ef 100644 --- a/src/matrixOperations/division/dldivma.c +++ b/src/matrixOperations/division/dldivma.c @@ -12,7 +12,7 @@ - +#include #include "matrixDivision.h" #include "lapack.h" #include diff --git a/src/matrixOperations/division/drdivma.c b/src/matrixOperations/division/drdivma.c index 456cde6c..59734417 100644 --- a/src/matrixOperations/division/drdivma.c +++ b/src/matrixOperations/division/drdivma.c @@ -9,7 +9,7 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ - +#include #include "matrixDivision.h" #include "lapack.h" #include diff --git a/src/matrixOperations/division/sldivma.c b/src/matrixOperations/division/sldivma.c index 03c7eeab..86312823 100644 --- a/src/matrixOperations/division/sldivma.c +++ b/src/matrixOperations/division/sldivma.c @@ -10,7 +10,7 @@ * */ - +#include #include "matrixDivision.h" #include "lapack.h" #include diff --git a/src/matrixOperations/division/srdivma.c b/src/matrixOperations/division/srdivma.c index f1706ccd..b5773870 100644 --- a/src/matrixOperations/division/srdivma.c +++ b/src/matrixOperations/division/srdivma.c @@ -9,7 +9,7 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ - +#include /****FIXME****/ /**** WARNING NOT WORK AT ALL FOR THE MOMENT ***/ /**** Because of problem of conversion float-> double ****/ diff --git a/src/matrixOperations/division/zldivma.c b/src/matrixOperations/division/zldivma.c index c09a859e..9f58311f 100644 --- a/src/matrixOperations/division/zldivma.c +++ b/src/matrixOperations/division/zldivma.c @@ -11,9 +11,10 @@ * */ - +#include #include "matrixDivision.h" #include "string.h" +#include "lapack.h" void zldivma( doubleComplex* in1, int lines1, int columns1 , doubleComplex* in2, int lines2, int columns2 , @@ -71,6 +72,7 @@ void zldivma( doubleComplex* in1, int lines1, int columns1 , { cNorm = 'F'; C2F(zlacpy)(&cNorm, &columns1, &columns1, in1, &columns1, pAf, &columns1); + C2F(zlacpy)(&cNorm, &columns1, &columns2, in2, &columns1, pXb, &columns1); C2F(zgetrf)(&columns1, &columns1, pAf, &columns1, pIpiv, &iInfo); if(iInfo == 0) @@ -99,6 +101,7 @@ void zldivma( doubleComplex* in1, int lines1, int columns1 , memset(pJpvt, 0x00,(unsigned int) sizeof(int) * (unsigned int)columns1); C2F(zgelsy)( &lines1, &columns1, &columns2, in1, &lines1, pXb, &iMax, pJpvt, &dblRcond, &iRank, pDwork, &iWork, pRwork, &iInfo); + if(iInfo == 0) { diff --git a/src/matrixOperations/division/zrdivma.c b/src/matrixOperations/division/zrdivma.c index ae51dd7a..bb684baa 100644 --- a/src/matrixOperations/division/zrdivma.c +++ b/src/matrixOperations/division/zrdivma.c @@ -9,7 +9,7 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ - +#include #include "matrixDivision.h" #include diff --git a/src/matrixOperations/hilbert/dhilba.c b/src/matrixOperations/hilbert/dhilba.c index 10e9bc65..6c47227f 100644 --- a/src/matrixOperations/hilbert/dhilba.c +++ b/src/matrixOperations/hilbert/dhilba.c @@ -22,7 +22,7 @@ void dhilba ( double* out, int size ){ for(iIndex1 = 0 ; iIndex1 < size ; iIndex1++) { if(iIndex1 != 0) - dblVal = ((size - iIndex1) * dblVal * (size + iIndex1)) / pow(iIndex1,2); + dblVal = ((size - iIndex1) * dblVal * (size + iIndex1)) / pow((double)iIndex1,2); dblTemp = dblVal * dblVal; @@ -33,7 +33,7 @@ void dhilba ( double* out, int size ){ for(iIndex2 = iIndex1 + 1 ; iIndex2 < size ; iIndex2++) { - dblTemp = -((size - iIndex2) * dblTemp * (size + iIndex2)) / pow(iIndex2,2); + dblTemp = -((size - iIndex2) * dblTemp * (size + iIndex2)) / pow((double)iIndex2,2); out[iIndex1 * size + iIndex2] = dblTemp / (iIndex1 + iIndex2 + 1); out[iIndex2 * size + iIndex1] = out[iIndex1 * size + iIndex2]; } diff --git a/src/matrixOperations/hilbert/shilba.c b/src/matrixOperations/hilbert/shilba.c index 5d0a0d36..bd3b5ee5 100644 --- a/src/matrixOperations/hilbert/shilba.c +++ b/src/matrixOperations/hilbert/shilba.c @@ -23,7 +23,7 @@ void shilba ( float* out, int size ){ for(iIndex1 = 0 ; iIndex1 < size ; iIndex1++) { if(iIndex1 != 0) - dblVal = ((float)(size - iIndex1) * dblVal * (float)(size + iIndex1)) /(float) pow(iIndex1,2); + dblVal = ((float)(size - iIndex1) * dblVal * (float)(size + iIndex1)) /(float) pow((double)iIndex1,2); dblTemp = dblVal * dblVal; @@ -34,7 +34,7 @@ void shilba ( float* out, int size ){ for(iIndex2 = iIndex1 + 1 ; iIndex2 < size ; iIndex2++) { - dblTemp = -((float)(size - iIndex2) * dblTemp *(float) (size + iIndex2)) /(float) pow(iIndex2,2); + dblTemp = -((float)(size - iIndex2) * dblTemp *(float) (size + iIndex2)) /(float) pow((double)iIndex2,2); out[iIndex1 * size + iIndex2] = dblTemp /(float) (iIndex1 + iIndex2 + 1); out[iIndex2 * size + iIndex1] = out[iIndex1 * size + iIndex2]; } diff --git a/src/matrixOperations/includes/cat.h b/src/matrixOperations/includes/cat.h index a28f004c..9f64a157 100644 --- a/src/matrixOperations/includes/cat.h +++ b/src/matrixOperations/includes/cat.h @@ -13,32 +13,38 @@ #ifndef __CAT_H__ #define __CAT_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* ** \brief concat 2 floats scalars */ -void srowcats(float in1, float in2, float *out); -void scolumncats(float in1, float in2, float *out); +EXTERN_MATOPS void srowcats(float in1, float in2, float *out); +EXTERN_MATOPS void scolumncats(float in1, float in2, float *out); /* ** \brief concat 2 double scalars */ -void drowcats(double in1, double in2, double *out); -void dcolumncats(double in1, double in2, double *out); +EXTERN_MATOPS void drowcats(double in1, double in2, double *out); +EXTERN_MATOPS void dcolumncats(double in1, double in2, double *out); /* ** \brief concat 2 floats complex scalars */ -void crowcats(floatComplex in1, floatComplex in2, floatComplex *out); -void ccolumncats(floatComplex in1, floatComplex in2, floatComplex *out); +EXTERN_MATOPS void crowcats(floatComplex in1, floatComplex in2, floatComplex *out); +EXTERN_MATOPS void ccolumncats(floatComplex in1, floatComplex in2, floatComplex *out); /* ** \brief concat 2 double complex scalars */ -void zrowcats(doubleComplex in1, doubleComplex in2, doubleComplex *out); -void zcolumncats(doubleComplex in1, doubleComplex in2, doubleComplex *out); +EXTERN_MATOPS void zrowcats(doubleComplex in1, doubleComplex in2, doubleComplex *out); +EXTERN_MATOPS void zcolumncats(doubleComplex in1, doubleComplex in2, doubleComplex *out); /* ** \brief Concat float arrays @@ -50,8 +56,8 @@ void zcolumncats(doubleComplex in1, doubleComplex in2, doubleComplex *out); ** \param columns2 ** \param out the concatenation */ -void srowcata(float *in1, int lines1, int columns1, float *in2, int lines2, int columns2, float* out); -void scolumncata(float *in1, int lines1, int columns1, float *in2, int lines2, int columns2, float* out); +EXTERN_MATOPS void srowcata(float *in1, int lines1, int columns1, float *in2, int lines2, int columns2, float* out); +EXTERN_MATOPS void scolumncata(float *in1, int lines1, int columns1, float *in2, int lines2, int columns2, float* out); /* ** \brief Concat double arrays @@ -63,8 +69,8 @@ void scolumncata(float *in1, int lines1, int columns1, float *in2, int lines2, ** \param columns2 ** \param out the concatenation */ -void drowcata(double *in1, int lines1, int columns1, double *in2, int lines2, int columns2, double* out); -void dcolumncata(double *in1, int lines1, int columns1, double *in2, int lines2, int columns2, double* out); +EXTERN_MATOPS void drowcata(double *in1, int lines1, int columns1, double *in2, int lines2, int columns2, double* out); +EXTERN_MATOPS void dcolumncata(double *in1, int lines1, int columns1, double *in2, int lines2, int columns2, double* out); /* ** \brief Concat Complex float arrays @@ -76,8 +82,8 @@ void dcolumncata(double *in1, int lines1, int columns1, double *in2, int lines2 ** \param columns2 ** \param out the concatenation */ -void crowcata(floatComplex *in1, int lines1, int columns1, floatComplex *in2, int lines2, int columns2, floatComplex* out); -void ccolumncata(floatComplex *in1, int lines1, int columns1, floatComplex *in2, int lines2, int columns2, floatComplex* out); +EXTERN_MATOPS void crowcata(floatComplex *in1, int lines1, int columns1, floatComplex *in2, int lines2, int columns2, floatComplex* out); +EXTERN_MATOPS void ccolumncata(floatComplex *in1, int lines1, int columns1, floatComplex *in2, int lines2, int columns2, floatComplex* out); /* ** \brief Concat Complex double arrays @@ -89,7 +95,11 @@ void ccolumncata(floatComplex *in1, int lines1, int columns1, floatComplex *in2 ** \param columns2 ** \param out the concatenation */ -void zrowcata(doubleComplex *in1, int lines1, int columns1, doubleComplex *in2, int lines2, int columns2, doubleComplex* out); -void zcolumncata(doubleComplex *in1, int lines1, int columns1, doubleComplex *in2, int lines2, int columns2, doubleComplex* out); +EXTERN_MATOPS void zrowcata(doubleComplex *in1, int lines1, int columns1, doubleComplex *in2, int lines2, int columns2, doubleComplex* out); +EXTERN_MATOPS void zcolumncata(doubleComplex *in1, int lines1, int columns1, doubleComplex *in2, int lines2, int columns2, doubleComplex* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__CAT_H__ */ diff --git a/src/matrixOperations/includes/chol.h b/src/matrixOperations/includes/chol.h index 4b2655fc..0a17406d 100644 --- a/src/matrixOperations/includes/chol.h +++ b/src/matrixOperations/includes/chol.h @@ -14,24 +14,30 @@ #ifndef __CHOL_H__ #define __CHOL_H__ +#include "dynlib_matrixoperations.h" #include "doubleComplex.h" #include "floatComplex.h" - +#ifdef __cplusplus +extern "C" { +#endif -double dchols(double in); -void dchola(double *in, int size, double *out); +EXTERN_MATOPS double dchols(double in); +EXTERN_MATOPS void dchola(double *in, int size, double *out); -float schols(float in); -void schola(float *in, int size, float *out); +EXTERN_MATOPS float schols(float in); +EXTERN_MATOPS void schola(float *in, int size, float *out); #define zchols(in) DoubleComplex(dchols(zreals(in)),0) -void zchola (doubleComplex *in, int size, doubleComplex *out); +EXTERN_MATOPS void zchola (doubleComplex *in, int size, doubleComplex *out); #define cchols(in) FloatComplex(schols(creals(in)),0) -void cchola(floatComplex *in, int size, floatComplex *out); +EXTERN_MATOPS void cchola(floatComplex *in, int size, floatComplex *out); +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* __CHOL_H__ */ diff --git a/src/matrixOperations/includes/determ.h b/src/matrixOperations/includes/determ.h index e9276a70..d915c31b 100644 --- a/src/matrixOperations/includes/determ.h +++ b/src/matrixOperations/includes/determ.h @@ -13,21 +13,27 @@ #ifndef __DETERM_H__ #define __DETERM_H__ - + +#include "dynlib_matrixoperations.h" #include "doubleComplex.h" #include "floatComplex.h" - +#ifdef __cplusplus +extern "C" { +#endif -double ddeterma (double *in, int rows); +EXTERN_MATOPS double ddeterma (double *in, int rows); -float sdeterma (float *in, int rows); +EXTERN_MATOPS float sdeterma (float *in, int rows); -doubleComplex zdeterma (doubleComplex *in, int rows); +EXTERN_MATOPS doubleComplex zdeterma (doubleComplex *in, int rows); -floatComplex cdeterma (floatComplex *in, int rows); +EXTERN_MATOPS floatComplex cdeterma (floatComplex *in, int rows); +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* __DETERM_H__ */ diff --git a/src/matrixOperations/includes/dist.h b/src/matrixOperations/includes/dist.h index d4e9994a..bf45a8d7 100644 --- a/src/matrixOperations/includes/dist.h +++ b/src/matrixOperations/includes/dist.h @@ -16,25 +16,33 @@ #ifndef __DIST_H__ #define __DIST_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" +#ifdef __cplusplus +extern "C" { +#endif /* Computes the euclidian distance between 2 scalars/arrays. We assume both arrays have the same numbers of lines and columns.*/ -float sdists( float in1, float in2); -float sdista( float* in1, float* in2, int lines, int columns); +EXTERN_MATOPS float sdists( float in1, float in2); +EXTERN_MATOPS float sdista( float* in1, float* in2, int lines, int columns); -double ddists( double in1, double in2); -double ddista( double* in1, double* in2, int lines, int columns); +EXTERN_MATOPS double ddists( double in1, double in2); +EXTERN_MATOPS double ddista( double* in1, double* in2, int lines, int columns); -float cdists( floatComplex in1, floatComplex in2); -float cdista( floatComplex* in1, floatComplex* in2, int lines, int columns); +EXTERN_MATOPS float cdists( floatComplex in1, floatComplex in2); +EXTERN_MATOPS float cdista( floatComplex* in1, floatComplex* in2, int lines, int columns); -double zdists( doubleComplex in1, doubleComplex in2); -double zdista( doubleComplex* in1, doubleComplex* in2, int lines, int columns); +EXTERN_MATOPS double zdists( doubleComplex in1, doubleComplex in2); +EXTERN_MATOPS double zdista( doubleComplex* in1, doubleComplex* in2, int lines, int columns); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /*__DIST_H__*/ diff --git a/src/matrixOperations/includes/dynlib_matrixoperations.h b/src/matrixOperations/includes/dynlib_matrixoperations.h new file mode 100644 index 00000000..b17cad84 --- /dev/null +++ b/src/matrixOperations/includes/dynlib_matrixoperations.h @@ -0,0 +1,26 @@ +/* +* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +* Copyright (C) 2009 - DIGITEO - Allan CORNET +* +* This file must be used under the terms of the CeCILL. +* This source file is licensed as described in the file COPYING, which +* you should have received as part of this distribution. The terms +* are also available at +* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +* +*/ + +#ifndef __DYNLIB_MATRIXOPERATIONS_H__ +#define __DYNLIB_MATRIXOPERATIONS_H__ + +#ifdef _MSC_VER + #if MATRIXOPERATIONS_EXPORTS + #define EXTERN_MATOPS __declspec (dllexport) + #else + #define EXTERN_MATOPS __declspec (dllimport) + #endif +#else + #define EXTERN_MATOPS +#endif + +#endif /* __DYNLIB_MATRIXOPERATIONS_H__ */ \ No newline at end of file diff --git a/src/matrixOperations/includes/eye.h b/src/matrixOperations/includes/eye.h index 9d78f590..f7f2ef2f 100644 --- a/src/matrixOperations/includes/eye.h +++ b/src/matrixOperations/includes/eye.h @@ -13,9 +13,14 @@ #ifndef __EYE_H__ #define __EYE_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" +#ifdef __cplusplus +extern "C" { +#endif + /* ** \brief create a float Eye value */ @@ -39,22 +44,26 @@ /* ** \brief create a float Eye matrix */ -void seyea(float* in, int _iRows, int _iCols); +EXTERN_MATOPS void seyea(float* in, int _iRows, int _iCols); /* ** \brief create a Double Eye matrix */ -void deyea(double* in, int _iRows, int _iCols); +EXTERN_MATOPS void deyea(double* in, int _iRows, int _iCols); /* ** \brief create a float complex Eye matrix */ -void ceyea(floatComplex* in, int _iRows, int _iCols); +EXTERN_MATOPS void ceyea(floatComplex* in, int _iRows, int _iCols); /* ** \brief create a Double complex Eye matrix */ -void zeyea(doubleComplex* in, int _iRows, int _iCols); +EXTERN_MATOPS void zeyea(doubleComplex* in, int _iRows, int _iCols); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__EYE_H__ */ diff --git a/src/matrixOperations/includes/fill.h b/src/matrixOperations/includes/fill.h index b69e14d1..09b8d811 100644 --- a/src/matrixOperations/includes/fill.h +++ b/src/matrixOperations/includes/fill.h @@ -14,19 +14,26 @@ #ifndef __FILL_H__ #define __FILL_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" - +#ifdef __cplusplus +extern "C" { +#endif /*filling of a array with constant*/ -void dfilla (double* in, int rows, int cols, double constant); +EXTERN_MATOPS void dfilla (double* in, int rows, int cols, double constant); + +EXTERN_MATOPS void sfilla (float* in, int rows, int cols, float constant); -void sfilla (float* in, int rows, int cols, float constant); +EXTERN_MATOPS void cfilla (floatComplex* in, int rows, int cols, floatComplex constant); -void cfilla (floatComplex* in, int rows, int cols, floatComplex constant); +EXTERN_MATOPS void zfilla (doubleComplex* in, int rows, int cols, doubleComplex constant); -void zfilla (doubleComplex* in, int rows, int cols, doubleComplex constant); +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* __FILL_H__ */ diff --git a/src/matrixOperations/includes/hilbert.h b/src/matrixOperations/includes/hilbert.h index 11c4f6bd..15f233fe 100644 --- a/src/matrixOperations/includes/hilbert.h +++ b/src/matrixOperations/includes/hilbert.h @@ -13,16 +13,21 @@ #ifndef __HILBERT_H__ #define __HILBERT_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" #include + +#ifdef __cplusplus +extern "C" { +#endif /* ** generate an Hilbert's matrix ** param out : the hilbert's matrix in float precision ** param size: matrix's size */ -void shilba ( float* out, int size) ; +EXTERN_MATOPS void shilba ( float* out, int size) ; /* ** generate an Hilbert's matrix @@ -31,7 +36,11 @@ void shilba ( float* out, int size) ; */ -void dhilba ( double* out, int size ) ; +EXTERN_MATOPS void dhilba ( double* out, int size ) ; + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__HILBERT_H__ */ diff --git a/src/matrixOperations/includes/infiniteNorm.h b/src/matrixOperations/includes/infiniteNorm.h index 0a0d3382..130cfeaf 100644 --- a/src/matrixOperations/includes/infiniteNorm.h +++ b/src/matrixOperations/includes/infiniteNorm.h @@ -13,11 +13,16 @@ #ifndef __INFINITENORM_H__ #define __INFINITENORM_H__ +#include "dynlib_matrixoperations.h" #include "sign.h" #include "pythag.h" #include "floatComplex.h" #include "doubleComplex.h" +#ifdef __cplusplus +extern "C" { +#endif + /* ** \brief Compute the infinite norm of a given floats matrix. ** \param in : input matrix. @@ -25,7 +30,7 @@ ** \param _iCols : number of columns of the matrix . */ -float sinfnorma(float* in, int _iRows, int _iCols); +EXTERN_MATOPS float sinfnorma(float* in, int _iRows, int _iCols); /* ** \brief Compute the infinite norm of a given doubles matrix. @@ -34,7 +39,7 @@ float sinfnorma(float* in, int _iRows, int _iCols); ** \param out : the matrix inverse of the input . */ -double dinfnorma(double* in, int _iRows, int _iCols); +EXTERN_MATOPS double dinfnorma(double* in, int _iRows, int _iCols); /* ** \brief Compute the infinite norm of a given complex floats matrix. @@ -43,7 +48,7 @@ double dinfnorma(double* in, int _iRows, int _iCols); ** \param _iCols : number of columns of the matrix . */ -float cinfnorma(floatComplex* in, int _iRows, int _iCols); +EXTERN_MATOPS float cinfnorma(floatComplex* in, int _iRows, int _iCols); /* ** \brief Compute the infinite norm of a given complex doubles matrix. @@ -52,9 +57,11 @@ float cinfnorma(floatComplex* in, int _iRows, int _iCols); ** \param _iCols : number of columns of the matrix . */ -double zinfnorma(doubleComplex* in, int _iRows, int _iCols); - +EXTERN_MATOPS double zinfnorma(doubleComplex* in, int _iRows, int _iCols); +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__INFINITENORM_H__ */ diff --git a/src/matrixOperations/includes/jmat.h b/src/matrixOperations/includes/jmat.h index b6b0388a..38a8b1e2 100644 --- a/src/matrixOperations/includes/jmat.h +++ b/src/matrixOperations/includes/jmat.h @@ -13,7 +13,17 @@ #ifndef __JMAT_H__ #define __JMAT_H__ -void sjmata(float in1, float in2, float* out); -void djmata(double in1, double in2, double* out); +#include "dynlib_matrixoperations.h" + +#ifdef __cplusplus +extern "C" { +#endif + +EXTERN_MATOPS void sjmata(float in1, float in2, float* out); +EXTERN_MATOPS void djmata(double in1, double in2, double* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__JMAT_H__ */ diff --git a/src/matrixOperations/includes/logm.h b/src/matrixOperations/includes/logm.h index 27513d82..7eec569d 100644 --- a/src/matrixOperations/includes/logm.h +++ b/src/matrixOperations/includes/logm.h @@ -14,15 +14,24 @@ #ifndef __LOGM_H__ #define __LOGM_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" -void slogma (float* in, int size, float* out); +#ifdef __cplusplus +extern "C" { +#endif -void dlogma (double* in, int size, double* out); +EXTERN_MATOPS void slogma (float* in, int size, float* out); -void clogma (floatComplex* in, int size, floatComplex* out); +EXTERN_MATOPS void dlogma (double* in, int size, double* out); -void zlogma (doubleComplex* in, int size, doubleComplex* out); +EXTERN_MATOPS void clogma (floatComplex* in, int size, floatComplex* out); + +EXTERN_MATOPS void zlogma (doubleComplex* in, int size, doubleComplex* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* __LOGM_H__ */ diff --git a/src/matrixOperations/includes/matrixDivision.h b/src/matrixOperations/includes/matrixDivision.h index 55006c54..9ea86d96 100644 --- a/src/matrixOperations/includes/matrixDivision.h +++ b/src/matrixOperations/includes/matrixDivision.h @@ -13,6 +13,7 @@ #ifndef __MATRIXDIVISION_H__ #define __MATRIXDIVISION_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" #include "lapack.h" @@ -23,40 +24,46 @@ #include "max.h" -void srdivma ( float* in1, int lines1, int columns1 , +#ifdef __cplusplus +extern "C" { +#endif + +EXTERN_MATOPS void srdivma ( float* in1, int lines1, int columns1 , float* in2, int lines2, int columns2 , float* out ); -void sldivma ( float* in1, int lines1, int columns1 , +EXTERN_MATOPS void sldivma ( float* in1, int lines1, int columns1 , float* in2, int lines2, int columns2 , float* out ); -void drdivma ( double* in1, int lines1, int columns1 , +EXTERN_MATOPS void drdivma ( double* in1, int lines1, int columns1 , double* in2, int lines2, int columns2 , double* out ); -void dldivma ( double* in1, int lines1, int columns1 , +EXTERN_MATOPS void dldivma ( double* in1, int lines1, int columns1 , double* in2, int lines2, int columns2 , double* out ); -void zrdivma( doubleComplex* in1, int lines1, int columns1 , +EXTERN_MATOPS void zrdivma( doubleComplex* in1, int lines1, int columns1 , doubleComplex* in2, int lines2, int columns2 , doubleComplex* out ); -void zldivma( doubleComplex* in1, int lines1, int columns1 , +EXTERN_MATOPS void zldivma( doubleComplex* in1, int lines1, int columns1 , doubleComplex* in2, int lines2, int columns2 , doubleComplex* out ); -void crdivma( floatComplex* in1, int lines1, int columns1 , +EXTERN_MATOPS void crdivma( floatComplex* in1, int lines1, int columns1 , floatComplex* in2, int lines2, int columns2 , floatComplex* out ); -void cldivma( floatComplex* in1, int lines1, int columns1 , +EXTERN_MATOPS void cldivma( floatComplex* in1, int lines1, int columns1 , floatComplex* in2, int lines2, int columns2 , floatComplex* out ); - +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__MATRIXDIVISION_H__ */ diff --git a/src/matrixOperations/includes/matrixExponential.h b/src/matrixOperations/includes/matrixExponential.h index 0626bf17..4b3cd8a0 100644 --- a/src/matrixOperations/includes/matrixExponential.h +++ b/src/matrixOperations/includes/matrixExponential.h @@ -15,6 +15,7 @@ #include #include +#include "dynlib_matrixoperations.h" #include "lapack.h" #include "blas.h" #include "abs.h" @@ -30,14 +31,21 @@ #include "frexp.h" #include "division.h" -void sexpma (float* in, float* out, int _iLeadDim); +#ifdef __cplusplus +extern "C" { +#endif -void dexpma (double* in, double* out, int _iLeadDim); +EXTERN_MATOPS void sexpma (float* in, float* out, int _iLeadDim); -void cexpma(floatComplex * in, floatComplex * out, int _iLeadDim); +EXTERN_MATOPS void dexpma (double* in, double* out, int _iLeadDim); -void zexpma (doubleComplex * in, doubleComplex * out, int _iLeadDim); +EXTERN_MATOPS void cexpma(floatComplex * in, floatComplex * out, int _iLeadDim); +EXTERN_MATOPS void zexpma (doubleComplex * in, doubleComplex * out, int _iLeadDim); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__MATRIXEXPONENTIAL_H__ */ diff --git a/src/matrixOperations/includes/matrixInversion.h b/src/matrixOperations/includes/matrixInversion.h index b1de5392..90312459 100644 --- a/src/matrixOperations/includes/matrixInversion.h +++ b/src/matrixOperations/includes/matrixInversion.h @@ -15,7 +15,11 @@ #define __MATRIXINVERSION_H__ #include "abs.h" +#include "dynlib_matrixoperations.h" +#ifdef __cplusplus +extern "C" { +#endif /* ** \brief Compute the matrix inverse for floats. ** \param in : input matrix. @@ -23,7 +27,7 @@ ** \param out : the matrix inverse of the input . */ -void sinverma ( float* in, float* out, int leadDimIn ); +EXTERN_MATOPS void sinverma ( float* in, float* out, int leadDimIn ); /* ** \brief Compute the matrix inverse for doubles. @@ -33,7 +37,7 @@ void sinverma ( float* in, float* out, int leadDimIn ); */ -void dinverma ( double* in, double* out, int leadDimIn ); +EXTERN_MATOPS void dinverma ( double* in, double* out, int leadDimIn ); /* ** \brief Compute the matrix inverse for complex floats . @@ -43,7 +47,7 @@ void dinverma ( double* in, double* out, int leadDimIn ); */ -void cinverma ( floatComplex* in, floatComplex* out, int leadDimIn ); +EXTERN_MATOPS void cinverma ( floatComplex* in, floatComplex* out, int leadDimIn ); /* ** \brief Compute the matrix inverse for complex doubles. @@ -53,7 +57,10 @@ void cinverma ( floatComplex* in, floatComplex* out, int leadDimIn ); */ -void zinverma ( doubleComplex* in, doubleComplex* out, int leadDimIn ); +EXTERN_MATOPS void zinverma ( doubleComplex* in, doubleComplex* out, int leadDimIn ); +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__MATRIXINVERSION_H__ */ diff --git a/src/matrixOperations/includes/matrixMagnitude.h b/src/matrixOperations/includes/matrixMagnitude.h index 9d9a4f89..7b65c6d9 100644 --- a/src/matrixOperations/includes/matrixMagnitude.h +++ b/src/matrixOperations/includes/matrixMagnitude.h @@ -14,19 +14,28 @@ #ifndef __MAGNITUDE_H__ #define __MAGNITUDE_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" -float smagns(float in); -float smagna(float* in, int rows, int cols); +#ifdef __cplusplus +extern "C" { +#endif -double dmagns(double in); -double dmagna(double* in, int rows, int cols); +EXTERN_MATOPS float smagns(float in); +EXTERN_MATOPS float smagna(float* in, int rows, int cols); -float cmagns(floatComplex in); -float cmagna(floatComplex* in, int rows, int cols); +EXTERN_MATOPS double dmagns(double in); +EXTERN_MATOPS double dmagna(double* in, int rows, int cols); -double zmagns(doubleComplex in); -double zmagna(doubleComplex* in, int rows, int cols); +EXTERN_MATOPS float cmagns(floatComplex in); +EXTERN_MATOPS float cmagna(floatComplex* in, int rows, int cols); + +EXTERN_MATOPS double zmagns(doubleComplex in); +EXTERN_MATOPS double zmagna(doubleComplex* in, int rows, int cols); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* __MAGNITUDE_H__*/ diff --git a/src/matrixOperations/includes/matrixMultiplication.h b/src/matrixOperations/includes/matrixMultiplication.h index 99091a7e..228dd163 100644 --- a/src/matrixOperations/includes/matrixMultiplication.h +++ b/src/matrixOperations/includes/matrixMultiplication.h @@ -13,9 +13,14 @@ #ifndef __MATRIXMULTIPLICATION_H__ #define __MATRIXMULTIPLICATION_H__ +#include "dynlib_matrixoperations.h" #include "multiplication.h" #include "addition.h" +#ifdef __cplusplus +extern "C" { +#endif + /* ** ** WARNING WE ASSUME MATRIXES TO BE CONSCISTENT @@ -33,7 +38,7 @@ ** \param columns2 : columns of in2 matrix. ** \param out : Matrix that contains the multiplication in1 * in2. */ -void smulma(float *in1, int lines1, int columns1, +EXTERN_MATOPS void smulma(float *in1, int lines1, int columns1, float *in2, int lines2, int columns2, float *out); @@ -47,7 +52,7 @@ void smulma(float *in1, int lines1, int columns1, ** \param columns2 : columns of in2 matrix. ** \param out : Matrix that contains the multiplication in1 * in2. */ -void dmulma(double *in1, int lines1, int columns1, +EXTERN_MATOPS void dmulma(double *in1, int lines1, int columns1, double *in2, int lines2, int columns2, double *out); @@ -61,7 +66,7 @@ void dmulma(double *in1, int lines1, int columns1, ** \param columns2 : columns of in2 matrix. ** \param out : Matrix that contains the multiplication in1 * in2. */ -void cmulma(floatComplex *in1, int lines1, int columns1, +EXTERN_MATOPS void cmulma(floatComplex *in1, int lines1, int columns1, floatComplex *in2, int lines2, int columns2, floatComplex *out); @@ -75,8 +80,12 @@ void cmulma(floatComplex *in1, int lines1, int columns1, ** \param columns2 : columns of in2 matrix. ** \param out : Matrix that contains the multiplication in1 * in2. */ -void zmulma(doubleComplex *in1, int lines1, int columns1, +EXTERN_MATOPS void zmulma(doubleComplex *in1, int lines1, int columns1, doubleComplex *in2, int lines2, int columns2, doubleComplex *out); +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* !__MATRIXMULTIPLICATION_H__ */ diff --git a/src/matrixOperations/includes/matrixPow.h b/src/matrixOperations/includes/matrixPow.h index d9d5684b..d7ffab31 100644 --- a/src/matrixOperations/includes/matrixPow.h +++ b/src/matrixOperations/includes/matrixPow.h @@ -14,22 +14,29 @@ #ifndef __MATRIXPOW_H__ #define __MATRIXPOW_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" +#ifdef __cplusplus +extern "C" { +#endif + /* powm is only working on square matrix so the size is limited to rows */ -void spowma(float* in, int rows, float expand, float* out); - -void dpowma(double* in, int rows, double expand, double* out); +EXTERN_MATOPS void spowma(float* in, int rows, float expand, float* out); -void cpowma(floatComplex* in, int rows, floatComplex expand, floatComplex* out); +EXTERN_MATOPS void dpowma(double* in, int rows, double expand, double* out); -void zpowma(doubleComplex* in, int rows, doubleComplex expand, doubleComplex* out); +EXTERN_MATOPS void cpowma(floatComplex* in, int rows, floatComplex expand, floatComplex* out); +EXTERN_MATOPS void zpowma(doubleComplex* in, int rows, doubleComplex expand, doubleComplex* out); +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/src/matrixOperations/includes/matrixSquaredMagnitude.h b/src/matrixOperations/includes/matrixSquaredMagnitude.h index a50d9b22..9ee64c32 100644 --- a/src/matrixOperations/includes/matrixSquaredMagnitude.h +++ b/src/matrixOperations/includes/matrixSquaredMagnitude.h @@ -14,19 +14,28 @@ #ifndef __SQUAREDMAGNITUDE_H__ #define __SQUAREDMAGNITUDE_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" -float ssquMagns(float in); -float ssquMagna(float* in, int rows, int cols); +#ifdef __cplusplus +extern "C" { +#endif -double dsquMagns(double in); -double dsquMagna(double* in, int rows, int cols); +EXTERN_MATOPS float ssquMagns(float in); +EXTERN_MATOPS float ssquMagna(float* in, int rows, int cols); -float csquMagns(floatComplex in); -float csquMagna(floatComplex* in, int rows, int cols); +EXTERN_MATOPS double dsquMagns(double in); +EXTERN_MATOPS double dsquMagna(double* in, int rows, int cols); -double zsquMagns(doubleComplex in); -double zsquMagna(doubleComplex* in, int rows, int cols); +EXTERN_MATOPS float csquMagns(floatComplex in); +EXTERN_MATOPS float csquMagna(floatComplex* in, int rows, int cols); + +EXTERN_MATOPS double zsquMagns(doubleComplex in); +EXTERN_MATOPS double zsquMagna(doubleComplex* in, int rows, int cols); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* __SQUAREDMAGNITUDE_H__*/ diff --git a/src/matrixOperations/includes/matrixTrace.h b/src/matrixOperations/includes/matrixTrace.h index cdab74d1..76b77454 100644 --- a/src/matrixOperations/includes/matrixTrace.h +++ b/src/matrixOperations/includes/matrixTrace.h @@ -13,9 +13,13 @@ #ifndef __MATRICXTRACE_H__ #define __MATRICXTRACE_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" +#ifdef __cplusplus +extern "C" { +#endif /* ** @@ -31,7 +35,7 @@ ** \param out : float scalar containing the trace. */ -float stracea ( float* in ,int lines ) ; +EXTERN_MATOPS float stracea ( float* in ,int lines ) ; /* @@ -40,7 +44,7 @@ float stracea ( float* in ,int lines ) ; ** \param lines : number of lines ** \param out : double scalar containing the trace. */ -double dtracea ( double* in ,int lines ) ; +EXTERN_MATOPS double dtracea ( double* in ,int lines ) ; /* ** \brief Compute the trace of a float complex matrix. @@ -48,7 +52,7 @@ double dtracea ( double* in ,int lines ) ; ** \param lines : number of lines ** \param out : float complex containing the trace. */ -floatComplex ctracea ( floatComplex* in ,int lines ) ; +EXTERN_MATOPS floatComplex ctracea ( floatComplex* in ,int lines ) ; /* @@ -57,6 +61,10 @@ floatComplex ctracea ( floatComplex* in ,int lines ) ; ** \param lines : number of lines ** \param out : double complex containing the trace. */ -doubleComplex ztracea ( doubleComplex* in ,int lines ) ; +EXTERN_MATOPS doubleComplex ztracea ( doubleComplex* in ,int lines ) ; + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__MATRICXTRACE_H__ */ diff --git a/src/matrixOperations/includes/matrixTranspose.h b/src/matrixOperations/includes/matrixTranspose.h index 429e8303..122b618d 100644 --- a/src/matrixOperations/includes/matrixTranspose.h +++ b/src/matrixOperations/includes/matrixTranspose.h @@ -13,9 +13,14 @@ #ifndef __MATRIXTRANSPOSE_H__ #define __MATRIXTRANSPOSE_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" #include + +#ifdef __cplusplus +extern "C" { +#endif /* ** \brief Compute the transpose of a float matrix. ** \param in : input matrix. @@ -23,7 +28,7 @@ ** \param column1 : number of column1 ** \param out : the transposed float matrix. */ -void stransposea ( float* in , int lines1 , int column1, float* out ); +EXTERN_MATOPS void stransposea ( float* in , int lines1 , int column1, float* out ); /* ** \brief Compute the transpose of a double matrix. ** \param in : input matrix. @@ -31,7 +36,7 @@ void stransposea ( float* in , int lines1 , int column1, float* out ); ** \param column1 : number of column1 ** \param out : the transposed double matrix. */ -void dtransposea ( double* in , int lines1 , int column1, double* out ); +EXTERN_MATOPS void dtransposea ( double* in , int lines1 , int column1, double* out ); /* ** \brief Compute the transpose of a float complex matrix. ** \param in : input matrix. @@ -39,7 +44,7 @@ void dtransposea ( double* in , int lines1 , int column1, double* out ); ** \param column1 : number of column1 ** \param out : the transposed float complex matrix. */ -void ctransposea ( floatComplex* in , int lines1 , int column1, floatComplex* out ); +EXTERN_MATOPS void ctransposea ( floatComplex* in , int lines1 , int column1, floatComplex* out ); /* ** \brief Compute the transpose of a double complex matrix. ** \param in : input matrix. @@ -47,6 +52,10 @@ void ctransposea ( floatComplex* in , int lines1 , int column1, floatComplex* ou ** \param column1 : number of column1 ** \param out : the transposed double complex matrix. */ -void ztransposea ( doubleComplex* in , int lines1 , int column1, doubleComplex* out ); +EXTERN_MATOPS void ztransposea ( doubleComplex* in , int lines1 , int column1, doubleComplex* out ); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__MATRIXTRANSPOSE_H__ */ diff --git a/src/matrixOperations/includes/ones.h b/src/matrixOperations/includes/ones.h index d32f9a7e..63d8bd4b 100644 --- a/src/matrixOperations/includes/ones.h +++ b/src/matrixOperations/includes/ones.h @@ -14,9 +14,15 @@ #ifndef __ONES_H__ #define __ONES_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + /* ** \brief create a float one value */ @@ -42,18 +48,22 @@ /* ** \brief create a float matrix full of one */ -void sonesa ( float* in , int rows , int cols ); +EXTERN_MATOPS void sonesa ( float* in , int rows , int cols ); /* ** \brief create a float complex matrix full of one */ -void conesa ( floatComplex* in , int rows ,int cols ); +EXTERN_MATOPS void conesa ( floatComplex* in , int rows ,int cols ); /* ** \brief create a double matrix full of one */ -void donesa ( double* in , int rows ,int cols ); +EXTERN_MATOPS void donesa ( double* in , int rows ,int cols ); /* ** \brief create a double complex matrix full of one */ -void zonesa ( doubleComplex* in , int rows ,int cols ); +EXTERN_MATOPS void zonesa ( doubleComplex* in , int rows ,int cols ); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__ONES_H__ */ diff --git a/src/matrixOperations/includes/spec.h b/src/matrixOperations/includes/spec.h index ab12a6ba..b7b7d35c 100644 --- a/src/matrixOperations/includes/spec.h +++ b/src/matrixOperations/includes/spec.h @@ -14,9 +14,14 @@ #ifndef __SPEC_H__ #define __SPEC_H__ +#include "dynlib_matrixoperations.h" #include "doubleComplex.h" #include "floatComplex.h" +#ifdef __cplusplus +extern "C" { +#endif + /* spec gives only the eigenvalues If you want the eigenvalues and the eigenvectors, use spec2 */ @@ -26,10 +31,10 @@ #define cspecs(in) in #define zspecs(in) in -void sspeca(float* in, int rows, float* out); -void dspeca(double* in, int rows, double* out); -void cspeca(floatComplex* in, int rows, floatComplex* out); -void zspeca(doubleComplex* in, int rows,doubleComplex* out); +EXTERN_MATOPS void sspeca(float* in, int rows, float* out); +EXTERN_MATOPS void dspeca(double* in, int rows, double* out); +EXTERN_MATOPS void cspeca(floatComplex* in, int rows, floatComplex* out); +EXTERN_MATOPS void zspeca(doubleComplex* in, int rows,doubleComplex* out); @@ -39,10 +44,13 @@ void zspeca(doubleComplex* in, int rows,doubleComplex* out); #define cspec2s(in,out) cspecs(FloatComplex(1,0));*out=FloatComplex(creals(in),cimags(in)); #define zspec2s(in,out) zspecs(DoubleComplex(1,0));*out=DoubleComplex(zreals(in),zimags(in)); -void sspec2a(float* in, int rows, float* eigenvalues,float* eigenvectors); -void dspec2a(double* in, int rows, double* eigenvalues,double* eigenvectors); -void cspec2a(floatComplex* in, int rows, floatComplex* eigenvalues,floatComplex* eigenvectors); -void zspec2a(doubleComplex* in, int rows,doubleComplex* eigenvalues,doubleComplex* eigenvectors); +EXTERN_MATOPS void sspec2a(float* in, int rows, float* eigenvalues,float* eigenvectors); +EXTERN_MATOPS void dspec2a(double* in, int rows, double* eigenvalues,double* eigenvectors); +EXTERN_MATOPS void cspec2a(floatComplex* in, int rows, floatComplex* eigenvalues,floatComplex* eigenvectors); +EXTERN_MATOPS void zspec2a(doubleComplex* in, int rows,doubleComplex* eigenvalues,doubleComplex* eigenvectors); +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* __SPEC_H__ */ diff --git a/src/matrixOperations/includes/zeros.h b/src/matrixOperations/includes/zeros.h index 611f883b..e2f3f002 100644 --- a/src/matrixOperations/includes/zeros.h +++ b/src/matrixOperations/includes/zeros.h @@ -14,9 +14,14 @@ #ifndef __ZEROS_H__ #define __ZEROS_H__ +#include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" +#ifdef __cplusplus +extern "C" { +#endif + /* ** \brief create a float one value */ @@ -42,18 +47,22 @@ /* ** \brief create a float matrix full of one */ -void szerosa ( float* in , int rows , int cols ); +EXTERN_MATOPS void szerosa ( float* in , int rows , int cols ); /* ** \brief create a float complex matrix full of one */ -void czerosa ( floatComplex* in , int rows ,int cols ); +EXTERN_MATOPS void czerosa ( floatComplex* in , int rows ,int cols ); /* ** \brief create a double matrix full of one */ -void dzerosa ( double* in , int rows ,int cols ); +EXTERN_MATOPS void dzerosa ( double* in , int rows ,int cols ); /* ** \brief create a double complex matrix full of one */ -void zzerosa ( doubleComplex* in , int rows ,int cols ); +EXTERN_MATOPS void zzerosa ( doubleComplex* in , int rows ,int cols ); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* !__ZEROS_H__ */ diff --git a/src/matrixOperations/inversion/cinverma.c b/src/matrixOperations/inversion/cinverma.c index beb744c5..65b8567c 100644 --- a/src/matrixOperations/inversion/cinverma.c +++ b/src/matrixOperations/inversion/cinverma.c @@ -11,7 +11,7 @@ */ - +#include #include "matrixInversion.h" #include "lapack.h" #include diff --git a/src/matrixOperations/inversion/dinverma.c b/src/matrixOperations/inversion/dinverma.c index 6f2508fd..a343ee5f 100644 --- a/src/matrixOperations/inversion/dinverma.c +++ b/src/matrixOperations/inversion/dinverma.c @@ -9,7 +9,7 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ - +#include #include "matrixInversion.h" #include "lapack.h" #include diff --git a/src/matrixOperations/inversion/zinverma.c b/src/matrixOperations/inversion/zinverma.c index bc9d80b1..b10c745a 100644 --- a/src/matrixOperations/inversion/zinverma.c +++ b/src/matrixOperations/inversion/zinverma.c @@ -9,7 +9,7 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ - +#include #include "matrixInversion.h" #include "lapack.h" #include diff --git a/src/matrixOperations/logm/clogma.c b/src/matrixOperations/logm/clogma.c index c4e69d44..a5e253fb 100644 --- a/src/matrixOperations/logm/clogma.c +++ b/src/matrixOperations/logm/clogma.c @@ -19,8 +19,8 @@ void clogma (floatComplex* in, int rows, floatComplex* out){ doubleComplex *inCopy, *outCopy; int i=0; - inCopy = malloc((uint)(rows*rows)*sizeof(doubleComplex)); - outCopy = malloc((uint)(rows*rows)*sizeof(doubleComplex)); + inCopy = (doubleComplex *)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); + outCopy = (doubleComplex *)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); for(i=0;i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/matrixOperations/multiplication/dmulma.c b/src/matrixOperations/multiplication/dmulma.c index 41e61535..8edd3112 100644 --- a/src/matrixOperations/multiplication/dmulma.c +++ b/src/matrixOperations/multiplication/dmulma.c @@ -11,7 +11,7 @@ */ #ifndef WITHOUT_BLAS -#include "blas.h" +#include "lapack.h" #endif #include "matrixMultiplication.h" diff --git a/src/matrixOperations/multiplication/zmulma.c b/src/matrixOperations/multiplication/zmulma.c index f0407baa..6a38e7da 100644 --- a/src/matrixOperations/multiplication/zmulma.c +++ b/src/matrixOperations/multiplication/zmulma.c @@ -9,9 +9,9 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ - +#include #ifndef WITHOUT_BLAS -#include "blas.h" +#include "lapack.h" #endif #include "matrixMultiplication.h" @@ -38,13 +38,13 @@ void zmulma(doubleComplex *in1, int lines1, int columns1, double MinusOne = -1; double Zero = 0; - double *in1Real = malloc((uint) lines1 * (uint) columns1 * sizeof(double)); - double *in1Imag = malloc((uint) lines1 * (uint) columns1 * sizeof(double)); - double *in2Real = malloc((uint) lines2 * (uint) columns2 * sizeof(double)); - double *in2Imag = malloc((uint) lines2 * (uint) columns2 * sizeof(double)); + double *in1Real = (double*)malloc((unsigned int) lines1 * (unsigned int) columns1 * sizeof(double)); + double *in1Imag = (double*)malloc((unsigned int) lines1 * (unsigned int) columns1 * sizeof(double)); + double *in2Real = (double*)malloc((unsigned int) lines2 * (unsigned int) columns2 * sizeof(double)); + double *in2Imag = (double*)malloc((unsigned int) lines2 * (unsigned int) columns2 * sizeof(double)); - double *RealOut = malloc((uint) lines1 * (uint) columns2 * sizeof(double)); - double *ImagOut = malloc((uint) lines1 * (uint) columns2 * sizeof(double)); + double *RealOut = (double*)malloc((unsigned int) lines1 * (unsigned int) columns2 * sizeof(double)); + double *ImagOut = (double*)malloc((unsigned int) lines1 * (unsigned int) columns2 * sizeof(double)); zreala(in1, lines1 * columns1, in1Real); zreala(in2, lines2 * columns2, in2Real); @@ -54,6 +54,7 @@ void zmulma(doubleComplex *in1, int lines1, int columns1, /* Cr <- 1*Ar*Br + 0*Cr */ dgemm_("N","N", &lines1, &columns2, &columns1, &One, in1Real, &lines1, in2Real, &lines2, &Zero, RealOut, &lines1); + /* Cr <- -1*Ai*Bi + 1*Cr */ dgemm_("N","N", &lines1, &columns2, &columns1, &MinusOne, diff --git a/src/matrixOperations/powm/cpowma.c b/src/matrixOperations/powm/cpowma.c index 5fb8e365..04a393a9 100644 --- a/src/matrixOperations/powm/cpowma.c +++ b/src/matrixOperations/powm/cpowma.c @@ -9,7 +9,7 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ - +#include #include "matrixPow.h" #include "spec.h" #include "pow.h" @@ -24,9 +24,9 @@ void cpowma(floatComplex* in, int rows, floatComplex power, floatComplex* out){ floatComplex *eigenvalues,*eigenvectors,*tmp; /* Data initialization */ - eigenvalues = malloc((uint)(rows*rows)*sizeof(floatComplex)); - eigenvectors = malloc((uint)(rows*rows)*sizeof(floatComplex)); - tmp = malloc((uint)(rows*rows)*sizeof(floatComplex)); + eigenvalues = (floatComplex*)malloc((unsigned int)(rows*rows)*sizeof(floatComplex)); + eigenvectors = (floatComplex*)malloc((unsigned int)(rows*rows)*sizeof(floatComplex)); + tmp = (floatComplex*)malloc((unsigned int)(rows*rows)*sizeof(floatComplex)); /* symmetric test*/ for(i=0;i #include "matrixPow.h" #include "spec.h" #include "pow.h" @@ -27,10 +27,10 @@ void dpowma(double* in, int rows, double power, double* out){ double* ZEROS; /* Data initialization */ - eigenvalues = malloc((uint)(rows*rows)*sizeof(doubleComplex)); - eigenvectors = malloc((uint)(rows*rows)*sizeof(doubleComplex)); - tmp = malloc((uint)(rows*rows)*sizeof(doubleComplex)); - ZEROS=malloc((uint)(rows*rows)*sizeof(double)); + eigenvalues = (doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); + eigenvectors = (doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); + tmp = (doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); + ZEROS=(double*)malloc((unsigned int)(rows*rows)*sizeof(double)); /* symmetric test*/ for(i=0;i #include "matrixPow.h" #include "spec.h" #include "pow.h" @@ -26,10 +26,10 @@ void spowma(float* in, int rows, float power, float* out){ float* ZEROS; /* Data initialization */ - eigenvalues = malloc((uint)(rows*rows)*sizeof(floatComplex)); - eigenvectors = malloc((uint)(rows*rows)*sizeof(floatComplex)); - tmp = malloc((uint)(rows*rows)*sizeof(floatComplex)); - ZEROS = malloc((uint)(rows*rows)*sizeof(float)); + eigenvalues = (floatComplex*)malloc((unsigned int)(rows*rows)*sizeof(floatComplex)); + eigenvectors = (floatComplex*)malloc((unsigned int)(rows*rows)*sizeof(floatComplex)); + tmp = (floatComplex*)malloc((unsigned int)(rows*rows)*sizeof(floatComplex)); + ZEROS = (float*)malloc((unsigned int)(rows*rows)*sizeof(float)); /* symmetric test*/ for(i=0;i #include "matrixPow.h" #include "spec.h" #include "pow.h" @@ -24,9 +24,9 @@ void zpowma(doubleComplex* in, int rows, doubleComplex power, doubleComplex* out doubleComplex *eigenvalues,*eigenvectors,*tmp; /* Data initialization */ - eigenvalues = malloc((uint)(rows*rows)*sizeof(doubleComplex)); - eigenvectors = malloc((uint)(rows*rows)*sizeof(doubleComplex)); - tmp = malloc((uint)(rows*rows)*sizeof(doubleComplex)); + eigenvalues = (doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); + eigenvectors = (doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); + tmp = (doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); /* hermitian test*/ for(i=0;i #include "spec.h" @@ -23,8 +23,8 @@ void cspeca(floatComplex* in, int rows, floatComplex* out){ doubleComplex* dblin; doubleComplex* dblout; - dblin=malloc((uint)(rows*rows)*sizeof(doubleComplex)); - dblout=malloc((uint)rows*sizeof(doubleComplex)); + dblin=(doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); + dblout=(doubleComplex*)malloc((unsigned int)rows*sizeof(doubleComplex)); for (i=0;i #include "spec.h" #include "lapack.h" #include "zeros.h" @@ -30,15 +30,15 @@ void dspeca(double* in, int rows,double* out){ double* pdblRightvectors; double* inCopy; - inCopy = malloc((uint)(rows*rows) * sizeof(double)); - outReal = malloc((uint)rows * sizeof(double)); - outImag = malloc((uint)rows * sizeof(double)); + inCopy = (double*)malloc((unsigned int)(rows*rows) * sizeof(double)); + outReal = (double*)malloc((unsigned int)rows * sizeof(double)); + outImag = (double*)malloc((unsigned int)rows * sizeof(double)); pdblLeftvectors=NULL; pdblRightvectors=NULL; iWorkSize = 3*rows; - pdblWork = malloc((uint)iWorkSize * sizeof(double)); + pdblWork = (double*)malloc((unsigned int)iWorkSize * sizeof(double)); for(i=0;i #include "spec.h" @@ -23,8 +23,8 @@ void sspeca(float* in, int rows, float* out){ double* dblin; double* dblout; - dblin=malloc((uint)(rows*rows)*sizeof(double)); - dblout=malloc((uint)rows*sizeof(double)); + dblin=(double*)malloc((unsigned int)(rows*rows)*sizeof(double)); + dblout=(double*)malloc((unsigned int)rows*sizeof(double)); for (i=0;i +#include #include "spec.h" #include "lapack.h" #include "zeros.h" -#include "stdio.h" #include "conj.h" @@ -31,15 +31,15 @@ void zspeca(doubleComplex* in, int rows,doubleComplex* out){ double* outImag; doubleComplex* inCopy; - inCopy = malloc((uint)(rows*rows) * sizeof(doubleComplex)); - outReal = malloc((uint)rows * sizeof(double)); - outImag = malloc((uint)rows * sizeof(double)); + inCopy = (doubleComplex*)malloc((unsigned int)(rows*rows) * sizeof(doubleComplex)); + outReal = (double*)malloc((unsigned int)rows * sizeof(double)); + outImag = (double*)malloc((unsigned int)rows * sizeof(double)); pdblLeftvectors=NULL; pdblRightvectors=NULL; iWorkSize = 2*rows; - pdblWork = malloc((uint)iWorkSize * sizeof(doubleComplex)); - pdblRWork = malloc((uint)(3*rows) * sizeof(doubleComplex)); + pdblWork = (doubleComplex*)malloc((unsigned int)iWorkSize * sizeof(doubleComplex)); + pdblRWork = (doubleComplex*)malloc((unsigned int)(3*rows) * sizeof(doubleComplex)); for(i=0;i #include "spec.h" @@ -23,9 +23,9 @@ void cspec2a(floatComplex* in, int rows, floatComplex* eigenvalues,floatComplex* doubleComplex* dblin; doubleComplex* dbleigenvalues,*dbleigenvectors; - dblin=malloc((uint)(rows*rows)*sizeof(doubleComplex)); - dbleigenvalues=malloc((uint)(rows*rows)*sizeof(doubleComplex)); - dbleigenvectors=malloc((uint)(rows*rows)*sizeof(doubleComplex)); + dblin=(doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); + dbleigenvalues=(doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); + dbleigenvectors=(doubleComplex*)malloc((unsigned int)(rows*rows)*sizeof(doubleComplex)); for (i=0;i #include "spec.h" #include "lapack.h" #include "zeros.h" @@ -31,15 +31,15 @@ void dspec2a(double* in, int rows,double* eigenvalues,double* eigenvectors){ double* inCopy; /* FIXME : malloc here */ - inCopy = malloc((uint)(rows*rows) * sizeof(double)); - outReal = malloc((uint)rows * sizeof(double)); + inCopy = (double*)malloc((unsigned int)(rows*rows) * sizeof(double)); + outReal = (double*)malloc((unsigned int)rows * sizeof(double)); outImag = NULL; pdblLeftvectors=NULL; pdblRightvectors=NULL; iWorkSize = 4*rows; - pdblWork = malloc((uint)iWorkSize * sizeof(double)); + pdblWork = (double*)malloc((unsigned int)iWorkSize * sizeof(double)); for(i=0;i #include "spec.h" @@ -23,9 +23,9 @@ void sspec2a(float* in, int rows, float* eigenvalues,float* eigenvectors){ double* dblin; double *dbleigenvalues,*dbleigenvectors; - dblin=malloc((uint)(rows*rows)*sizeof(double)); - dbleigenvalues=malloc((uint)(rows*rows)*sizeof(double)); - dbleigenvectors=malloc((uint)(rows*rows)*sizeof(double)); + dblin=(double*)malloc((unsigned int)(rows*rows)*sizeof(double)); + dbleigenvalues = (double*)malloc((unsigned int)(rows*rows)*sizeof(double)); + dbleigenvectors = (double*)malloc((unsigned int)(rows*rows)*sizeof(double)); for (i=0;i #include "spec.h" #include "lapack.h" #include "zeros.h" @@ -32,14 +32,14 @@ void zspec2a(doubleComplex* in, int rows,doubleComplex* eigenvalues, doubleCompl double* outImag; doubleComplex* inCopy; - inCopy = malloc((uint)(rows*rows) * sizeof(doubleComplex)); - outReal = malloc((uint)rows * sizeof(double)); - outImag = malloc((uint)rows * sizeof(double)); + inCopy = (doubleComplex*)malloc((unsigned int)(rows*rows) * sizeof(doubleComplex)); + outReal = (double*)malloc((unsigned int)rows * sizeof(double)); + outImag = (double*)malloc((unsigned int)rows * sizeof(double)); pdblLeftvectors=NULL; pdblRightvectors=NULL; iWorkSize = 2*rows; - pdblWork = malloc((uint)iWorkSize * sizeof(doubleComplex)); + pdblWork = (doubleComplex*)malloc((unsigned int)iWorkSize * sizeof(doubleComplex)); pdblRWork = NULL; pdblRWork2 = NULL; @@ -67,13 +67,13 @@ void zspec2a(doubleComplex* in, int rows,doubleComplex* eigenvalues, doubleCompl /* apply lapack function according to symmetry */ if(hermitian){ - pdblRWork2 = malloc((uint)(3*rows) * sizeof(double)); + pdblRWork2 = (double*)malloc((unsigned int)(3*rows) * sizeof(double)); C2F(zheev)( "V", "U", &rows, eigenvectors, &rows, outReal, pdblWork, &iWorkSize, pdblRWork2, &INFO ); dzerosa(outImag,1,rows); for (i=0;i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/type/doubleComplex.h b/src/type/doubleComplex.h index 7f78ec77..4be0d7d3 100644 --- a/src/type/doubleComplex.h +++ b/src/type/doubleComplex.h @@ -58,6 +58,9 @@ typedef double complex doubleComplex; */ #endif +#ifdef __cplusplus +extern "C" { +#endif EXTERN_TYPE double zreals(doubleComplex); EXTERN_TYPE double zimags(doubleComplex); EXTERN_TYPE void zreala(doubleComplex *in, int size, double *out); @@ -66,9 +69,10 @@ EXTERN_TYPE doubleComplex DoubleComplex(double, double); EXTERN_TYPE doubleComplex* DoubleComplexMatrix(double*, double*, int); EXTERN_TYPE bool zisreals(doubleComplex); EXTERN_TYPE bool zisimags(doubleComplex); -EXTERN_TYPE doubleComplex zadds(doubleComplex, doubleComplex); -EXTERN_TYPE doubleComplex zdiffs(doubleComplex, doubleComplex); -EXTERN_TYPE doubleComplex ztimess(doubleComplex, doubleComplex); EXTERN_TYPE doubleComplex zdevides(doubleComplex, doubleComplex); +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* !__DOUBLECOMPLEX_H__ */ diff --git a/src/type/floatComplex.h b/src/type/floatComplex.h index b51cc133..fe35ca48 100644 --- a/src/type/floatComplex.h +++ b/src/type/floatComplex.h @@ -58,6 +58,9 @@ typedef float complex floatComplex; */ #endif +#ifdef __cplusplus +extern "C" { +#endif EXTERN_TYPE float creals(floatComplex); EXTERN_TYPE float cimags(floatComplex); @@ -68,5 +71,9 @@ EXTERN_TYPE floatComplex* FloatComplexMatrix(float*, float*, int); EXTERN_TYPE bool cisreals(floatComplex); EXTERN_TYPE bool cisimags(floatComplex); +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* !__FLOATCOMPLEX_H__ */ -- cgit