diff options
author | Siddhesh Wani | 2015-08-04 14:36:45 +0530 |
---|---|---|
committer | Siddhesh Wani | 2015-08-04 14:36:45 +0530 |
commit | 6014a4bafdfade45be535c84273309642b731164 (patch) | |
tree | 63c7e18c1b1ddae9bb4c19ceefc835daaf350d98 | |
parent | dcc7a8331ba9ae3bdd00670a018631c77517c100 (diff) | |
download | Scilab2C-6014a4bafdfade45be535c84273309642b731164.tar.gz Scilab2C-6014a4bafdfade45be535c84273309642b731164.tar.bz2 Scilab2C-6014a4bafdfade45be535c84273309642b731164.zip |
Tested Addition and Subtraction for new data types
68 files changed, 1160 insertions, 14 deletions
diff --git a/2.3-1/includes/sci2clib.h b/2.3-1/includes/sci2clib.h index 3154ac39..eac578fa 100644 --- a/2.3-1/includes/sci2clib.h +++ b/2.3-1/includes/sci2clib.h @@ -174,6 +174,19 @@ /* interfacing tanh */ #include "tanh.h" #include "int_tanh.h" +/* interfacing uint8 */ +#include "uint8.h" +#include "int_uint8.h" +/* interfacing int8 */ +#include "int8.h" +#include "int_int8.h" +/* interfacing uint16 */ +#include "uint16.h" +#include "int_uint16.h" +/* interfacing int16 */ +#include "int16.h" +#include "int_int16.h" + /* IMPLICIT LISTS */ /* interfacing implicitList/OpColon */ diff --git a/2.3-1/macros/CCodeGeneration/C_Type.bin b/2.3-1/macros/CCodeGeneration/C_Type.bin Binary files differindex 607a1b3f..2141e15b 100644 --- a/2.3-1/macros/CCodeGeneration/C_Type.bin +++ b/2.3-1/macros/CCodeGeneration/C_Type.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_CreateDirs.bin b/2.3-1/macros/ToolInitialization/INIT_CreateDirs.bin Binary files differindex 16ebab82..8d91e5b6 100644 --- a/2.3-1/macros/ToolInitialization/INIT_CreateDirs.bin +++ b/2.3-1/macros/ToolInitialization/INIT_CreateDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin Binary files differindex e43e2d96..f4029868 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 5fcc0f95..ae6545c9 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -1698,7 +1698,6 @@ PrintStringInfo('i80i80'+ArgSeparator+'i80',ClassFileName,'file','y'); PrintStringInfo('u160u160'+ArgSeparator+'u160',ClassFileName,'file','y');
PrintStringInfo('i160i160'+ArgSeparator+'i160',ClassFileName,'file','y');
-
PrintStringInfo('s2s0'+ArgSeparator+'s2',ClassFileName,'file','y');
PrintStringInfo('d2d0'+ArgSeparator+'d2',ClassFileName,'file','y');
PrintStringInfo('s2c0'+ArgSeparator+'c2',ClassFileName,'file','y');
diff --git a/2.3-1/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin b/2.3-1/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin Binary files differindex f7d2aa59..834b3733 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.bin b/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.bin Binary files differindex 2df394c8..3ec972a0 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenLibraries.bin b/2.3-1/macros/ToolInitialization/INIT_GenLibraries.bin Binary files differindex 0d431419..60d42c75 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenLibraries.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenLibraries.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin Binary files differindex 1885190e..5ec3e454 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin b/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin Binary files differindex 4cf02836..bfa46948 100644 --- a/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin +++ b/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin b/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin Binary files differindex 5b11b8dd..98c77289 100644 --- a/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin +++ b/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin b/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin Binary files differindex b8fe39e1..7823ed5a 100644 --- a/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin +++ b/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin b/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin Binary files differindex 31238a31..d0015c25 100644 --- a/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin +++ b/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin diff --git a/2.3-1/macros/ToolInitialization/ManageNextConversion.bin b/2.3-1/macros/ToolInitialization/ManageNextConversion.bin Binary files differindex 031ef5ca..30d836f0 100644 --- a/2.3-1/macros/ToolInitialization/ManageNextConversion.bin +++ b/2.3-1/macros/ToolInitialization/ManageNextConversion.bin diff --git a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin Binary files differindex 39a60f82..ba8fa34f 100644 --- a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin +++ b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin diff --git a/2.3-1/macros/ToolInitialization/lib b/2.3-1/macros/ToolInitialization/lib Binary files differindex 8f0d0456..3db49c1c 100644 --- a/2.3-1/macros/ToolInitialization/lib +++ b/2.3-1/macros/ToolInitialization/lib diff --git a/2.3-1/macros/ToolInitialization/names b/2.3-1/macros/ToolInitialization/names index e591f064..0c264f0f 100644 --- a/2.3-1/macros/ToolInitialization/names +++ b/2.3-1/macros/ToolInitialization/names @@ -1,14 +1 @@ -INIT_GenFileInfo -INIT_GenLibraries -floatcomplex -ManageNextConversion -INIT_RemoveDirs -INIT_SharedInfoEqual -INIT_GenSharedInfo -INIT_LoadLibraries -INIT_CreateDirs -INIT_SCI2C -INIT_GenAnnFLFunctions INIT_FillSCI2LibCDirs -doublecomplex -UpdateSCI2CInfo diff --git a/2.3-1/macros/findDeps/getAllHeaders.bin b/2.3-1/macros/findDeps/getAllHeaders.bin Binary files differindex 4dda8921..93b73266 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.bin +++ b/2.3-1/macros/findDeps/getAllHeaders.bin diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index 98b96ed1..3b328760 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -88,6 +88,10 @@ function allHeaders = getAllHeaders() "src/c/elementaryFunctions/includes/asinh.h" "src/c/elementaryFunctions/includes/atan2.h" "src/c/elementaryFunctions/includes/atanh.h" + "src/c/elementaryFunctions/includes/uint8.h" + "src/c/elementaryFunctions/includes/int8.h" + "src/c/elementaryFunctions/includes/uint16.h" + "src/c/elementaryFunctions/includes/int16.h" "src/c/statisticsFunctions/includes/variance.h" "src/c/statisticsFunctions/includes/sum.h" "src/c/statisticsFunctions/includes/mean.h" diff --git a/2.3-1/macros/findDeps/getAllInterfaces.bin b/2.3-1/macros/findDeps/getAllInterfaces.bin Binary files differindex 404d8e8d..acefc1bd 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.bin +++ b/2.3-1/macros/findDeps/getAllInterfaces.bin diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index 314b99dc..15b93a96 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -76,6 +76,10 @@ function allInterfaces = getAllInterfaces() "src/c/elementaryFunctions/interfaces/int_atan.h" "src/c/elementaryFunctions/interfaces/int_ceil.h" "src/c/elementaryFunctions/interfaces/int_cosh.h" + "src/c/elementaryFunctions/interfaces/int_uint8.h" + "src/c/elementaryFunctions/interfaces/int_int8.h" + "src/c/elementaryFunctions/interfaces/int_uint16.h" + "src/c/elementaryFunctions/interfaces/int_int16.h" "src/c/statisticsFunctions/interfaces/int_mean.h" "src/c/statisticsFunctions/interfaces/int_meanf.h" "src/c/statisticsFunctions/interfaces/int_stdevf.h" diff --git a/2.3-1/macros/findDeps/getAllSources.bin b/2.3-1/macros/findDeps/getAllSources.bin Binary files differindex bc625a0e..45c2447c 100644 --- a/2.3-1/macros/findDeps/getAllSources.bin +++ b/2.3-1/macros/findDeps/getAllSources.bin diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index 5221fc7d..1c6899c9 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -381,6 +381,22 @@ function allSources = getAllSources() "src/c/elementaryFunctions/round/srounds.c" "src/c/elementaryFunctions/lnp1m1/slnp1m1s.c" "src/c/elementaryFunctions/lnp1m1/dlnp1m1s.c" + "src/c/elementaryFunctions/uint8/duint8s.c" + "src/c/elementaryFunctions/uint8/duint8a.c" + "src/c/elementaryFunctions/uint8/suint8s.c" + "src/c/elementaryFunctions/uint8/suint8a.c" + "src/c/elementaryFunctions/int8/dint8s.c" + "src/c/elementaryFunctions/int8/dint8a.c" + "src/c/elementaryFunctions/int8/sint8s.c" + "src/c/elementaryFunctions/int8/sint8a.c" + "src/c/elementaryFunctions/uint16/duint16s.c" + "src/c/elementaryFunctions/uint16/duint16a.c" + "src/c/elementaryFunctions/uint16/suint16s.c" + "src/c/elementaryFunctions/uint16/suint16a.c" + "src/c/elementaryFunctions/int16/dint16s.c" + "src/c/elementaryFunctions/int16/dint16a.c" + "src/c/elementaryFunctions/int16/sint16s.c" + "src/c/elementaryFunctions/int16/sint16a.c" "src/c/statisticsFunctions/max/dmaxa.c" "src/c/statisticsFunctions/max/smaxa.c" "src/c/statisticsFunctions/max/srowmaxa.c" @@ -513,6 +529,8 @@ function allSources = getAllSources() "src/c/operations/addition/cadds.c" "src/c/operations/addition/dadda.c" "src/c/operations/addition/dadds.c" + "src/c/operations/addition/u8adds.c" + "src/c/operations/addition/u8adda.c" "src/c/operations/subtraction/ddiffa.c" "src/c/operations/subtraction/ddiffs.c" "src/c/operations/subtraction/sdiffa.c" @@ -521,6 +539,8 @@ function allSources = getAllSources() "src/c/operations/subtraction/zdiffs.c" "src/c/operations/subtraction/cdiffa.c" "src/c/operations/subtraction/cdiffs.c" + "src/c/operations/subtraction/u8diffs.c" + "src/c/operations/subtraction/u8diffa.c" "src/c/string/disp/ddispa.c" "src/c/string/disp/ddisps.c" "src/c/string/disp/sdispa.c" diff --git a/2.3-1/macros/runsci2c.bin b/2.3-1/macros/runsci2c.bin Binary files differindex 7b2c901b..2cc69e9e 100644 --- a/2.3-1/macros/runsci2c.bin +++ b/2.3-1/macros/runsci2c.bin diff --git a/2.3-1/macros/runsci2c.sci b/2.3-1/macros/runsci2c.sci index cb2d9823..fbdad316 100644 --- a/2.3-1/macros/runsci2c.sci +++ b/2.3-1/macros/runsci2c.sci @@ -36,6 +36,7 @@ function runsci2c(UserScilabMainFile, UserSciFilesPaths, SCI2COutputPath, Runmod // --- Input Parameters. ---
// -------------------------
RunSci2CMainDir = pwd();
+disp(RunSci2CMainDir);
// -----------------------------
// --- End input Parameters. ---
// -----------------------------
diff --git a/2.3-1/src/c/elementaryFunctions/includes/int16.h b/2.3-1/src/c/elementaryFunctions/includes/int16.h new file mode 100644 index 00000000..f3271849 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/int16.h @@ -0,0 +1,42 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Arnaud Torset + * + * 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 __INT16_H__ +#define __INT16_H__ + +#include "dynlib_elementaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif +/* + int16(X) returns the signed int part of the double value +*/ + +EXTERN_ELEMFUNCT int16 sint16s(float in); + +EXTERN_ELEMFUNCT int16 dint816s(double in); + +EXTERN_ELEMFUNCT void sint16a(float* in, int size, int16* out); + +EXTERN_ELEMFUNCT void dint16a(double* in, int size, int16* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__INT16_H__ */ + diff --git a/2.3-1/src/c/elementaryFunctions/includes/int8.h b/2.3-1/src/c/elementaryFunctions/includes/int8.h new file mode 100644 index 00000000..12fc595f --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/int8.h @@ -0,0 +1,42 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Arnaud Torset + * + * 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 __INT8_H__ +#define __INT8_H__ + +#include "dynlib_elementaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif +/* + int8(X) returns the signed char part of the double value +*/ + +EXTERN_ELEMFUNCT int8 sint8s(float in); + +EXTERN_ELEMFUNCT int8 dint8s(double in); + +EXTERN_ELEMFUNCT void sint8a(float* in, int size, int8* out); + +EXTERN_ELEMFUNCT void dint8a(double* in, int size, int8* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__INT8_H__ */ + diff --git a/2.3-1/src/c/elementaryFunctions/includes/uint16.h b/2.3-1/src/c/elementaryFunctions/includes/uint16.h new file mode 100644 index 00000000..a0739b67 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/uint16.h @@ -0,0 +1,42 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Arnaud Torset + * + * 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 __UINT16_H__ +#define __UINT16_H__ + +#include "dynlib_elementaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif +/* + uint16(X) returns the signed int part of the double value +*/ + +EXTERN_ELEMFUNCT uint16 suint16s(float in); + +EXTERN_ELEMFUNCT uint16 duint816s(double in); + +EXTERN_ELEMFUNCT void suint16a(float* in, int size, uint16* out); + +EXTERN_ELEMFUNCT void duint16a(double* in, int size, uint16* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__UINT16_H__ */ + diff --git a/2.3-1/src/c/elementaryFunctions/includes/uint8.h b/2.3-1/src/c/elementaryFunctions/includes/uint8.h new file mode 100644 index 00000000..9d3dd395 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/includes/uint8.h @@ -0,0 +1,42 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2006-2008 - INRIA - Arnaud Torset + * + * 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 __UINT8_H__ +#define __UINT8_H__ + +#include "dynlib_elementaryfunctions.h" +#include "floatComplex.h" +#include "doubleComplex.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif +/* + uint8(X) returns the unsigned char part of the double value +*/ + +EXTERN_ELEMFUNCT uint8 suint8s(float in); + +EXTERN_ELEMFUNCT uint8 duint8s(double in); + +EXTERN_ELEMFUNCT void suint8a(float* in, int size, uint8* out); + +EXTERN_ELEMFUNCT void duint8a(double* in, int size, uint8* out); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif /* !__UINT8_H__ */ + diff --git a/2.3-1/src/c/elementaryFunctions/int16/dint16a.c b/2.3-1/src/c/elementaryFunctions/int16/dint16a.c new file mode 100644 index 00000000..73c9ec74 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/int16/dint16a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "int16.h" + +void dint16a(double* x, int size, int16* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = dint16s(x[i]); +} diff --git a/2.3-1/src/c/elementaryFunctions/int16/dint16s.c b/2.3-1/src/c/elementaryFunctions/int16/dint16s.c new file mode 100644 index 00000000..76ee96b3 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/int16/dint16s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "int16.h" + +int16 dint16s(double x) { + return (int16) x; +} diff --git a/2.3-1/src/c/elementaryFunctions/int16/sint16a.c b/2.3-1/src/c/elementaryFunctions/int16/sint16a.c new file mode 100644 index 00000000..33058ea7 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/int16/sint16a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "int16.h" + +void sint16a(float* x, int size, int16* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = sint16s(x[i]); +} diff --git a/2.3-1/src/c/elementaryFunctions/int16/sint16s.c b/2.3-1/src/c/elementaryFunctions/int16/sint16s.c new file mode 100644 index 00000000..4634a39d --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/int16/sint16s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "int16.h" + +int16 sint16s(float x) { + return (int16) x; +} diff --git a/2.3-1/src/c/elementaryFunctions/int8/dint8a.c b/2.3-1/src/c/elementaryFunctions/int8/dint8a.c new file mode 100644 index 00000000..719d6f42 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/int8/dint8a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "int8.h" + +void dint8a(double* x, int size, int8* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = dint8s(x[i]); +} diff --git a/2.3-1/src/c/elementaryFunctions/int8/dint8s.c b/2.3-1/src/c/elementaryFunctions/int8/dint8s.c new file mode 100644 index 00000000..f1789e6a --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/int8/dint8s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "int8.h" + +int8 dint8s(double x) { + return (int8) x; +} diff --git a/2.3-1/src/c/elementaryFunctions/int8/sint8a.c b/2.3-1/src/c/elementaryFunctions/int8/sint8a.c new file mode 100644 index 00000000..87846a71 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/int8/sint8a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "int8.h" + +void sint8a(float* x, int size, int8* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = sint8s(x[i]); +} diff --git a/2.3-1/src/c/elementaryFunctions/int8/sint8s.c b/2.3-1/src/c/elementaryFunctions/int8/sint8s.c new file mode 100644 index 00000000..89d4b819 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/int8/sint8s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "int8.h" + +int8 sint8s(float x) { + return (int8) x; +} diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_int16.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_int16.h new file mode 100644 index 00000000..759cb971 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_int16.h @@ -0,0 +1,26 @@ +/* + * 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 + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_INT16_H__ +#define __INT_INT16_H__ + +#define s0int16u80(in) sint16s(in) + +#define d0int16u80(in) dint16s(in) + +#define s2int16u82(in,size,out) sint16a(in, size[0]*size[1], out) + +#define d2int16u82(in,size,out) dint16a(in, size[0]*size[1], out) + +#endif /* !__INT_INT8_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_int8.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_int8.h new file mode 100644 index 00000000..5cf129eb --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_int8.h @@ -0,0 +1,26 @@ +/* + * 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 + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_INT8_H__ +#define __INT_INT8_H__ + +#define s0int8u80(in) sint8s(in) + +#define d0int8u80(in) dint8s(in) + +#define s2int8u82(in,size,out) sint8a(in, size[0]*size[1], out) + +#define d2int8u82(in,size,out) dint8a(in, size[0]*size[1], out) + +#endif /* !__INT_INT8_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_uint16.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_uint16.h new file mode 100644 index 00000000..0d558b30 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_uint16.h @@ -0,0 +1,26 @@ +/* + * 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 + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_UINT16_H__ +#define __INT_UINT16_H__ + +#define s0uint16u80(in) suint16s(in) + +#define d0uint16u80(in) duint16s(in) + +#define s2uint16u82(in,size,out) suint16a(in, size[0]*size[1], out) + +#define d2uint16u82(in,size,out) duint16a(in, size[0]*size[1], out) + +#endif /* !__INT_UINT8_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_uint8.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_uint8.h new file mode 100644 index 00000000..d12b275a --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_uint8.h @@ -0,0 +1,26 @@ +/* + * 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 + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_UINT8_H__ +#define __INT_UINT8_H__ + +#define s0uint8u80(in) suint8s(in) + +#define d0uint8u80(in) duint8s(in) + +#define s2uint8u82(in,size,out) suint8a(in, size[0]*size[1], out) + +#define d2uint8u82(in,size,out) duint8a(in, size[0]*size[1], out) + +#endif /* !__INT_UINT8_H__ */ diff --git a/2.3-1/src/c/elementaryFunctions/uint16/duint16a.c b/2.3-1/src/c/elementaryFunctions/uint16/duint16a.c new file mode 100644 index 00000000..c94cd187 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/uint16/duint16a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "uint16.h" + +void duint16a(double* x, int size, uint16* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = duint16s(x[i]); +} diff --git a/2.3-1/src/c/elementaryFunctions/uint16/duint16s.c b/2.3-1/src/c/elementaryFunctions/uint16/duint16s.c new file mode 100644 index 00000000..4c4918f4 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/uint16/duint16s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "uint16.h" + +uint16 duint16s(double x) { + return (uint16) x; +} diff --git a/2.3-1/src/c/elementaryFunctions/uint16/suint16a.c b/2.3-1/src/c/elementaryFunctions/uint16/suint16a.c new file mode 100644 index 00000000..4bc3768e --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/uint16/suint16a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "uint16.h" + +void suint16a(float* x, int size, uint16* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = suint16s(x[i]); +} diff --git a/2.3-1/src/c/elementaryFunctions/uint16/suint16s.c b/2.3-1/src/c/elementaryFunctions/uint16/suint16s.c new file mode 100644 index 00000000..708237b1 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/uint16/suint16s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "uint16.h" + +uint16 suint16s(float x) { + return (uint16) x; +} diff --git a/2.3-1/src/c/elementaryFunctions/uint8/duint8a.c b/2.3-1/src/c/elementaryFunctions/uint8/duint8a.c new file mode 100644 index 00000000..0a3f2d25 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/uint8/duint8a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "uint8.h" + +void duint8a(double* x, int size, uint8* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = duint8s(x[i]); +} diff --git a/2.3-1/src/c/elementaryFunctions/uint8/duint8s.c b/2.3-1/src/c/elementaryFunctions/uint8/duint8s.c new file mode 100644 index 00000000..b797934b --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/uint8/duint8s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "uint8.h" + +uint8 duint8s(double x) { + return (uint8) x; +} diff --git a/2.3-1/src/c/elementaryFunctions/uint8/suint8a.c b/2.3-1/src/c/elementaryFunctions/uint8/suint8a.c new file mode 100644 index 00000000..cf64dd42 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/uint8/suint8a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "uint8.h" + +void suint8a(float* x, int size, uint8* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = suint8s(x[i]); +} diff --git a/2.3-1/src/c/elementaryFunctions/uint8/suint8s.c b/2.3-1/src/c/elementaryFunctions/uint8/suint8s.c new file mode 100644 index 00000000..e95e9642 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/uint8/suint8s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * 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 "uint8.h" + +uint8 suint8s(float x) { + return (uint8) x; +} diff --git a/2.3-1/src/c/operations/addition/i16adda.c b/2.3-1/src/c/operations/addition/i16adda.c new file mode 100644 index 00000000..8c28a989 --- /dev/null +++ b/2.3-1/src/c/operations/addition/i16adda.c @@ -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 + * + */ + +#include "addition.h" + +void i16adda(int16* in1, int size1, int16* in2, int size2, int16* out) { + int i = 0; + for (i = 0; i < size1 && i < size2; ++i) { + out[i] = i16adds(in1[i], in2[i]); + } +} diff --git a/2.3-1/src/c/operations/addition/i16adds.c b/2.3-1/src/c/operations/addition/i16adds.c new file mode 100644 index 00000000..ea36a911 --- /dev/null +++ b/2.3-1/src/c/operations/addition/i16adds.c @@ -0,0 +1,18 @@ +/* + * 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 "addition.h" + +int16 i16adds(int16 in1, int16 in2) +{ + return (in1 + in2); +} diff --git a/2.3-1/src/c/operations/addition/i8adds.c b/2.3-1/src/c/operations/addition/i8adds.c new file mode 100644 index 00000000..aee40458 --- /dev/null +++ b/2.3-1/src/c/operations/addition/i8adds.c @@ -0,0 +1,18 @@ +/* + * 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 "addition.h" + +int8 i8adds(int8 in1, int8 in2) +{ + return (in1 + in2); +} diff --git a/2.3-1/src/c/operations/addition/u16adda.c b/2.3-1/src/c/operations/addition/u16adda.c new file mode 100644 index 00000000..884e0994 --- /dev/null +++ b/2.3-1/src/c/operations/addition/u16adda.c @@ -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 + * + */ + +#include "addition.h" + +void u16adda(uint16* in1, int size1, uint16* in2, int size2, uint16* out) { + int i = 0; + for (i = 0; i < size1 && i < size2; ++i) { + out[i] = u16adds(in1[i], in2[i]); + } +} diff --git a/2.3-1/src/c/operations/addition/u16adds.c b/2.3-1/src/c/operations/addition/u16adds.c new file mode 100644 index 00000000..f52dd055 --- /dev/null +++ b/2.3-1/src/c/operations/addition/u16adds.c @@ -0,0 +1,18 @@ +/* + * 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 "addition.h" + +uint16 u16adds(uint16 in1, uint16 in2) +{ + return (in1 + in2); +} diff --git a/2.3-1/src/c/operations/addition/u8adda.c b/2.3-1/src/c/operations/addition/u8adda.c new file mode 100644 index 00000000..4c195b07 --- /dev/null +++ b/2.3-1/src/c/operations/addition/u8adda.c @@ -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 + * + */ + +#include "addition.h" + +void u8adda(uint8* in1, int size1, uint8* in2, int size2, uint8* out) { + int i = 0; + for (i = 0; i < size1 && i < size2; ++i) { + out[i] = u8adds(in1[i], in2[i]); + } +} diff --git a/2.3-1/src/c/operations/addition/u8adds.c b/2.3-1/src/c/operations/addition/u8adds.c new file mode 100644 index 00000000..b729c3bd --- /dev/null +++ b/2.3-1/src/c/operations/addition/u8adds.c @@ -0,0 +1,18 @@ +/* + * 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 "addition.h" + +uint8 u8adds(uint8 in1, uint8 in2) +{ + return (in1 + in2); +} diff --git a/2.3-1/src/c/operations/includes/addition.h b/2.3-1/src/c/operations/includes/addition.h index d6f03381..fbf0177b 100644 --- a/2.3-1/src/c/operations/includes/addition.h +++ b/2.3-1/src/c/operations/includes/addition.h @@ -16,6 +16,7 @@ #include "dynlib_operations.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -108,6 +109,86 @@ EXTERN_OPERATIONS void zadda(doubleComplex *in1, int size1, doubleComplex *in2, int size2, doubleComplex *out); +/* +** \brief Compute an addition with uint8. +** \param in1 : input uint8. +** \param in2 : input uint8. +** \return : in1 + in2 +*/ +EXTERN_OPERATIONS uint8 u8adds(uint8 in1, uint8 in2); + +/* +** \brief Compute an addition element wise for uint8. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the addition in1 + in2. +*/ +EXTERN_OPERATIONS void u8adda(uint8 *in1, int size1, + uint8 *in2, int size2, + uint8 *out); + +/* +** \brief Compute an addition with int8. +** \param in1 : input int8. +** \param in2 : input int8. +** \return : in1 + in2 +*/ +EXTERN_OPERATIONS int8 i8adds(int8 in1, int8 in2); + +/* +** \brief Compute an addition element wise for int8. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the addition in1 + in2. +*/ +EXTERN_OPERATIONS void i8adda(int8 *in1, int size1, + int8 *in2, int size2, + int8 *out); + +/* +** \brief Compute an addition with uint16. +** \param in1 : input uint16. +** \param in2 : input uint16. +** \return : in1 + in2 +*/ +EXTERN_OPERATIONS uint16 u16adds(uint16 in1, uint16 in2); + +/* +** \brief Compute an addition element wise for uint16. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the addition in1 + in2. +*/ +EXTERN_OPERATIONS void u16adda(uint16 *in1, int size1, + uint16 *in2, int size2, + uint16 *out); + +/* +** \brief Compute an addition with int16. +** \param in1 : input int16. +** \param in2 : input int16. +** \return : in1 + in2 +*/ +EXTERN_OPERATIONS int16 i16adds(int16 in1, int16 in2); + +/* +** \brief Compute an addition element wise for int16. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the addition in1 + in2. +*/ +EXTERN_OPERATIONS void i16adda(int16 *in1, int size1, + int16 *in2, int size2, + int16 *out); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/2.3-1/src/c/operations/includes/subtraction.h b/2.3-1/src/c/operations/includes/subtraction.h index 8571a5de..798df2bf 100644 --- a/2.3-1/src/c/operations/includes/subtraction.h +++ b/2.3-1/src/c/operations/includes/subtraction.h @@ -16,6 +16,7 @@ #include "dynlib_operations.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -107,6 +108,88 @@ EXTERN_OPERATIONS void zdiffa(doubleComplex *in1, int size1, doubleComplex *in2, int size2, doubleComplex *out); + +/* +** \brief Compute a subtraction with uint8. +** \param in1 : input uint8. +** \param in2 : input uint8. +** \return : in1 + in2 +*/ +EXTERN_OPERATIONS uint8 u8diffs(uint8 in1, uint8 in2); + +/* +** \brief Compute a subtraction element wise for uint8. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the subtraction in1 + in2. +*/ +EXTERN_OPERATIONS void u8diffa(uint8 *in1, int size1, + uint8 *in2, int size2, + uint8 *out); + +/* +** \brief Compute a subtraction with int8. +** \param in1 : input int8. +** \param in2 : input int8. +** \return : in1 + in2 +*/ +EXTERN_OPERATIONS int8 i8diffs(int8 in1, int8 in2); + +/* +** \brief Compute a subtraction element wise for int8. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the subtraction in1 + in2. +*/ +EXTERN_OPERATIONS void i8diffa(int8 *in1, int size1, + int8 *in2, int size2, + int8 *out); + + +/* +** \brief Compute a subtraction with uint16. +** \param in1 : input uint16. +** \param in2 : input uint16. +** \return : in1 + in2 +*/ +EXTERN_OPERATIONS uint16 u16diffs(uint16 in1, uint16 in2); + +/* +** \brief Compute a subtraction element wise for uint16. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the subtraction in1 + in2. +*/ +EXTERN_OPERATIONS void u16diffa(uint16 *in1, int size1, + uint16 *in2, int size2, + uint16 *out); + +/* +** \brief Compute a subtraction with int16. +** \param in1 : input int16. +** \param in2 : input int16. +** \return : in1 + in2 +*/ +EXTERN_OPERATIONS int16 i16diffs(int16 in1, int16 in2); + +/* +** \brief Compute a subtraction element wise for int16. +** \param in1 : input array. +** \param size1 : size of in1 array. +** \param in2 : input arry. +** \param size2 : size of in2 array. +** \param out : array that contains the subtraction in1 + in2. +*/ +EXTERN_OPERATIONS void i16diffa(int16 *in1, int size1, + int16 *in2, int size2, + int16 *out); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/2.3-1/src/c/operations/interfaces/int_OpMinus.h b/2.3-1/src/c/operations/interfaces/int_OpMinus.h index ac27ddb6..b96328ed 100644 --- a/2.3-1/src/c/operations/interfaces/int_OpMinus.h +++ b/2.3-1/src/c/operations/interfaces/int_OpMinus.h @@ -25,6 +25,14 @@ #define z0OpMinusz0(in) DoubleComplex(-zreals(in), -zimags(in)) +#define u80OpMinusu80(in) -(int8)in + +#define i80OpMinusi80(in) -in + +#define u160OpMinusu160(in) -(int16)in + +#define i160OpMinusi160(in) -in + /* - Matrix */ #define s2OpMinuss2(in, size, out) {int i=0; \ @@ -43,6 +51,19 @@ for (i=0;i<size[0]*size[1];i++) out[i] = DoubleComplex(-zreals(in[i]), -zimags(in[i])); \ } +#define u82OpMinusu82(in, size, out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i] = -(int8)in[i]; \ + } + + +#define u82OpMinusu82(in, size, out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i] = -in[i]; \ + } + + +#define u162OpMinusu162(in, size, out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i] = -(int16)in[i]; \ + } /* Scalar - Scalar */ @@ -62,6 +83,14 @@ #define z0d0OpMinusz0(in1,in2) zdiffs(in1,DoubleComplex(in2,0)) +#define u80u80OpMinusu80(in1,in2) u8diffs(in1,in2) + +#define i80i80OpMinusi80(in1,in2) i8diffs(in1,in2) + +#define u160u160OpMinusu160(in1,in2) u16diffs(in1,in2) + +#define i160i160OpMinusi160(in1,in2) i16diffs(in1,in2) + /* Matrix - Scalar */ @@ -99,6 +128,25 @@ } +#define u82u80OpMinusu82(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]-in2; \ + } + + +#define i82i80OpMinusi82(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]-in2; \ + } + + +#define u162u160OpMinusu162(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]-in2; \ + } + + +#define i162i160OpMinusi162(in1,size,in2,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]-in2; \ + } + /* Scalar - Matrix */ @@ -136,6 +184,22 @@ } +#define u80u82OpMinusu82(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1-in2[i]; \ + } + + +#define i80i82OpMinusi82(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1-in2[i]; \ + } + +#define u160u162OpMinusu162(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1-in2[i]; \ + } + +#define i160i162OpMinusi162(in1,in2,size,out) {int i=0; \ + for (i=0;i<size[0]*size[1];i++) out[i]=in1-in2[i]; \ + } /* Matrix - Matrix */ @@ -167,7 +231,12 @@ for (i=0;i<size1[0]*size2[1];i++) out[i]=zdiffs(in1[i],DoubleComplex(in2[i],0)); \ } +#define u82u82OpMinusu82(in1,size1,in2,size2,out) u8diffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + +#define i82i82OpMinusi82(in1,size1,in2,size2,out) i8diffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) +#define u162u162OpMinusu162(in1,size1,in2,size2,out) u16diffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) +#define i162i162OpMinusu162(in1,size1,in2,size2,out) i16diffa(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) #endif /* !__INT_OPMINUS_H__ */ diff --git a/2.3-1/src/c/operations/interfaces/int_OpPlus.h b/2.3-1/src/c/operations/interfaces/int_OpPlus.h index cb86d815..9684d250 100644 --- a/2.3-1/src/c/operations/interfaces/int_OpPlus.h +++ b/2.3-1/src/c/operations/interfaces/int_OpPlus.h @@ -34,7 +34,13 @@ #define z0d0OpPlusz0(in1,in2) zadds(in1,DoubleComplex(in2,0)) +#define u80u80OpPlusu80(in1,in2) u8adds(in1,in2) +#define i80i80OpPlusi80(in1,in2) i8adds(in1,in2) + +#define u160u160OpPlusu160(in1,in2) u16adds(in1,in2) + +#define i160i160OpPlusi160(in1,in2) i16adds(in1,in2) /* Matrix + Scalar */ @@ -68,6 +74,21 @@ for (i=0;i<size[0]*size[1];i++) out[i]=zadds(DoubleComplex(in1[i],0),in2);\ } +#define u82u80OpPlusu82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]+in2;\ + } + +#define i82i80OpPlusi82(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]+in2;\ + } + +#define u162u160OpPlusu162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]+in2;\ + } + +#define i162i160OpPlusi162(in1,size,in2,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1[i]+in2;\ + } /* Scalar + Matrix */ @@ -101,7 +122,21 @@ for (i=0;i<size[0]*size[1];i++) out[i]=zadds(in1,DoubleComplex(in2[i],0));\ } +#define u80u82OpPlusu82(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1+in2[i];\ + } + +#define i80i82OpPlusi82(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1+in2[i];\ + } + +#define u160u162OpPlusu162(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1+in2[i];\ + } +#define i160i162OpPlusi162(in1,in2,size,out) {int i=0;\ + for (i=0;i<size[0]*size[1];i++) out[i]=in1+in2[i];\ + } /* Matrix + Matrix */ @@ -132,7 +167,13 @@ for (i=0;i<size1[0]*size2[1];i++) out[i]=zadds(in1[i],DoubleComplex(in2[i],0));\ } +#define u82u82OpPlusu82(in1,size1,in2,size2,out) u8adda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + +#define i82i82OpPlusi82(in1,size1,in2,size2,out) i8adda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) + +#define u162u162OpPlusu162(in1,size1,in2,size2,out) u16adda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) +#define i162i162OpPlusu162(in1,size1,in2,size2,out) i16adda(in1, size1[0]*size1[1], in2, size2[0]*size2[1], out) /* Strings */ /* RNU: size1[1]-1 -> "-1" because '\0' of the first string must be removed. */ #define g2g2OpPlusg2(in1,size1,in2,size2,out) {int i = 0, j = 0; \ diff --git a/2.3-1/src/c/operations/subtraction/i16diffa.c b/2.3-1/src/c/operations/subtraction/i16diffa.c new file mode 100644 index 00000000..ca722af0 --- /dev/null +++ b/2.3-1/src/c/operations/subtraction/i16diffa.c @@ -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 + * + */ + +#include "subtraction.h" + +void i16diffa(int16* in1, int size1, int16* in2, int size2, int16* out) { + int i = 0; + for (i = 0; i < size1 && i < size2; ++i) { + out[i] = i16diffs(in1[i], in2[i]); + } +} diff --git a/2.3-1/src/c/operations/subtraction/i16diffs.c b/2.3-1/src/c/operations/subtraction/i16diffs.c new file mode 100644 index 00000000..6ca2e52c --- /dev/null +++ b/2.3-1/src/c/operations/subtraction/i16diffs.c @@ -0,0 +1,18 @@ +/* + * 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 "subtraction.h" + +int16 i16diffs(int16 in1, int16 in2) +{ + return (in1 - in2); +} diff --git a/2.3-1/src/c/operations/subtraction/i8diffa.c b/2.3-1/src/c/operations/subtraction/i8diffa.c new file mode 100644 index 00000000..ec966bf5 --- /dev/null +++ b/2.3-1/src/c/operations/subtraction/i8diffa.c @@ -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 + * + */ + +#include "subtraction.h" + +void i8diffa(int8* in1, int size1, int8* in2, int size2, int8* out) { + int i = 0; + for (i = 0; i < size1 && i < size2; ++i) { + out[i] = i8diffs(in1[i], in2[i]); + } +} diff --git a/2.3-1/src/c/operations/subtraction/i8diffs.c b/2.3-1/src/c/operations/subtraction/i8diffs.c new file mode 100644 index 00000000..bbc9a1a4 --- /dev/null +++ b/2.3-1/src/c/operations/subtraction/i8diffs.c @@ -0,0 +1,18 @@ +/* + * 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 "subtraction.h" + +int8 i8diffs(int8 in1, int8 in2) +{ + return (in1 - in2); +} diff --git a/2.3-1/src/c/operations/subtraction/u16diffa.c b/2.3-1/src/c/operations/subtraction/u16diffa.c new file mode 100644 index 00000000..7c216bb8 --- /dev/null +++ b/2.3-1/src/c/operations/subtraction/u16diffa.c @@ -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 + * + */ + +#include "subtraction.h" + +void u16diffa(uint16* in1, int size1, uint16* in2, int size2, uint16* out) { + int i = 0; + for (i = 0; i < size1 && i < size2; ++i) { + out[i] = u16diffs(in1[i], in2[i]); + } +} diff --git a/2.3-1/src/c/operations/subtraction/u16diffs.c b/2.3-1/src/c/operations/subtraction/u16diffs.c new file mode 100644 index 00000000..bd52d66a --- /dev/null +++ b/2.3-1/src/c/operations/subtraction/u16diffs.c @@ -0,0 +1,18 @@ +/* + * 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 "subtraction.h" + +uint16 u16diffs(uint16 in1, uint16 in2) +{ + return (in1 - in2); +} diff --git a/2.3-1/src/c/operations/subtraction/u8diffa.c b/2.3-1/src/c/operations/subtraction/u8diffa.c new file mode 100644 index 00000000..42c06f7d --- /dev/null +++ b/2.3-1/src/c/operations/subtraction/u8diffa.c @@ -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 + * + */ + +#include "subtraction.h" + +void u8diffa(uint8* in1, int size1, uint8* in2, int size2, uint8* out) { + int i = 0; + for (i = 0; i < size1 && i < size2; ++i) { + out[i] = u8diffs(in1[i], in2[i]); + } +} diff --git a/2.3-1/src/c/operations/subtraction/u8diffs.c b/2.3-1/src/c/operations/subtraction/u8diffs.c new file mode 100644 index 00000000..bc9beacb --- /dev/null +++ b/2.3-1/src/c/operations/subtraction/u8diffs.c @@ -0,0 +1,18 @@ +/* + * 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 "subtraction.h" + +uint8 u8diffs(uint8 in1, uint8 in2) +{ + return (in1 - in2); +} |