diff options
Diffstat (limited to '2.3-1/src/c/auxiliaryFunctions/includes')
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/abs.h | 93 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/conj.h | 37 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/dynlib_auxiliaryfunctions.h | 26 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/find.h | 52 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/find2d.h | 52 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/frexp.h | 33 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/isempty.h | 64 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/isnan.h | 71 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/length.h | 98 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/max.h | 22 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/min.h | 20 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/pythag.h | 50 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/rand.h | 79 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/sign.h | 99 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/size.h | 25 | ||||
-rw-r--r-- | 2.3-1/src/c/auxiliaryFunctions/includes/type.h | 72 |
16 files changed, 893 insertions, 0 deletions
diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/abs.h b/2.3-1/src/c/auxiliaryFunctions/includes/abs.h new file mode 100644 index 00000000..00565e39 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/abs.h @@ -0,0 +1,93 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-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 + * + */ + +#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 + ** Determine the absolute value of in. + ** \param in : the float we must determine abs. + ** \return -in or in depending on the sign of in. + **/ +EXTERN_AUXFUNCT float sabss(float in); + +/** + ** \brief Double Absolute Value function + ** Determine the absolute value of in. + ** \param in : the double we must determine abs. + ** \return -in or +in depending on the abs of in. + **/ +EXTERN_AUXFUNCT double dabss(double in); + +/** + ** \brief Float Complex Absolute Value function + ** Determine the absolute value of in. + ** \param in : the float complex we must determine abs i.e. module. + ** \return |in|. + **/ +EXTERN_AUXFUNCT float cabss(floatComplex in); + +/** + ** \brief Double Complex Absolute Value function + ** Determine the absolute value of in. + ** \param in : the double complex we must determine abs i.e. module. + ** \return |in|. + **/ +EXTERN_AUXFUNCT double zabss(doubleComplex in); + +/** + ** \brief Float Array Absolute Value function + ** Determine the absolute value of in elements. + ** \param in : the float array we must determine abs. + ** \param out : the float array result. + **/ +EXTERN_AUXFUNCT void sabsa(float *in, int size, float* out); + +/** + ** \brief Double Array Absolute Value function + ** Determine the absolute value of in elements. + ** \param in : the double array we must determine abs. + ** \param out : the double array result. + **/ +EXTERN_AUXFUNCT void dabsa(double *in, int size, double* out); + +/** + ** \brief Float Complex Array Absolute Value function + ** Determine the absolute value of in elements. + ** \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]|. + **/ +EXTERN_AUXFUNCT void cabsa(floatComplex *in, int size, float* out); + +/** + ** \brief Double Complex Array Absolute Value function + ** Determine the absolute value of in. + ** \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]|. + **/ +EXTERN_AUXFUNCT void zabsa(doubleComplex *in, int size, double* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !__ABS_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/conj.h b/2.3-1/src/c/auxiliaryFunctions/includes/conj.h new file mode 100644 index 00000000..b49855bf --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/conj.h @@ -0,0 +1,37 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 __CONJ_H__ +#define __CONJ_H__ + +#include "dynlib_auxiliaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +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 + + +#endif /* !__CONJ_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/dynlib_auxiliaryfunctions.h b/2.3-1/src/c/auxiliaryFunctions/includes/dynlib_auxiliaryfunctions.h new file mode 100644 index 00000000..09b1bea8 --- /dev/null +++ b/2.3-1/src/c/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__
+
+#if defined(_MSC_VER) && defined(_USRDLL)
+ #if AUXILIARYFUNCTIONS_EXPORTS
+ #define EXTERN_AUXFUNCT __declspec (dllexport)
+ #else
+ #define EXTERN_AUXFUNCT __declspec (dllimport)
+ #endif
+#else
+ #define EXTERN_AUXFUNCT
+#endif
+
+#endif /* __DYNLIB_AUXILIARYFUNCTIONS_H__ */
diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/find.h b/2.3-1/src/c/auxiliaryFunctions/includes/find.h new file mode 100644 index 00000000..3104e957 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/find.h @@ -0,0 +1,52 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-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 + * + */ + +#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 +** max is an integer giving the maximum number of indices to return. (use -1 to search them all) +*/ +EXTERN_AUXFUNCT void sfinda(float* x, int size, float *out, int max); + +/* +** \brief Double Find function +** max is an integer giving the maximum number of indices to return. (use -1 to search them all) +*/ +EXTERN_AUXFUNCT void dfinda(double*x, int size, double *out, int max); + +/* +** \brief Float Complex Find function +** max is an integer giving the maximum number of indices to return. (use -1 to search them all) +*/ +EXTERN_AUXFUNCT void cfinda(floatComplex* z, int size, float *out, int max); + +/* +** \brief Double Complex Find function +** max is an integer giving the maximum number of indices to return. (use -1 to search them all) +*/ +EXTERN_AUXFUNCT void zfinda(doubleComplex* z, int size, double *out, int max); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__FIND_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/find2d.h b/2.3-1/src/c/auxiliaryFunctions/includes/find2d.h new file mode 100644 index 00000000..2e9be6fa --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/find2d.h @@ -0,0 +1,52 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-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 + * + */ + +#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 +** max is an integer giving the maximum number of indices to return. (use -1 to search them all) +*/ +EXTERN_AUXFUNCT void sfind2da(float* x, int rows, int columns, float* out1, int* sizeOut1, float* out2, int* sizeOut2,int max); + +/* +** \brief Double Find function +** max is an integer giving the maximum number of indices to return. (use -1 to search them all) +*/ +EXTERN_AUXFUNCT void dfind2da(double* x, int rows, int columns, double* out1, double* out2, int max); + +/* +** \brief Float Complex Find function +** max is an integer giving the maximum number of indices to return. (use -1 to search them all) +*/ +EXTERN_AUXFUNCT void cfind2da(floatComplex* z, int rows, int columns, float* out1, int* sizeOut1, float* out2, int* sizeOut2,int max); + +/* +** \brief Double Complex Find function +** max is an integer giving the maximum number of indices to return. (use -1 to search them all) +*/ +EXTERN_AUXFUNCT void zfind2da(doubleComplex* z, int rows, int columns, double* out1, int* sizeOut1, double* out2, int* sizeOut2,int max); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__FIND2D_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/frexp.h b/2.3-1/src/c/auxiliaryFunctions/includes/frexp.h new file mode 100644 index 00000000..cb4d8f32 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/frexp.h @@ -0,0 +1,33 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 __FREXP_H__ +#define __FREXP_H__ + +#include <math.h> +#include "dynlib_auxiliaryfunctions.h" + +#ifdef __cplusplus +extern "C" { +#endif + +EXTERN_AUXFUNCT float sfrexps(float _fltVal, float *_pfltExp); + +EXTERN_AUXFUNCT double dfrexps(double _dblVal, double *_pdblExp); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif /* !__FREXP_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/isempty.h b/2.3-1/src/c/auxiliaryFunctions/includes/isempty.h new file mode 100644 index 00000000..4248200a --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/isempty.h @@ -0,0 +1,64 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-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 + * + */ + +#ifndef __IS_EMPTY_H__ +#define __IS_EMPTY_H__ + + + +#include "floatComplex.h" +#include "doubleComplex.h" +#include "notFound.h" +#include "find.h" + + +/* +** \brief Float Is Empty function +*/ +#define sisemptys(in) 0.0f /*= false*/ + +/* +** \brief Double Is Empty function +*/ +#define disemptys(in) 0/*= false*/ + +/* +** \brief Float Complex Is Empty function +*/ +#define cisemptys(in) 0.0f/*= false*/ + +/* +** \brief Double Complex Is Empty function +*/ +#define zisemptys(in) 0/*= false*/ + +/* +** \brief Float Is Empty function +*/ +#define sisemptya(in,size) (size==0) ? 1.0f : 0.0f + +/* +** \brief Double Is Empty function +*/ +#define disemptya(in,size) (size==0) ? 1.0 : 0.0 + +/* +** \brief Float Complex Is Empty function +*/ +#define cisemptya(in,size) (size==0) ? 1.0f : 0.0f + +/* +** \brief Double Complex Is Empty function +*/ +#define zisemptya(in,size) (size==0) ? 1.0 : 0.0 + +#endif /* !__IS_EMPTY_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/isnan.h b/2.3-1/src/c/auxiliaryFunctions/includes/isnan.h new file mode 100644 index 00000000..e0975c23 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/isnan.h @@ -0,0 +1,71 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-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 + * + */ + +#ifndef __IS_NAN_H__ +#define __IS_NAN_H__ + +#include <math.h> +#include "dynlib_auxiliaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** \brief Float Is Nan function +*/ +EXTERN_AUXFUNCT float sisnans(float x); + +/* +** \brief Double Is Nan function +*/ +EXTERN_AUXFUNCT double disnans(double x); + +/* +** \brief Float Complex Is Nan function +*/ +EXTERN_AUXFUNCT float cisnans(floatComplex z); + +/* +** \brief Double Complex Is Nan function +*/ +EXTERN_AUXFUNCT double zisnans(doubleComplex z); + +/* +** \brief Float Is Nan function +*/ +EXTERN_AUXFUNCT void sisnana(float* x, int size, float* out); + +/* +** \brief Double Is Nan function +*/ +EXTERN_AUXFUNCT void disnana(double* x, int size, double* out); + +/* +** \brief Float Complex Is Nan function +*/ +EXTERN_AUXFUNCT void cisnana(floatComplex* z, int size, float* out); + +/* +** \brief Double Complex Is Nan function +*/ +EXTERN_AUXFUNCT void zisnana(doubleComplex* z, int size, double* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif /* !__IS_NAN_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/length.h b/2.3-1/src/c/auxiliaryFunctions/includes/length.h new file mode 100644 index 00000000..f8939f18 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/length.h @@ -0,0 +1,98 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * Copyright (C) 2007-2008 - POLIBA - Raffaele Nutricato + * + * 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 __LENGTH_H__ +#define __LENGTH_H__ + +#include "dynlib_auxiliaryfunctions.h" + +/** + ** WARNING : + ** We assume size of arrays are known, so we + ** use #define to avoid compilation warnings + ** such as "unused parameter" + **/ + +/** + ** \brief Float Size Scalar function + ** Determine the size of an array. + ** \param in : the float array we must determine size. + ** \param size : the number of elements. + ** \return the size of in. + **/ +#define slengths(in) 1.0f + +/** + ** \brief Float length Scalar function + ** Determine the length of an array. + ** \param in : the float array we must determine length. + ** \param length : the number of elements. + ** \return the length of in. + **/ +#define dlengths(in) 1.0 + +/** + ** \brief Complex Float length Scalar function + ** Determine the length of an array. + ** \param in : the float array we must determine length. + ** \param length : the number of elements. + ** \return the length of in. + **/ +#define clengths(in) 1.0f + +/** + ** \brief Complex Double length Array function + ** Determine the length of an array. + ** \param in : the float array we must determine length. + ** \param length : the number of elements. + ** \return the length of in. + **/ +#define zlengths(in) 1.0 + +/** + ** \brief Float length Array function + ** Determine the length of an array. + ** \param in : the float array we must determine length. + ** \param length : the number of elements. + ** \return the length of in. + **/ +#define slengtha(in, size) (float)size + +/** + ** \brief Double length Array function + ** Determine the length of an array. + ** \param in : the float array we must determine length. + ** \param length : the number of elements. + ** \return the length of in. + **/ +#define dlengtha(in, size) (double)size + +/** + ** \brief Complex Float length Array function + ** Determine the length of an array. + ** \param in : the float array we must determine length. + ** \param length : the number of elements. + ** \return the length of in. + **/ +#define clengtha(in, size) (float)size + +/** + ** \brief Complex Double length Array function + ** Determine the length of an array. + ** \param in : the float array we must determine length. + ** \param length : the number of elements. + ** \return the length of in. + **/ +#define zlengtha(in, size) (double)size + +#endif /* !__LENGTH_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/max.h b/2.3-1/src/c/auxiliaryFunctions/includes/max.h new file mode 100644 index 00000000..c37bfea5 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/max.h @@ -0,0 +1,22 @@ +/* + * 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 + * + */ + +#ifndef __MAX_H__ +#define __MAX_H__ + +#define max(a,b) (a>=b?a:b) + +#define maxa(a,size1,b,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=max(a[i],b[i]);\ + } + +#endif /* !__MAX_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/min.h b/2.3-1/src/c/auxiliaryFunctions/includes/min.h new file mode 100644 index 00000000..70097d10 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/min.h @@ -0,0 +1,20 @@ +/* + * 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 + * + */ +#ifndef __MIN_H__ +#define __MIN_H__ + +#define min(a,b) (a<=b?a:b) + +#define mina(a,size1,b,size2,out) {int i;\ + for (i=0;i<size1[0]*size2[1];i++) out[i]=min(a[i],b[i]);\ + } +#endif /* !__MIN_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/pythag.h b/2.3-1/src/c/auxiliaryFunctions/includes/pythag.h new file mode 100644 index 00000000..9535a354 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/pythag.h @@ -0,0 +1,50 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-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 + * + */ + +#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 +*/ +EXTERN_AUXFUNCT float spythags(float x, float y); + +/* +** \brief Double Pythag function +*/ +EXTERN_AUXFUNCT double dpythags(double x, double y); + +/* +** \brief Float Complex Pythag function +*/ +EXTERN_AUXFUNCT floatComplex cpythags(floatComplex x, floatComplex y); + +/* +** \brief Double Complex Pythag function +*/ +EXTERN_AUXFUNCT doubleComplex zpythags(doubleComplex x, doubleComplex y); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__PYTHAG_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/rand.h b/2.3-1/src/c/auxiliaryFunctions/includes/rand.h new file mode 100644 index 00000000..4716cbba --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/rand.h @@ -0,0 +1,79 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-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 + * + */ + +#ifndef __RAND_H__ +#define __RAND_H__ + +#include <math.h> +#include "dynlib_auxiliaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + ** \brief Float Rand function + ** \return A random float. + **/ +EXTERN_AUXFUNCT float srands(void); + +/** + ** \brief Double Rand function + ** \return A random double. + **/ +EXTERN_AUXFUNCT double drands(void); + +/** + ** \brief Float Complex Rand function + ** \return A random float complex. + **/ +EXTERN_AUXFUNCT floatComplex crands(void); + +/** + ** \brief Double Complex Rand function + ** \return A random double complex. + **/ +EXTERN_AUXFUNCT doubleComplex zrands(void); + +/** + ** \brief Float Array Rand function + ** \return A random float array. + **/ +EXTERN_AUXFUNCT void sranda(float *out, int size); + +/** + ** \brief Double Array Rand function + ** \return A random double array. + **/ +EXTERN_AUXFUNCT void dranda(double *out, int size); + +/** + ** \brief Float Complex Array Rand function + ** \return A random float complex array. + **/ +EXTERN_AUXFUNCT void cranda(floatComplex *out, int size); + +/** + ** \brief Double Complex Array Rand function + ** \return A random double complex array. + **/ +EXTERN_AUXFUNCT void zranda(doubleComplex *out, int size); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + + +#endif /* !__RAND_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/sign.h b/2.3-1/src/c/auxiliaryFunctions/includes/sign.h new file mode 100644 index 00000000..0f69b4b7 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/sign.h @@ -0,0 +1,99 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-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 + * + */ + +#ifndef __SIGN_H__ +#define __SIGN_H__ + +#include <math.h> + +#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. + **/ +EXTERN_AUXFUNCT float ssigns(float in); + +/** + ** \brief Double Signe function + ** Determine the sign of in (assume that 0 is positive). + ** \param in : the double we must determine sign. + ** \return -1 or +1 depending on the sign of in. + **/ +EXTERN_AUXFUNCT double dsigns(double in); + +/** + ** \brief Float Complex 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. + **/ +EXTERN_AUXFUNCT floatComplex csigns(floatComplex in); + +/** + ** \brief Double Complex Signe function + ** Determine the sign of in (assume that 0 is positive). + ** \param in : the double we must determine sign. + ** \return -1 or +1 depending on the sign of in. + **/ +EXTERN_AUXFUNCT doubleComplex zsigns(doubleComplex in); + +/** + ** \brief Float Signe Array function + ** Determine the sign of an array in (assume that 0 is positive). + ** \param in : the float array we must determine sign. + ** \param size : the number of elements. + ** \return -1 or +1 depending on the sign of in elements. + **/ +EXTERN_AUXFUNCT void ssigna(float *in, int size, float *out); + +/** + ** \brief Double Signe Array function + ** Determine the sign of an array in (assume that 0 is positive). + ** \param in : the double array we must determine sign. + ** \param size : the number of elements. + ** \return -1 or +1 depending on the sign of in elements. + **/ +EXTERN_AUXFUNCT void dsigna(double *in, int size, double *out); + +/** + ** \brief Float Signe Complex Array function + ** Determine the sign of an array in (assume that 0 is positive). + ** \param in : the float complex array we must determine sign. + ** \param size : the number of elements. + ** \return -1 or +1 depending on the sign of in elements. + **/ +EXTERN_AUXFUNCT void csigna(floatComplex *in, int size, floatComplex *out); + +/** + ** \brief Double Signe Complex Array function + ** Determine the sign of an array in (assume that 0 is positive). + ** \param in : the double complex array we must determine sign. + ** \param size : the number of elements. + ** \return -1 or +1 depending on the sign of in elements. + **/ +EXTERN_AUXFUNCT void zsigna(doubleComplex *in, int size, doubleComplex *out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__SIGN_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/size.h b/2.3-1/src/c/auxiliaryFunctions/includes/size.h new file mode 100644 index 00000000..ebc07a05 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/size.h @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-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 + * + */ + +#ifndef __SIZE_H__ +#define __SIZE_H__ + +/** + ** \brief Double Size Array function + ** Determine the size of an array. + ** \param in : the float array we must determine size. + ** \param size : the number of elements. + ** \return the size of in. + **/ +double dallsizea(int *size, char *select); + +#endif /* !__SIZE_H__ */ diff --git a/2.3-1/src/c/auxiliaryFunctions/includes/type.h b/2.3-1/src/c/auxiliaryFunctions/includes/type.h new file mode 100644 index 00000000..00b468d6 --- /dev/null +++ b/2.3-1/src/c/auxiliaryFunctions/includes/type.h @@ -0,0 +1,72 @@ +/* + * 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 + * + */ + +/** + ** \brief Return scilab code encoding for data type. + **/ + +/** + ** WARNING : + ** We use #define to avoid compilation warnings + ** such as "unused parameter" and better performance. + **/ + +#ifndef __TYPE_H__ +#define __TYPE_H__ + +#define REAL_FLOAT_CONSTANT_MATRIX 1.0f +#define REAL_DOUBLE_CONSTANT_MATRIX 1.0 + +#define COMPLEX_FLOAT_CONSTANT_MATRIX 1.0f +#define COMPLEX_DOUBLE_CONSTANT_MATRIX 1.0 + +/** + ** Float scalar. + **/ +#define stypes(in) REAL_FLOAT_CONSTANT_MATRIX + +/** + ** Double scalar. + **/ +#define dtypes(in) REAL_DOUBLE_CONSTANT_MATRIX + +/** + ** Float complex scalar. + **/ +#define ctypes(in) COMPLEX_FLOAT_CONSTANT_MATRIX + +/** + ** Double complex scalar. + **/ +#define ztypes(in) COMPLEX_DOUBLE_CONSTANT_MATRIX + +/** + ** Float array. + **/ +#define stypea(in, size) REAL_FLOAT_CONSTANT_MATRIX + +/** + ** Double array. + **/ +#define dtypea(in, size) REAL_DOUBLE_CONSTANT_MATRIX + +/** + ** Float complex array. + **/ +#define ctypea(in, size) COMPLEX_FLOAT_CONSTANT_MATRIX + +/** + ** Double complex array. + **/ +#define ztypea(in, size) COMPLEX_DOUBLE_CONSTANT_MATRIX + +#endif /* !__TYPE_H__ */ |