From 14496b5b41e6d2e7323d9c5e860e6b56e385a062 Mon Sep 17 00:00:00 2001 From: Siddhesh Wani Date: Tue, 4 Aug 2015 14:36:45 +0530 Subject: Tested Addition and Subtraction for new data types --- includes/sci2clib.h | 13 ++++ macros/CCodeGeneration/C_Type.bin | Bin 9600 -> 9600 bytes macros/ToolInitialization/INIT_CreateDirs.bin | Bin 8900 -> 9600 bytes .../ToolInitialization/INIT_FillSCI2LibCDirs.bin | Bin 403968 -> 404912 bytes .../ToolInitialization/INIT_FillSCI2LibCDirs.sci | 1 - .../ToolInitialization/INIT_GenAnnFLFunctions.bin | Bin 3460 -> 9600 bytes macros/ToolInitialization/INIT_GenFileInfo.bin | Bin 18716 -> 13696 bytes macros/ToolInitialization/INIT_GenLibraries.bin | Bin 9600 -> 9600 bytes macros/ToolInitialization/INIT_GenSharedInfo.bin | Bin 18472 -> 13696 bytes macros/ToolInitialization/INIT_LoadLibraries.bin | Bin 8844 -> 9600 bytes macros/ToolInitialization/INIT_RemoveDirs.bin | Bin 11880 -> 13696 bytes macros/ToolInitialization/INIT_SCI2C.bin | Bin 22864 -> 21152 bytes macros/ToolInitialization/INIT_SharedInfoEqual.bin | Bin 6500 -> 9600 bytes macros/ToolInitialization/ManageNextConversion.bin | Bin 11012 -> 13696 bytes macros/ToolInitialization/UpdateSCI2CInfo.bin | Bin 37748 -> 30256 bytes macros/ToolInitialization/lib | Bin 768 -> 632 bytes macros/ToolInitialization/names | 13 ---- macros/findDeps/getAllHeaders.bin | Bin 13696 -> 13696 bytes macros/findDeps/getAllHeaders.sci | 4 + macros/findDeps/getAllInterfaces.bin | Bin 21216 -> 13696 bytes macros/findDeps/getAllInterfaces.sci | 4 + macros/findDeps/getAllSources.bin | Bin 110236 -> 86048 bytes macros/findDeps/getAllSources.sci | 20 +++++ macros/runsci2c.bin | Bin 17152 -> 17168 bytes macros/runsci2c.sci | 1 + src/c/elementaryFunctions/includes/int16.h | 42 +++++++++++ src/c/elementaryFunctions/includes/int8.h | 42 +++++++++++ src/c/elementaryFunctions/includes/uint16.h | 42 +++++++++++ src/c/elementaryFunctions/includes/uint8.h | 42 +++++++++++ src/c/elementaryFunctions/int16/dint16a.c | 18 +++++ src/c/elementaryFunctions/int16/dint16s.c | 18 +++++ src/c/elementaryFunctions/int16/sint16a.c | 18 +++++ src/c/elementaryFunctions/int16/sint16s.c | 18 +++++ src/c/elementaryFunctions/int8/dint8a.c | 18 +++++ src/c/elementaryFunctions/int8/dint8s.c | 18 +++++ src/c/elementaryFunctions/int8/sint8a.c | 18 +++++ src/c/elementaryFunctions/int8/sint8s.c | 18 +++++ src/c/elementaryFunctions/interfaces/int_int16.h | 26 +++++++ src/c/elementaryFunctions/interfaces/int_int8.h | 26 +++++++ src/c/elementaryFunctions/interfaces/int_uint16.h | 26 +++++++ src/c/elementaryFunctions/interfaces/int_uint8.h | 26 +++++++ src/c/elementaryFunctions/uint16/duint16a.c | 18 +++++ src/c/elementaryFunctions/uint16/duint16s.c | 18 +++++ src/c/elementaryFunctions/uint16/suint16a.c | 18 +++++ src/c/elementaryFunctions/uint16/suint16s.c | 18 +++++ src/c/elementaryFunctions/uint8/duint8a.c | 18 +++++ src/c/elementaryFunctions/uint8/duint8s.c | 18 +++++ src/c/elementaryFunctions/uint8/suint8a.c | 18 +++++ src/c/elementaryFunctions/uint8/suint8s.c | 18 +++++ src/c/operations/addition/i16adda.c | 20 +++++ src/c/operations/addition/i16adds.c | 18 +++++ src/c/operations/addition/i8adds.c | 18 +++++ src/c/operations/addition/u16adda.c | 20 +++++ src/c/operations/addition/u16adds.c | 18 +++++ src/c/operations/addition/u8adda.c | 20 +++++ src/c/operations/addition/u8adds.c | 18 +++++ src/c/operations/includes/addition.h | 81 ++++++++++++++++++++ src/c/operations/includes/subtraction.h | 83 +++++++++++++++++++++ src/c/operations/interfaces/int_OpMinus.h | 69 +++++++++++++++++ src/c/operations/interfaces/int_OpPlus.h | 41 ++++++++++ src/c/operations/subtraction/i16diffa.c | 20 +++++ src/c/operations/subtraction/i16diffs.c | 18 +++++ src/c/operations/subtraction/i8diffa.c | 20 +++++ src/c/operations/subtraction/i8diffs.c | 18 +++++ src/c/operations/subtraction/u16diffa.c | 20 +++++ src/c/operations/subtraction/u16diffs.c | 18 +++++ src/c/operations/subtraction/u8diffa.c | 20 +++++ src/c/operations/subtraction/u8diffs.c | 18 +++++ 68 files changed, 1160 insertions(+), 14 deletions(-) create mode 100644 src/c/elementaryFunctions/includes/int16.h create mode 100644 src/c/elementaryFunctions/includes/int8.h create mode 100644 src/c/elementaryFunctions/includes/uint16.h create mode 100644 src/c/elementaryFunctions/includes/uint8.h create mode 100644 src/c/elementaryFunctions/int16/dint16a.c create mode 100644 src/c/elementaryFunctions/int16/dint16s.c create mode 100644 src/c/elementaryFunctions/int16/sint16a.c create mode 100644 src/c/elementaryFunctions/int16/sint16s.c create mode 100644 src/c/elementaryFunctions/int8/dint8a.c create mode 100644 src/c/elementaryFunctions/int8/dint8s.c create mode 100644 src/c/elementaryFunctions/int8/sint8a.c create mode 100644 src/c/elementaryFunctions/int8/sint8s.c create mode 100644 src/c/elementaryFunctions/interfaces/int_int16.h create mode 100644 src/c/elementaryFunctions/interfaces/int_int8.h create mode 100644 src/c/elementaryFunctions/interfaces/int_uint16.h create mode 100644 src/c/elementaryFunctions/interfaces/int_uint8.h create mode 100644 src/c/elementaryFunctions/uint16/duint16a.c create mode 100644 src/c/elementaryFunctions/uint16/duint16s.c create mode 100644 src/c/elementaryFunctions/uint16/suint16a.c create mode 100644 src/c/elementaryFunctions/uint16/suint16s.c create mode 100644 src/c/elementaryFunctions/uint8/duint8a.c create mode 100644 src/c/elementaryFunctions/uint8/duint8s.c create mode 100644 src/c/elementaryFunctions/uint8/suint8a.c create mode 100644 src/c/elementaryFunctions/uint8/suint8s.c create mode 100644 src/c/operations/addition/i16adda.c create mode 100644 src/c/operations/addition/i16adds.c create mode 100644 src/c/operations/addition/i8adds.c create mode 100644 src/c/operations/addition/u16adda.c create mode 100644 src/c/operations/addition/u16adds.c create mode 100644 src/c/operations/addition/u8adda.c create mode 100644 src/c/operations/addition/u8adds.c create mode 100644 src/c/operations/subtraction/i16diffa.c create mode 100644 src/c/operations/subtraction/i16diffs.c create mode 100644 src/c/operations/subtraction/i8diffa.c create mode 100644 src/c/operations/subtraction/i8diffs.c create mode 100644 src/c/operations/subtraction/u16diffa.c create mode 100644 src/c/operations/subtraction/u16diffs.c create mode 100644 src/c/operations/subtraction/u8diffa.c create mode 100644 src/c/operations/subtraction/u8diffs.c diff --git a/includes/sci2clib.h b/includes/sci2clib.h index 3154ac3..eac578f 100644 --- a/includes/sci2clib.h +++ b/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/macros/CCodeGeneration/C_Type.bin b/macros/CCodeGeneration/C_Type.bin index 607a1b3..2141e15 100644 Binary files a/macros/CCodeGeneration/C_Type.bin and b/macros/CCodeGeneration/C_Type.bin differ diff --git a/macros/ToolInitialization/INIT_CreateDirs.bin b/macros/ToolInitialization/INIT_CreateDirs.bin index 16ebab8..8d91e5b 100644 Binary files a/macros/ToolInitialization/INIT_CreateDirs.bin and b/macros/ToolInitialization/INIT_CreateDirs.bin differ diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin index e43e2d9..f402986 100644 Binary files a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin and b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin differ diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 5fcc0f9..ae6545c 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/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/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin b/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin index f7d2aa5..834b373 100644 Binary files a/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin and b/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin differ diff --git a/macros/ToolInitialization/INIT_GenFileInfo.bin b/macros/ToolInitialization/INIT_GenFileInfo.bin index 2df394c..3ec972a 100644 Binary files a/macros/ToolInitialization/INIT_GenFileInfo.bin and b/macros/ToolInitialization/INIT_GenFileInfo.bin differ diff --git a/macros/ToolInitialization/INIT_GenLibraries.bin b/macros/ToolInitialization/INIT_GenLibraries.bin index 0d43141..60d42c7 100644 Binary files a/macros/ToolInitialization/INIT_GenLibraries.bin and b/macros/ToolInitialization/INIT_GenLibraries.bin differ diff --git a/macros/ToolInitialization/INIT_GenSharedInfo.bin b/macros/ToolInitialization/INIT_GenSharedInfo.bin index 1885190..5ec3e45 100644 Binary files a/macros/ToolInitialization/INIT_GenSharedInfo.bin and b/macros/ToolInitialization/INIT_GenSharedInfo.bin differ diff --git a/macros/ToolInitialization/INIT_LoadLibraries.bin b/macros/ToolInitialization/INIT_LoadLibraries.bin index 4cf0283..bfa4694 100644 Binary files a/macros/ToolInitialization/INIT_LoadLibraries.bin and b/macros/ToolInitialization/INIT_LoadLibraries.bin differ diff --git a/macros/ToolInitialization/INIT_RemoveDirs.bin b/macros/ToolInitialization/INIT_RemoveDirs.bin index 5b11b8d..98c7728 100644 Binary files a/macros/ToolInitialization/INIT_RemoveDirs.bin and b/macros/ToolInitialization/INIT_RemoveDirs.bin differ diff --git a/macros/ToolInitialization/INIT_SCI2C.bin b/macros/ToolInitialization/INIT_SCI2C.bin index b8fe39e..7823ed5 100644 Binary files a/macros/ToolInitialization/INIT_SCI2C.bin and b/macros/ToolInitialization/INIT_SCI2C.bin differ diff --git a/macros/ToolInitialization/INIT_SharedInfoEqual.bin b/macros/ToolInitialization/INIT_SharedInfoEqual.bin index 31238a3..d0015c2 100644 Binary files a/macros/ToolInitialization/INIT_SharedInfoEqual.bin and b/macros/ToolInitialization/INIT_SharedInfoEqual.bin differ diff --git a/macros/ToolInitialization/ManageNextConversion.bin b/macros/ToolInitialization/ManageNextConversion.bin index 031ef5c..30d836f 100644 Binary files a/macros/ToolInitialization/ManageNextConversion.bin and b/macros/ToolInitialization/ManageNextConversion.bin differ diff --git a/macros/ToolInitialization/UpdateSCI2CInfo.bin b/macros/ToolInitialization/UpdateSCI2CInfo.bin index 39a60f8..ba8fa34 100644 Binary files a/macros/ToolInitialization/UpdateSCI2CInfo.bin and b/macros/ToolInitialization/UpdateSCI2CInfo.bin differ diff --git a/macros/ToolInitialization/lib b/macros/ToolInitialization/lib index 8f0d045..3db49c1 100644 Binary files a/macros/ToolInitialization/lib and b/macros/ToolInitialization/lib differ diff --git a/macros/ToolInitialization/names b/macros/ToolInitialization/names index e591f06..0c264f0 100644 --- a/macros/ToolInitialization/names +++ b/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/macros/findDeps/getAllHeaders.bin b/macros/findDeps/getAllHeaders.bin index 4dda892..93b7326 100644 Binary files a/macros/findDeps/getAllHeaders.bin and b/macros/findDeps/getAllHeaders.bin differ diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci index 98b96ed..3b32876 100644 --- a/macros/findDeps/getAllHeaders.sci +++ b/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/macros/findDeps/getAllInterfaces.bin b/macros/findDeps/getAllInterfaces.bin index 404d8e8..acefc1b 100644 Binary files a/macros/findDeps/getAllInterfaces.bin and b/macros/findDeps/getAllInterfaces.bin differ diff --git a/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci index 314b99d..15b93a9 100644 --- a/macros/findDeps/getAllInterfaces.sci +++ b/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/macros/findDeps/getAllSources.bin b/macros/findDeps/getAllSources.bin index bc625a0..45c2447 100644 Binary files a/macros/findDeps/getAllSources.bin and b/macros/findDeps/getAllSources.bin differ diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci index 5221fc7..1c6899c 100644 --- a/macros/findDeps/getAllSources.sci +++ b/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/macros/runsci2c.bin b/macros/runsci2c.bin index 7b2c901..2cc69e9 100644 Binary files a/macros/runsci2c.bin and b/macros/runsci2c.bin differ diff --git a/macros/runsci2c.sci b/macros/runsci2c.sci index cb2d982..fbdad31 100644 --- a/macros/runsci2c.sci +++ b/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/src/c/elementaryFunctions/includes/int16.h b/src/c/elementaryFunctions/includes/int16.h new file mode 100644 index 0000000..f327184 --- /dev/null +++ b/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/src/c/elementaryFunctions/includes/int8.h b/src/c/elementaryFunctions/includes/int8.h new file mode 100644 index 0000000..12fc595 --- /dev/null +++ b/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/src/c/elementaryFunctions/includes/uint16.h b/src/c/elementaryFunctions/includes/uint16.h new file mode 100644 index 0000000..a0739b6 --- /dev/null +++ b/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/src/c/elementaryFunctions/includes/uint8.h b/src/c/elementaryFunctions/includes/uint8.h new file mode 100644 index 0000000..9d3dd39 --- /dev/null +++ b/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/src/c/elementaryFunctions/int16/dint16a.c b/src/c/elementaryFunctions/int16/dint16a.c new file mode 100644 index 0000000..73c9ec7 --- /dev/null +++ b/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 "-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/src/c/operations/subtraction/i16diffa.c b/src/c/operations/subtraction/i16diffa.c new file mode 100644 index 0000000..ca722af --- /dev/null +++ b/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/src/c/operations/subtraction/i16diffs.c b/src/c/operations/subtraction/i16diffs.c new file mode 100644 index 0000000..6ca2e52 --- /dev/null +++ b/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/src/c/operations/subtraction/i8diffa.c b/src/c/operations/subtraction/i8diffa.c new file mode 100644 index 0000000..ec966bf --- /dev/null +++ b/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/src/c/operations/subtraction/i8diffs.c b/src/c/operations/subtraction/i8diffs.c new file mode 100644 index 0000000..bbc9a1a --- /dev/null +++ b/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/src/c/operations/subtraction/u16diffa.c b/src/c/operations/subtraction/u16diffa.c new file mode 100644 index 0000000..7c216bb --- /dev/null +++ b/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/src/c/operations/subtraction/u16diffs.c b/src/c/operations/subtraction/u16diffs.c new file mode 100644 index 0000000..bd52d66 --- /dev/null +++ b/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/src/c/operations/subtraction/u8diffa.c b/src/c/operations/subtraction/u8diffa.c new file mode 100644 index 0000000..42c06f7 --- /dev/null +++ b/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/src/c/operations/subtraction/u8diffs.c b/src/c/operations/subtraction/u8diffs.c new file mode 100644 index 0000000..bc9beac --- /dev/null +++ b/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); +} -- cgit