summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjofret2005-03-16 01:55:45 +0000
committerjofret2005-03-16 01:55:45 +0000
commit02f1ba9e28fbc94eedfdd7bcfee164eceeb0bc52 (patch)
treeee92820087ad0d0be705e0a50d4e37c36f09f2e0
parente6d642d605cb0eda510a788d62dc7d50afe60fb6 (diff)
downloadscilab2c-02f1ba9e28fbc94eedfdd7bcfee164eceeb0bc52.tar.gz
scilab2c-02f1ba9e28fbc94eedfdd7bcfee164eceeb0bc52.tar.bz2
scilab2c-02f1ba9e28fbc94eedfdd7bcfee164eceeb0bc52.zip
Better floatvs. double management. Enable Psycho warnings.
-rw-r--r--src/auxiliaryFunctions/includes/abs.h20
-rw-r--r--src/auxiliaryFunctions/includes/sign.h20
-rw-r--r--src/auxiliaryFunctions/includes/size.h95
-rw-r--r--src/auxiliaryFunctions/includes/type.h72
4 files changed, 187 insertions, 20 deletions
diff --git a/src/auxiliaryFunctions/includes/abs.h b/src/auxiliaryFunctions/includes/abs.h
index 2d9ca926..bd75ba54 100644
--- a/src/auxiliaryFunctions/includes/abs.h
+++ b/src/auxiliaryFunctions/includes/abs.h
@@ -1,14 +1,14 @@
/*
-** -*- C -*-
-**
-** abs.h
-** Made by Bruno JOFRET <bruno.jofret@inria.fr>
-**
-** Started on Thu Feb 8 10:12:17 2007 jofret
-** Last update Mon Oct 22 10:44:49 2007 bruno
-**
-** Copyright INRIA 2007
-*/
+ * 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__
diff --git a/src/auxiliaryFunctions/includes/sign.h b/src/auxiliaryFunctions/includes/sign.h
index 59707007..46f9a765 100644
--- a/src/auxiliaryFunctions/includes/sign.h
+++ b/src/auxiliaryFunctions/includes/sign.h
@@ -20,23 +20,23 @@
/**
** \brief Float Signe function
- ** Determine the sine of in (assume that 0 is positive).
+ ** 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.
**/
-int ssigns(float in);
+float ssigns(float in);
/**
** \brief Double Signe function
- ** Determine the sine of in (assume that 0 is positive).
+ ** 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.
**/
-int dsigns(double in);
+double dsigns(double in);
/**
** \brief Float Complex Signe function
- ** Determine the sine of in (assume that 0 is positive).
+ ** 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.
**/
@@ -44,7 +44,7 @@ floatComplex csigns(floatComplex in);
/**
** \brief Double Complex Signe function
- ** Determine the sine of in (assume that 0 is positive).
+ ** 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.
**/
@@ -52,7 +52,7 @@ doubleComplex zsigns(doubleComplex in);
/**
** \brief Float Signe Array function
- ** Determine the sine of an array in (assume that 0 is positive).
+ ** 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.
@@ -61,7 +61,7 @@ void ssigna(float *in, int size, float *out);
/**
** \brief Double Signe Array function
- ** Determine the sine of an array in (assume that 0 is positive).
+ ** 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.
@@ -70,7 +70,7 @@ void dsigna(double *in, int size, double *out);
/**
** \brief Float Signe Complex Array function
- ** Determine the sine of an array in (assume that 0 is positive).
+ ** 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.
@@ -79,7 +79,7 @@ void csigna(floatComplex *in, int size, floatComplex *out);
/**
** \brief Double Signe Complex Array function
- ** Determine the sine of an array in (assume that 0 is positive).
+ ** 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.
diff --git a/src/auxiliaryFunctions/includes/size.h b/src/auxiliaryFunctions/includes/size.h
new file mode 100644
index 00000000..3a642e3a
--- /dev/null
+++ b/src/auxiliaryFunctions/includes/size.h
@@ -0,0 +1,95 @@
+/*
+ * 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__
+
+/**
+ ** 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 ssizes(in) 1.0f
+
+/**
+ ** \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 dsizes(in) 1.0
+
+/**
+ ** \brief Complex 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 csizes(in) 1.0f
+
+/**
+ ** \brief Complex 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.
+ **/
+#define zsizes(in) 1.0
+
+/**
+ ** \brief Float 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.
+ **/
+#define ssizea(in, size) size
+
+/**
+ ** \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.
+ **/
+#define dsizea(in, size) size
+
+/**
+ ** \brief Complex Float 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.
+ **/
+#define csizea(in, size) size
+
+/**
+ ** \brief Complex 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.
+ **/
+#define zsizea(in, size) size
+
+#endif /* !__SIZE_H__ */
diff --git a/src/auxiliaryFunctions/includes/type.h b/src/auxiliaryFunctions/includes/type.h
new file mode 100644
index 00000000..00b468d6
--- /dev/null
+++ b/src/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__ */