From 0bdaec9811b3e463514393aa1d3da6c3a96891a1 Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Mon, 7 Sep 2015 21:27:00 +0530 Subject: Changes made for arduino support --- src/c/auxiliaryFunctions/abs/i16absa.c | 20 +++++++ src/c/auxiliaryFunctions/abs/i16abss.c | 20 +++++++ src/c/auxiliaryFunctions/abs/i8absa.c | 20 +++++++ src/c/auxiliaryFunctions/abs/i8abss.c | 20 +++++++ src/c/auxiliaryFunctions/abs/u16absa.c | 20 +++++++ src/c/auxiliaryFunctions/abs/u16abss.c | 20 +++++++ src/c/auxiliaryFunctions/abs/u8absa.c | 20 +++++++ src/c/auxiliaryFunctions/abs/u8abss.c | 20 +++++++ src/c/auxiliaryFunctions/includes/abs.h | 67 ++++++++++++++++++++++ src/c/auxiliaryFunctions/interfaces/int_abs.h | 16 ++++++ src/c/auxiliaryFunctions/interfaces/int_conj.h | 16 ++++++ src/c/elementaryFunctions/ceil/i16ceila.c | 19 ++++++ src/c/elementaryFunctions/ceil/i16ceils.c | 18 ++++++ src/c/elementaryFunctions/ceil/i8ceila.c | 19 ++++++ src/c/elementaryFunctions/ceil/i8ceils.c | 18 ++++++ src/c/elementaryFunctions/ceil/u16ceila.c | 19 ++++++ src/c/elementaryFunctions/ceil/u16ceils.c | 18 ++++++ src/c/elementaryFunctions/ceil/u8ceila.c | 19 ++++++ src/c/elementaryFunctions/ceil/u8ceils.c | 18 ++++++ src/c/elementaryFunctions/cosh/i16cosha.c | 18 ++---- src/c/elementaryFunctions/cosh/i8cosha.c | 18 ++---- src/c/elementaryFunctions/cosh/u16cosha.c | 18 ++---- src/c/elementaryFunctions/cosh/u8cosha.c | 18 ++---- src/c/elementaryFunctions/fix/i16fixa.c | 21 +++++++ src/c/elementaryFunctions/fix/i16fixs.c | 19 ++++++ src/c/elementaryFunctions/fix/i8fixa.c | 19 ++++++ src/c/elementaryFunctions/fix/i8fixs.c | 21 +++++++ src/c/elementaryFunctions/fix/u16fixa.c | 19 ++++++ src/c/elementaryFunctions/fix/u16fixs.c | 21 +++++++ src/c/elementaryFunctions/fix/u8fixa.c | 19 ++++++ src/c/elementaryFunctions/fix/u8fixs.c | 21 +++++++ src/c/elementaryFunctions/floor/i16floora.c | 19 ++++++ src/c/elementaryFunctions/floor/i16floors.c | 18 ++++++ src/c/elementaryFunctions/floor/i8floora.c | 19 ++++++ src/c/elementaryFunctions/floor/i8floors.c | 18 ++++++ src/c/elementaryFunctions/floor/u16floora.c | 19 ++++++ src/c/elementaryFunctions/floor/u16floors.c | 18 ++++++ src/c/elementaryFunctions/floor/u8floora.c | 19 ++++++ src/c/elementaryFunctions/floor/u8floors.c | 18 ++++++ src/c/elementaryFunctions/includes/ceil.h | 17 ++++++ src/c/elementaryFunctions/includes/cosh.h | 8 +-- src/c/elementaryFunctions/includes/fix.h | 17 ++++++ src/c/elementaryFunctions/includes/floor.h | 17 ++++++ src/c/elementaryFunctions/includes/round.h | 17 ++++++ src/c/elementaryFunctions/interfaces/int_ceil.h | 16 ++++++ src/c/elementaryFunctions/interfaces/int_fix.h | 16 ++++++ src/c/elementaryFunctions/interfaces/int_floor.h | 16 ++++++ src/c/elementaryFunctions/interfaces/int_round.h | 16 ++++++ src/c/elementaryFunctions/round/i16rounda.c | 20 +++++++ src/c/elementaryFunctions/round/i16rounds.c | 23 ++++++++ src/c/elementaryFunctions/round/i8rounda.c | 20 +++++++ src/c/elementaryFunctions/round/i8rounds.c | 23 ++++++++ src/c/elementaryFunctions/round/u16rounda.c | 20 +++++++ src/c/elementaryFunctions/round/u16rounds.c | 23 ++++++++ src/c/elementaryFunctions/round/u8rounda.c | 20 +++++++ src/c/elementaryFunctions/round/u8rounds.c | 23 ++++++++ src/c/matrixOperations/interfaces/int_ones.h | 2 +- src/c/matrixOperations/interfaces/int_zeros.h | 8 +-- src/c/operations/interfaces/int_OpLogAnd.h | 57 ++++++++++++++++++ src/c/operations/interfaces/int_OpLogEq.h | 44 +++++++++++++- src/c/operations/interfaces/int_OpLogGe.h | 60 +++++++++++++++++++ src/c/operations/interfaces/int_OpLogGt.h | 53 +++++++++++++++++ src/c/operations/interfaces/int_OpLogLe.h | 54 ++++++++++++++++- src/c/operations/interfaces/int_OpLogLt.h | 54 ++++++++++++++++- src/c/operations/interfaces/int_OpLogNe.h | 38 ++++++++++++ src/c/operations/interfaces/int_OpLogOr.h | 55 ++++++++++++++++++ .../cmd_analog_in/u8cmd_analog_ins.c | 19 ++++++ .../cmd_analog_out/u8cmd_analog_outs.c | 20 +++++++ .../cmd_digital_in/u8cmd_digital_ins.c | 19 ++++++ .../cmd_digital_out/u8cmd_digital_outs.c | 20 +++++++ src/c/scilab-arduino/includes/cmd_analog_in.h | 29 ++++++++++ src/c/scilab-arduino/includes/cmd_analog_out.h | 29 ++++++++++ src/c/scilab-arduino/includes/cmd_digital_in.h | 29 ++++++++++ src/c/scilab-arduino/includes/cmd_digital_out.h | 29 ++++++++++ src/c/scilab-arduino/includes/sleep.h | 29 ++++++++++ .../scilab-arduino/interfaces/int_cmd_analog_in.h | 30 ++++++++++ .../scilab-arduino/interfaces/int_cmd_analog_out.h | 30 ++++++++++ .../scilab-arduino/interfaces/int_cmd_digital_in.h | 30 ++++++++++ .../interfaces/int_cmd_digital_out.h | 30 ++++++++++ src/c/scilab-arduino/interfaces/int_sleep.h | 29 ++++++++++ src/c/scilab-arduino/sleep/u16sleeps.c | 20 +++++++ src/c/type/int_imag.h | 16 ++++++ src/c/type/int_real.h | 23 ++++++++ 83 files changed, 1895 insertions(+), 60 deletions(-) create mode 100644 src/c/auxiliaryFunctions/abs/i16absa.c create mode 100644 src/c/auxiliaryFunctions/abs/i16abss.c create mode 100644 src/c/auxiliaryFunctions/abs/i8absa.c create mode 100644 src/c/auxiliaryFunctions/abs/i8abss.c create mode 100644 src/c/auxiliaryFunctions/abs/u16absa.c create mode 100644 src/c/auxiliaryFunctions/abs/u16abss.c create mode 100644 src/c/auxiliaryFunctions/abs/u8absa.c create mode 100644 src/c/auxiliaryFunctions/abs/u8abss.c create mode 100644 src/c/elementaryFunctions/ceil/i16ceila.c create mode 100644 src/c/elementaryFunctions/ceil/i16ceils.c create mode 100644 src/c/elementaryFunctions/ceil/i8ceila.c create mode 100644 src/c/elementaryFunctions/ceil/i8ceils.c create mode 100644 src/c/elementaryFunctions/ceil/u16ceila.c create mode 100644 src/c/elementaryFunctions/ceil/u16ceils.c create mode 100644 src/c/elementaryFunctions/ceil/u8ceila.c create mode 100644 src/c/elementaryFunctions/ceil/u8ceils.c create mode 100644 src/c/elementaryFunctions/fix/i16fixa.c create mode 100644 src/c/elementaryFunctions/fix/i16fixs.c create mode 100644 src/c/elementaryFunctions/fix/i8fixa.c create mode 100644 src/c/elementaryFunctions/fix/i8fixs.c create mode 100644 src/c/elementaryFunctions/fix/u16fixa.c create mode 100644 src/c/elementaryFunctions/fix/u16fixs.c create mode 100644 src/c/elementaryFunctions/fix/u8fixa.c create mode 100644 src/c/elementaryFunctions/fix/u8fixs.c create mode 100644 src/c/elementaryFunctions/floor/i16floora.c create mode 100644 src/c/elementaryFunctions/floor/i16floors.c create mode 100644 src/c/elementaryFunctions/floor/i8floora.c create mode 100644 src/c/elementaryFunctions/floor/i8floors.c create mode 100644 src/c/elementaryFunctions/floor/u16floora.c create mode 100644 src/c/elementaryFunctions/floor/u16floors.c create mode 100644 src/c/elementaryFunctions/floor/u8floora.c create mode 100644 src/c/elementaryFunctions/floor/u8floors.c create mode 100644 src/c/elementaryFunctions/round/i16rounda.c create mode 100644 src/c/elementaryFunctions/round/i16rounds.c create mode 100644 src/c/elementaryFunctions/round/i8rounda.c create mode 100644 src/c/elementaryFunctions/round/i8rounds.c create mode 100644 src/c/elementaryFunctions/round/u16rounda.c create mode 100644 src/c/elementaryFunctions/round/u16rounds.c create mode 100644 src/c/elementaryFunctions/round/u8rounda.c create mode 100644 src/c/elementaryFunctions/round/u8rounds.c create mode 100644 src/c/scilab-arduino/cmd_analog_in/u8cmd_analog_ins.c create mode 100644 src/c/scilab-arduino/cmd_analog_out/u8cmd_analog_outs.c create mode 100644 src/c/scilab-arduino/cmd_digital_in/u8cmd_digital_ins.c create mode 100644 src/c/scilab-arduino/cmd_digital_out/u8cmd_digital_outs.c create mode 100644 src/c/scilab-arduino/includes/cmd_analog_in.h create mode 100644 src/c/scilab-arduino/includes/cmd_analog_out.h create mode 100644 src/c/scilab-arduino/includes/cmd_digital_in.h create mode 100644 src/c/scilab-arduino/includes/cmd_digital_out.h create mode 100644 src/c/scilab-arduino/includes/sleep.h create mode 100644 src/c/scilab-arduino/interfaces/int_cmd_analog_in.h create mode 100644 src/c/scilab-arduino/interfaces/int_cmd_analog_out.h create mode 100644 src/c/scilab-arduino/interfaces/int_cmd_digital_in.h create mode 100644 src/c/scilab-arduino/interfaces/int_cmd_digital_out.h create mode 100644 src/c/scilab-arduino/interfaces/int_sleep.h create mode 100644 src/c/scilab-arduino/sleep/u16sleeps.c (limited to 'src') diff --git a/src/c/auxiliaryFunctions/abs/i16absa.c b/src/c/auxiliaryFunctions/abs/i16absa.c new file mode 100644 index 0000000..ad37cee --- /dev/null +++ b/src/c/auxiliaryFunctions/abs/i16absa.c @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007 - 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 "abs.h" + +void i16absa(int16 *in, int size, int16* out) { + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = i16abss(in[i]); + } +} diff --git a/src/c/auxiliaryFunctions/abs/i16abss.c b/src/c/auxiliaryFunctions/abs/i16abss.c new file mode 100644 index 0000000..591ab8d --- /dev/null +++ b/src/c/auxiliaryFunctions/abs/i16abss.c @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007 - 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 "abs.h" + +int16 i16abss(int16 num) { + if (num >= 0) { + return num; + } + return -num; +} diff --git a/src/c/auxiliaryFunctions/abs/i8absa.c b/src/c/auxiliaryFunctions/abs/i8absa.c new file mode 100644 index 0000000..2f015f2 --- /dev/null +++ b/src/c/auxiliaryFunctions/abs/i8absa.c @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007 - 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 "abs.h" + +void i8absa(int8 *in, int size, int8* out) { + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = i8abss(in[i]); + } +} diff --git a/src/c/auxiliaryFunctions/abs/i8abss.c b/src/c/auxiliaryFunctions/abs/i8abss.c new file mode 100644 index 0000000..7c3d707 --- /dev/null +++ b/src/c/auxiliaryFunctions/abs/i8abss.c @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007 - 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 "abs.h" + +int8 i8abss(int8 num) { + if (num >= 0) { + return num; + } + return -num; +} diff --git a/src/c/auxiliaryFunctions/abs/u16absa.c b/src/c/auxiliaryFunctions/abs/u16absa.c new file mode 100644 index 0000000..5bc1d14 --- /dev/null +++ b/src/c/auxiliaryFunctions/abs/u16absa.c @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007 - 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 "abs.h" + +void u16absa(uint16 *in, int size, uint16* out) { + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = u16abss(in[i]); + } +} diff --git a/src/c/auxiliaryFunctions/abs/u16abss.c b/src/c/auxiliaryFunctions/abs/u16abss.c new file mode 100644 index 0000000..056ca80 --- /dev/null +++ b/src/c/auxiliaryFunctions/abs/u16abss.c @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007 - 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 "abs.h" + +uint16 u16abss(uint16 num) { + if (num >= 0) { + return num; + } + return -num; +} diff --git a/src/c/auxiliaryFunctions/abs/u8absa.c b/src/c/auxiliaryFunctions/abs/u8absa.c new file mode 100644 index 0000000..cc649c8 --- /dev/null +++ b/src/c/auxiliaryFunctions/abs/u8absa.c @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007 - 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 "abs.h" + +void u8absa(uint8 *in, int size, uint8* out) { + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = u8abss(in[i]); + } +} diff --git a/src/c/auxiliaryFunctions/abs/u8abss.c b/src/c/auxiliaryFunctions/abs/u8abss.c new file mode 100644 index 0000000..45ea9a5 --- /dev/null +++ b/src/c/auxiliaryFunctions/abs/u8abss.c @@ -0,0 +1,20 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007 - 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 "abs.h" + +uint8 u8abss(uint8 num) { + if (num >= 0) { + return num; + } + return -num; +} diff --git a/src/c/auxiliaryFunctions/includes/abs.h b/src/c/auxiliaryFunctions/includes/abs.h index 00565e3..cd02290 100644 --- a/src/c/auxiliaryFunctions/includes/abs.h +++ b/src/c/auxiliaryFunctions/includes/abs.h @@ -17,6 +17,7 @@ #include "floatComplex.h" #include "doubleComplex.h" #include "sqrt.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -54,6 +55,38 @@ EXTERN_AUXFUNCT float cabss(floatComplex in); **/ EXTERN_AUXFUNCT double zabss(doubleComplex in); +/** + ** \brief Uint8 Absolute Value function + ** Determine the absolute value of in. + ** \param in : the uint8 we must determine abs. + ** \return -in or in depending on the sign of in. + **/ +EXTERN_AUXFUNCT uint8 u8abss(uint8 in); + +/** + ** \brief Int8 Absolute Value function + ** Determine the absolute value of in. + ** \param in : the int8 we must determine abs. + ** \return -in or in depending on the sign of in. + **/ +EXTERN_AUXFUNCT int8 i8abss(int8 in); + +/** + ** \brief Uint16 Absolute Value function + ** Determine the absolute value of in. + ** \param in : the uint16 we must determine abs. + ** \return -in or in depending on the sign of in. + **/ +EXTERN_AUXFUNCT uint16 u16abss(uint16 in); + +/** + ** \brief Int16 Absolute Value function + ** Determine the absolute value of in. + ** \param in : the int16 we must determine abs. + ** \return -in or in depending on the sign of in. + **/ +EXTERN_AUXFUNCT int16 i16abss(int16 in); + /** ** \brief Float Array Absolute Value function ** Determine the absolute value of in elements. @@ -86,6 +119,40 @@ EXTERN_AUXFUNCT void cabsa(floatComplex *in, int size, float* out); **/ EXTERN_AUXFUNCT void zabsa(doubleComplex *in, int size, double* out); + +/** + ** \brief Uint8 Array Absolute Value function + ** Determine the absolute value of in elements. + ** \param in : the uint8 array we must determine abs. + ** \param out : the uint8 array result. + **/ +EXTERN_AUXFUNCT void u8absa(uint8 *in, int size, uint8* out); + +/** + ** \brief Int8 Array Absolute Value function + ** Determine the absolute value of in elements. + ** \param in : the int8 array we must determine abs. + ** \param out : the int8 array result. + **/ +EXTERN_AUXFUNCT void i8absa(int8 *in, int size, int8* out); + +/** + ** \brief Uint16 Array Absolute Value function + ** Determine the absolute value of in elements. + ** \param in : the uint16 array we must determine abs. + ** \param out : the uint16 array result. + **/ +EXTERN_AUXFUNCT void u16absa(uint16 *in, int size, uint16* out); + +/** + ** \brief Int16 Array Absolute Value function + ** Determine the absolute value of in elements. + ** \param in : the int16 array we must determine abs. + ** \param out : the int16 array result. + **/ +EXTERN_AUXFUNCT void i16absa(int16 *in, int size, int16* out); + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/c/auxiliaryFunctions/interfaces/int_abs.h b/src/c/auxiliaryFunctions/interfaces/int_abs.h index 4c353fe..70a428c 100644 --- a/src/c/auxiliaryFunctions/interfaces/int_abs.h +++ b/src/c/auxiliaryFunctions/interfaces/int_abs.h @@ -23,6 +23,14 @@ #define z0absd0(in) zabss(in) +#define u80absu80(in) u8abss(in) + +#define i80absi80(in) i8abss(in) + +#define u160absu160(in) u16abss(in) + +#define i160absi160(in) i16abss(in) + #define s2abss2(in,size,out) sabsa(in, size[0]*size[1], out) #define d2absd2(in,size,out) dabsa(in, size[0]*size[1], out) @@ -31,4 +39,12 @@ #define z2absd2(in,size,out) zabsa(in, size[0]*size[1], out) +#define u82absu82(in,size,out) u8absa(in, size[0]*size[1], out) + +#define i82absi82(in,size,out) i8absa(in, size[0]*size[1], out) + +#define u162absu162(in,size,out) u16absa(in, size[0]*size[1], out) + +#define i162absi162(in,size,out) i16absa(in, size[0]*size[1], out) + #endif /* !__INT_ABS_H__ */ diff --git a/src/c/auxiliaryFunctions/interfaces/int_conj.h b/src/c/auxiliaryFunctions/interfaces/int_conj.h index f54de24..fec555b 100644 --- a/src/c/auxiliaryFunctions/interfaces/int_conj.h +++ b/src/c/auxiliaryFunctions/interfaces/int_conj.h @@ -25,6 +25,14 @@ #define z0conjz0(in) zconjs(in) +#define u80conju80(in) in + +#define i80conji80(in) in + +#define u160conju160(in) in + +#define i160conji160(in) in + #define s2conjs2(in,size,out) copy(in,size,out) #define d2conjd2(in,size,out) copy(in,size,out) @@ -33,4 +41,12 @@ #define z2conjz2(in,size,out) zconja(in, size[0]*size[1], out) +#define u82conju82(in,size,out) copy(in,size,out) + +#define i82conji82(in,size,out) copy(in,size,out) + +#define u162conju162(in,size,out) copy(in,size,out) + +#define i162conji162(in,size,out) copy(in,size,out) + #endif /* !__INT_CONJ_H__ */ diff --git a/src/c/elementaryFunctions/ceil/i16ceila.c b/src/c/elementaryFunctions/ceil/i16ceila.c new file mode 100644 index 0000000..a960fa8 --- /dev/null +++ b/src/c/elementaryFunctions/ceil/i16ceila.c @@ -0,0 +1,19 @@ +/* + * 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 +#include "ceil.h" + +void i16ceila(int16* x, int size, int16* out) { + int i = 0; + for (i=0;i +#include "ceil.h" + +int16 i16ceils(int16 x) { + return (int16)(ceilf(x)); +} diff --git a/src/c/elementaryFunctions/ceil/i8ceila.c b/src/c/elementaryFunctions/ceil/i8ceila.c new file mode 100644 index 0000000..3308174 --- /dev/null +++ b/src/c/elementaryFunctions/ceil/i8ceila.c @@ -0,0 +1,19 @@ +/* + * 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 +#include "ceil.h" + +void i8ceila(int8* x, int size, int8* out) { + int i = 0; + for (i=0;i +#include "ceil.h" + +int8 i8ceils(int8 x) { + return (int8)(ceilf(x)); +} diff --git a/src/c/elementaryFunctions/ceil/u16ceila.c b/src/c/elementaryFunctions/ceil/u16ceila.c new file mode 100644 index 0000000..c7e83df --- /dev/null +++ b/src/c/elementaryFunctions/ceil/u16ceila.c @@ -0,0 +1,19 @@ +/* + * 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 +#include "ceil.h" + +void u16ceila(uint16* x, int size, uint16* out) { + int i = 0; + for (i=0;i +#include "ceil.h" + +uint16 u16ceils(uint16 x) { + return (uint16)(ceilf(x)); +} diff --git a/src/c/elementaryFunctions/ceil/u8ceila.c b/src/c/elementaryFunctions/ceil/u8ceila.c new file mode 100644 index 0000000..3bb4ca9 --- /dev/null +++ b/src/c/elementaryFunctions/ceil/u8ceila.c @@ -0,0 +1,19 @@ +/* + * 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 +#include "ceil.h" + +void u8ceila(uint8* x, int size, uint8* out) { + int i = 0; + for (i=0;i +#include "ceil.h" + +uint8 u8ceils(uint8 x) { + return (uint8)(ceilf(x)); +} diff --git a/src/c/elementaryFunctions/cosh/i16cosha.c b/src/c/elementaryFunctions/cosh/i16cosha.c index 8515bc7..eb2e9f9 100644 --- a/src/c/elementaryFunctions/cosh/i16cosha.c +++ b/src/c/elementaryFunctions/cosh/i16cosha.c @@ -1,6 +1,6 @@ /* * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET * * This file must be used under the terms of the CeCILL. * This source file is licensed as described in the file COPYING, which @@ -10,17 +10,11 @@ * */ -/* -// cosh(z) = 0.5 (exp(|z|) + exp(-|z|)) -// = 0.5 ( y + 1/y ) with y = exp(|z|) -*/ - -#include #include "cosh.h" -#include "exp.h" -#include "abs.h" -float i16coshs(int16 x) { - float y = i16exps(i16abss(x)); - return (0.5f * (y + 1.0f / y)); +void i16cosha(int16* x, int size, int16* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = i16coshs(x[i]); + } } diff --git a/src/c/elementaryFunctions/cosh/i8cosha.c b/src/c/elementaryFunctions/cosh/i8cosha.c index b30c14e..beed9b3 100644 --- a/src/c/elementaryFunctions/cosh/i8cosha.c +++ b/src/c/elementaryFunctions/cosh/i8cosha.c @@ -1,6 +1,6 @@ /* * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET * * This file must be used under the terms of the CeCILL. * This source file is licensed as described in the file COPYING, which @@ -10,17 +10,11 @@ * */ -/* -// cosh(z) = 0.5 (exp(|z|) + exp(-|z|)) -// = 0.5 ( y + 1/y ) with y = exp(|z|) -*/ - -#include #include "cosh.h" -#include "exp.h" -#include "abs.h" -float i8coshs(int8 x) { - float y = i8exps(i8abss(x)); - return (0.5f * (y + 1.0f / y)); +void i8cosha(int8* x, int size, int8* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = i8coshs(x[i]); + } } diff --git a/src/c/elementaryFunctions/cosh/u16cosha.c b/src/c/elementaryFunctions/cosh/u16cosha.c index 775f710..e0c4183 100644 --- a/src/c/elementaryFunctions/cosh/u16cosha.c +++ b/src/c/elementaryFunctions/cosh/u16cosha.c @@ -1,6 +1,6 @@ /* * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET * * This file must be used under the terms of the CeCILL. * This source file is licensed as described in the file COPYING, which @@ -10,17 +10,11 @@ * */ -/* -// cosh(z) = 0.5 (exp(|z|) + exp(-|z|)) -// = 0.5 ( y + 1/y ) with y = exp(|z|) -*/ - -#include #include "cosh.h" -#include "exp.h" -#include "abs.h" -float u16coshs(uint16 x) { - float y = u16exps(u16abss(x)); - return (0.5f * (y + 1.0f / y)); +void u16cosha(uint16* x, int size, uint16* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = u16coshs(x[i]); + } } diff --git a/src/c/elementaryFunctions/cosh/u8cosha.c b/src/c/elementaryFunctions/cosh/u8cosha.c index b6d614f..9584b3e 100644 --- a/src/c/elementaryFunctions/cosh/u8cosha.c +++ b/src/c/elementaryFunctions/cosh/u8cosha.c @@ -1,6 +1,6 @@ /* * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * Copyright (C) 2006-2008 - INRIA - Bruno JOFRET * * This file must be used under the terms of the CeCILL. * This source file is licensed as described in the file COPYING, which @@ -10,17 +10,11 @@ * */ -/* -// cosh(z) = 0.5 (exp(|z|) + exp(-|z|)) -// = 0.5 ( y + 1/y ) with y = exp(|z|) -*/ - -#include #include "cosh.h" -#include "exp.h" -#include "abs.h" -float u8coshs(uint8 x) { - float y = u8exps(u8abss(x)); - return (0.5f * (y + 1.0f / y)); +void u8cosha(uint8* x, int size, uint8* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = u8coshs(x[i]); + } } diff --git a/src/c/elementaryFunctions/fix/i16fixa.c b/src/c/elementaryFunctions/fix/i16fixa.c new file mode 100644 index 0000000..2ccb933 --- /dev/null +++ b/src/c/elementaryFunctions/fix/i16fixa.c @@ -0,0 +1,21 @@ +/* + * 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 +#include "fix.h" +#include "floor.h" +#include "ceil.h" + +void i16fixa(int16* x, int size, int16* out) { + int i = 0; + for (i=0;i +#include "fix.h" + +int16 i16fixs(int16 x) { + if (x>=0) return i16floors(x); + else return i16ceils(x); +} diff --git a/src/c/elementaryFunctions/fix/i8fixa.c b/src/c/elementaryFunctions/fix/i8fixa.c new file mode 100644 index 0000000..4e913a3 --- /dev/null +++ b/src/c/elementaryFunctions/fix/i8fixa.c @@ -0,0 +1,19 @@ +/* + * 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 +#include "fix.h" + +void i8fixa(int8* x, int size, int8* out) { + int i = 0; + for (i=0;i +#include "fix.h" +#include "floor.h" +#include "ceil.h" + +int8 i8fixs(int8 x) { + if (x>=0) return i8floors(x); + else return i8ceils(x); +} diff --git a/src/c/elementaryFunctions/fix/u16fixa.c b/src/c/elementaryFunctions/fix/u16fixa.c new file mode 100644 index 0000000..5798300 --- /dev/null +++ b/src/c/elementaryFunctions/fix/u16fixa.c @@ -0,0 +1,19 @@ +/* + * 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 +#include "fix.h" + +void u16fixa(uint16* x, int size, uint16* out) { + int i = 0; + for (i=0;i +#include "fix.h" +#include "floor.h" +#include "ceil.h" + +uint16 u16fixs(uint16 x) { + if (x>=0) return u16floors(x); + else return u16ceils(x); +} diff --git a/src/c/elementaryFunctions/fix/u8fixa.c b/src/c/elementaryFunctions/fix/u8fixa.c new file mode 100644 index 0000000..2a3bd3b --- /dev/null +++ b/src/c/elementaryFunctions/fix/u8fixa.c @@ -0,0 +1,19 @@ +/* + * 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 +#include "fix.h" + +void u8fixa(uint8* x, int size, uint8* out) { + int i = 0; + for (i=0;i +#include "fix.h" +#include "floor.h" +#include "ceil.h" + +uint8 u8fixs(uint8 x) { + if (x>=0) return u8floors(x); + else return u8ceils(x); +} diff --git a/src/c/elementaryFunctions/floor/i16floora.c b/src/c/elementaryFunctions/floor/i16floora.c new file mode 100644 index 0000000..69140b0 --- /dev/null +++ b/src/c/elementaryFunctions/floor/i16floora.c @@ -0,0 +1,19 @@ +/* + * 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 +#include "floor.h" + +void i16floora(int16* x, int size, int16* out) { + int i = 0; + for (i=0;i +#include "floor.h" + +int16 i16floors(int16 x) { + return (int16)(floorf(x)); +} diff --git a/src/c/elementaryFunctions/floor/i8floora.c b/src/c/elementaryFunctions/floor/i8floora.c new file mode 100644 index 0000000..0554f1e --- /dev/null +++ b/src/c/elementaryFunctions/floor/i8floora.c @@ -0,0 +1,19 @@ +/* + * 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 +#include "floor.h" + +void i8floora(int8* x, int size, int8* out) { + int i = 0; + for (i=0;i +#include "floor.h" + +int8 i8floors(int8 x) { + return (int8)(floorf(x)); +} diff --git a/src/c/elementaryFunctions/floor/u16floora.c b/src/c/elementaryFunctions/floor/u16floora.c new file mode 100644 index 0000000..56e35ca --- /dev/null +++ b/src/c/elementaryFunctions/floor/u16floora.c @@ -0,0 +1,19 @@ +/* + * 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 +#include "floor.h" + +void u16floora(uint16* x, int size, uint16* out) { + int i = 0; + for (i=0;i +#include "floor.h" + +uint16 u16floors(uint16 x) { + return (uint16)(floorf(x)); +} diff --git a/src/c/elementaryFunctions/floor/u8floora.c b/src/c/elementaryFunctions/floor/u8floora.c new file mode 100644 index 0000000..ace7ff7 --- /dev/null +++ b/src/c/elementaryFunctions/floor/u8floora.c @@ -0,0 +1,19 @@ +/* + * 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 +#include "floor.h" + +void u8floora(uint8* x, int size, uint8* out) { + int i = 0; + for (i=0;i +#include "floor.h" + +uint8 u8floors(uint8 x) { + return (uint8)(floorf(x)); +} diff --git a/src/c/elementaryFunctions/includes/ceil.h b/src/c/elementaryFunctions/includes/ceil.h index 960b8b3..57df72d 100644 --- a/src/c/elementaryFunctions/includes/ceil.h +++ b/src/c/elementaryFunctions/includes/ceil.h @@ -16,6 +16,7 @@ #include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus @@ -33,6 +34,14 @@ EXTERN_ELEMFUNCT floatComplex cceils(floatComplex in); EXTERN_ELEMFUNCT doubleComplex zceils(doubleComplex in); +EXTERN_ELEMFUNCT uint8 u8ceils(uint8 in); + +EXTERN_ELEMFUNCT int8 i8ceils(int8 in); + +EXTERN_ELEMFUNCT uint16 u16ceils(uint16 in); + +EXTERN_ELEMFUNCT int16 i16ceils(int16 in); + EXTERN_ELEMFUNCT void sceila(float* in, int size, float* out); EXTERN_ELEMFUNCT void dceila(double* in, int size, double* out); @@ -41,6 +50,14 @@ EXTERN_ELEMFUNCT void cceila(floatComplex* in, int size, floatComplex* out); EXTERN_ELEMFUNCT void zceila(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void u8ceila(uint8* in, int size, uint8* out); + +EXTERN_ELEMFUNCT void i8ceila(int8* in, int size, int8* out); + +EXTERN_ELEMFUNCT void u16ceila(uint16* in, int size, uint16* out); + +EXTERN_ELEMFUNCT void i16ceila(int16* in, int size, int16* out); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/c/elementaryFunctions/includes/cosh.h b/src/c/elementaryFunctions/includes/cosh.h index e084e42..5c7c8b7 100644 --- a/src/c/elementaryFunctions/includes/cosh.h +++ b/src/c/elementaryFunctions/includes/cosh.h @@ -112,7 +112,7 @@ EXTERN_ELEMFUNCT void zcosha(doubleComplex* in, int size, doubleComplex* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -EXTERN_ELEMFUNCT void u8cosha(uint8* in, int size, float* out); +EXTERN_ELEMFUNCT void u8cosha(uint8* in, int size, uint8* out); /* ** \brief Int8 Matrix Cosine function @@ -120,7 +120,7 @@ EXTERN_ELEMFUNCT void u8cosha(uint8* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -EXTERN_ELEMFUNCT void i8cosha(int8* in, int size, float* out); +EXTERN_ELEMFUNCT void i8cosha(int8* in, int size, int8* out); /* ** \brief Uint16 Matrix Cosine function @@ -128,7 +128,7 @@ EXTERN_ELEMFUNCT void i8cosha(int8* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -EXTERN_ELEMFUNCT void u16cosha(uint16* in, int size, float* out); +EXTERN_ELEMFUNCT void u16cosha(uint16* in, int size, uint16* out); /* ** \brief Int16 Matrix Cosine function @@ -136,7 +136,7 @@ EXTERN_ELEMFUNCT void u16cosha(uint16* in, int size, float* out); ** \param out : output array value. ** \param size : the size of in and out arrays. */ -EXTERN_ELEMFUNCT void i16cosha(int16* in, int size, float* out); +EXTERN_ELEMFUNCT void i16cosha(int16* in, int size, int16* out); #ifdef __cplusplus diff --git a/src/c/elementaryFunctions/includes/fix.h b/src/c/elementaryFunctions/includes/fix.h index 504a63c..d3e7f88 100644 --- a/src/c/elementaryFunctions/includes/fix.h +++ b/src/c/elementaryFunctions/includes/fix.h @@ -16,6 +16,7 @@ #include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -35,6 +36,14 @@ EXTERN_ELEMFUNCT floatComplex cfixs(floatComplex in); EXTERN_ELEMFUNCT doubleComplex zfixs(doubleComplex in); +EXTERN_ELEMFUNCT uint8 u8fixs(uint8 in); + +EXTERN_ELEMFUNCT int8 i8fixs(int8 in); + +EXTERN_ELEMFUNCT uint16 u16fixs(uint16 in); + +EXTERN_ELEMFUNCT int16 i16fixs(int16 in); + EXTERN_ELEMFUNCT void sfixa(float* in, int size, float* out); EXTERN_ELEMFUNCT void dfixa(double* in, int size, double* out); @@ -43,6 +52,14 @@ EXTERN_ELEMFUNCT void cfixa(floatComplex* in, int size, floatComplex* out); EXTERN_ELEMFUNCT void zfixa(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void u8fixa(uint8* in, int size, uint8* out); + +EXTERN_ELEMFUNCT void i8fixa(int8* in, int size, int8* out); + +EXTERN_ELEMFUNCT void u16fixa(uint16* in, int size, uint16* out); + +EXTERN_ELEMFUNCT void i16fixa(int16* in, int size, int16* out); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/c/elementaryFunctions/includes/floor.h b/src/c/elementaryFunctions/includes/floor.h index 971cdf6..cd56641 100644 --- a/src/c/elementaryFunctions/includes/floor.h +++ b/src/c/elementaryFunctions/includes/floor.h @@ -16,6 +16,7 @@ #include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -32,6 +33,14 @@ EXTERN_ELEMFUNCT floatComplex cfloors(floatComplex in); EXTERN_ELEMFUNCT doubleComplex zfloors(doubleComplex in); +EXTERN_ELEMFUNCT uint8 u8floors(uint8 in); + +EXTERN_ELEMFUNCT int8 i8floors(int8 in); + +EXTERN_ELEMFUNCT uint16 u16floors(uint16 in); + +EXTERN_ELEMFUNCT int16 i16floors(int16 in); + EXTERN_ELEMFUNCT void sfloora(float* in, int size, float* out); EXTERN_ELEMFUNCT void dfloora(double* in, int size, double* out); @@ -40,6 +49,14 @@ EXTERN_ELEMFUNCT void cfloora(floatComplex* in, int size, floatComplex* out); EXTERN_ELEMFUNCT void zfloora(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void u8floora(uint8* in, int size, uint8* out); + +EXTERN_ELEMFUNCT void i8floora(int8* in, int size, int8* out); + +EXTERN_ELEMFUNCT void u16floora(uint16* in, int size, uint16* out); + +EXTERN_ELEMFUNCT void i16floora(int16* in, int size, int16* out); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/c/elementaryFunctions/includes/round.h b/src/c/elementaryFunctions/includes/round.h index 1c3c0ce..6894265 100644 --- a/src/c/elementaryFunctions/includes/round.h +++ b/src/c/elementaryFunctions/includes/round.h @@ -16,6 +16,7 @@ #include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -32,6 +33,14 @@ EXTERN_ELEMFUNCT floatComplex crounds(floatComplex in); EXTERN_ELEMFUNCT doubleComplex zrounds(doubleComplex in); +EXTERN_ELEMFUNCT uint8 u8rounds(uint8 in); + +EXTERN_ELEMFUNCT int8 i8rounds(int8 in); + +EXTERN_ELEMFUNCT uint16 u16rounds(uint16 in); + +EXTERN_ELEMFUNCT int16 i16rounds(int16 in); + EXTERN_ELEMFUNCT void srounda(float* in, int size, float* out); EXTERN_ELEMFUNCT void drounda(double* in, int size, double* out); @@ -40,6 +49,14 @@ EXTERN_ELEMFUNCT void crounda(floatComplex* in, int size, floatComplex* out); EXTERN_ELEMFUNCT void zrounda(doubleComplex* in, int size, doubleComplex* out); +EXTERN_ELEMFUNCT void u8rounda(uint8* in, int size, uint8* out); + +EXTERN_ELEMFUNCT void i8rounda(int8* in, int size, int8* out); + +EXTERN_ELEMFUNCT void u16rounda(uint16* in, int size, uint16* out); + +EXTERN_ELEMFUNCT void i16rounda(int16* in, int size, int16* out); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/c/elementaryFunctions/interfaces/int_ceil.h b/src/c/elementaryFunctions/interfaces/int_ceil.h index 918dd5a..33c0176 100644 --- a/src/c/elementaryFunctions/interfaces/int_ceil.h +++ b/src/c/elementaryFunctions/interfaces/int_ceil.h @@ -23,6 +23,14 @@ #define z0ceilz0(in) zceils(in) +#define u80ceilu80(in) u8ceils(in) + +#define i80ceili80(in) i8ceils(in) + +#define u160ceilu160(in) u16ceils(in) + +#define i160ceili160(in) i16ceils(in) + #define s2ceils2(in,size,out) sceila(in, size[0]*size[1], out) #define d2ceild2(in,size,out) dceila(in, size[0]*size[1], out) @@ -31,4 +39,12 @@ #define z2ceilz2(in,size,out) zceila(in, size[0]*size[1], out) +#define u82ceilu82(in,size,out) u8ceila(in, size[0]*size[1], out) + +#define i82ceili82(in,size,out) i8ceila(in, size[0]*size[1], out) + +#define u162ceilu162(in,size,out) u16ceila(in, size[0]*size[1], out) + +#define i162ceili162(in,size,out) i16ceila(in, size[0]*size[1], out) + #endif /* !__INT_CEIL_H__ */ diff --git a/src/c/elementaryFunctions/interfaces/int_fix.h b/src/c/elementaryFunctions/interfaces/int_fix.h index ac483c9..2a00e2c 100644 --- a/src/c/elementaryFunctions/interfaces/int_fix.h +++ b/src/c/elementaryFunctions/interfaces/int_fix.h @@ -23,6 +23,14 @@ #define z0fixz0(in) zfixs(in) +#define u80fixu80(in) u8fixs(in) + +#define i80fixi80(in) i8fixs(in) + +#define u160fixu160(in) u16fixs(in) + +#define i160fixi160(in) i16fixs(in) + #define s2fixs2(in,size,out) sfixa(in, size[0]*size[1], out) #define d2fixd2(in,size,out) dfixa(in, size[0]*size[1], out) @@ -31,4 +39,12 @@ #define z2fixz2(in,size,out) zfixa(in, size[0]*size[1], out) +#define u82fixu82(in,size,out) u8fixa(in, size[0]*size[1], out) + +#define i82fixi82(in,size,out) i8fixa(in, size[0]*size[1], out) + +#define u162fixu162(in,size,out) u16fixa(in, size[0]*size[1], out) + +#define i162fixi162(in,size,out) i16fixa(in, size[0]*size[1], out) + #endif /* !__INT_FIX_H__ */ diff --git a/src/c/elementaryFunctions/interfaces/int_floor.h b/src/c/elementaryFunctions/interfaces/int_floor.h index 548c5e2..639819a 100644 --- a/src/c/elementaryFunctions/interfaces/int_floor.h +++ b/src/c/elementaryFunctions/interfaces/int_floor.h @@ -23,6 +23,14 @@ #define z0floorz0(in) zfloors(in) +#define u80flooru80(in) u8floors(in) + +#define i80floori80(in) i8floors(in) + +#define u160flooru160(in) u16floors(in) + +#define i160floori160(in) i16floors(in) + #define s2floors2(in,size,out) sfloora(in, size[0]*size[1], out) #define d2floord2(in,size,out) dfloora(in, size[0]*size[1], out) @@ -31,4 +39,12 @@ #define z2floorz2(in,size,out) zfloora(in, size[0]*size[1], out) +#define u82flooru82(in,size,out) u8floora(in, size[0]*size[1], out) + +#define i82floori82(in,size,out) i8floora(in, size[0]*size[1], out) + +#define u162flooru162(in,size,out) u16floora(in, size[0]*size[1], out) + +#define i162floori162(in,size,out) i16floora(in, size[0]*size[1], out) + #endif /* !__INT_FLOOR_H__ */ diff --git a/src/c/elementaryFunctions/interfaces/int_round.h b/src/c/elementaryFunctions/interfaces/int_round.h index a5da230..7d013c1 100644 --- a/src/c/elementaryFunctions/interfaces/int_round.h +++ b/src/c/elementaryFunctions/interfaces/int_round.h @@ -23,6 +23,14 @@ #define z0roundz0(in) zrounds(in) +#define u80roundu80(in) u8rounds(in) + +#define i80roundi80(in) i8rounds(in) + +#define u160roundu160(in) u16rounds(in) + +#define i160roundi160(in) i16rounds(in) + #define s2rounds2(in,size,out) srounda(in, size[0]*size[1], out) #define d2roundd2(in,size,out) drounda(in, size[0]*size[1], out) @@ -31,4 +39,12 @@ #define z2roundz2(in,size,out) zrounda(in, size[0]*size[1], out) +#define u82roundu82(in,size,out) u8rounda(in, size[0]*size[1], out) + +#define i82roundi82(in,size,out) i8rounda(in, size[0]*size[1], out) + +#define u162roundu162(in,size,out) u16rounda(in, size[0]*size[1], out) + +#define i162roundi162(in,size,out) i16rounda(in, size[0]*size[1], out) + #endif /* !__INT_ROUND_H__ */ diff --git a/src/c/elementaryFunctions/round/i16rounda.c b/src/c/elementaryFunctions/round/i16rounda.c new file mode 100644 index 0000000..5cacafa --- /dev/null +++ b/src/c/elementaryFunctions/round/i16rounda.c @@ -0,0 +1,20 @@ +/* + * 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 "round.h" + +void i16rounda(int16* x, int size, int16* out) { + int i=0; + + for (i=0;i=0) result = (int16)((float)x+0.5); + else result = (int16)((float)x-0.5); + + return (int16)result; +} diff --git a/src/c/elementaryFunctions/round/i8rounda.c b/src/c/elementaryFunctions/round/i8rounda.c new file mode 100644 index 0000000..c47be51 --- /dev/null +++ b/src/c/elementaryFunctions/round/i8rounda.c @@ -0,0 +1,20 @@ +/* + * 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 "round.h" + +void i8rounda(int8* x, int size, int8* out) { + int i=0; + + for (i=0;i=0) result = (int8)((float)x+0.5); + else result = (int8)((float)x-0.5); + + return (int8)result; +} diff --git a/src/c/elementaryFunctions/round/u16rounda.c b/src/c/elementaryFunctions/round/u16rounda.c new file mode 100644 index 0000000..38c4b28 --- /dev/null +++ b/src/c/elementaryFunctions/round/u16rounda.c @@ -0,0 +1,20 @@ +/* + * 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 "round.h" + +void u16rounda(uint16* x, int size, uint16* out) { + int i=0; + + for (i=0;i=0) result = (uint16)((float)x+0.5); + else result = (uint16)((float)x-0.5); + + return (uint16)result; +} diff --git a/src/c/elementaryFunctions/round/u8rounda.c b/src/c/elementaryFunctions/round/u8rounda.c new file mode 100644 index 0000000..e8f828d --- /dev/null +++ b/src/c/elementaryFunctions/round/u8rounda.c @@ -0,0 +1,20 @@ +/* + * 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 "round.h" + +void u8rounda(uint8* x, int size, uint8* out) { + int i=0; + + for (i=0;i=0) result = (uint8)((float)x+0.5); + else result = (uint8)((float)x-0.5); + + return (uint8)result; +} diff --git a/src/c/matrixOperations/interfaces/int_ones.h b/src/c/matrixOperations/interfaces/int_ones.h index 3946a48..e266ee5 100644 --- a/src/c/matrixOperations/interfaces/int_ones.h +++ b/src/c/matrixOperations/interfaces/int_ones.h @@ -64,7 +64,7 @@ #define i80i80onesi82(in1,in2,out) i8onesa(out, in1, in2) -#define u160u160onesu82(in1,in2,out) u16onesa(out, in1, in2) +#define u160u160onesu162(in1,in2,out) u16onesa(out, in1, in2) #define i160i160onesi162(in1,in2,out) i16onesa(out, in1, in2) diff --git a/src/c/matrixOperations/interfaces/int_zeros.h b/src/c/matrixOperations/interfaces/int_zeros.h index 0f97af0..ac7e020 100644 --- a/src/c/matrixOperations/interfaces/int_zeros.h +++ b/src/c/matrixOperations/interfaces/int_zeros.h @@ -61,13 +61,13 @@ #define d0d0zerosd2(in1,in2,out) dzerosa(out, in1, in2) -#define u80u80zeross2(in1,in2,out) u80zerosa(out, in1, in2) +#define u80u80zerosu82(in1,in2,out) u8zerosa(out, in1, in2) -#define i80i80zeross2(in1,in2,out) i80zerosa(out, in1, in2) +#define i80i80zerosi82(in1,in2,out) i8zerosa(out, in1, in2) -#define u160u160zeross2(in1,in2,out) u160zerosa(out, in1, in2) +#define u160u160zerosu162(in1,in2,out) u16zerosa(out, in1, in2) -#define i160i160zeross2(in1,in2,out) i160zerosa(out, in1, in2) +#define i160i160zerosi162(in1,in2,out) i16zerosa(out, in1, in2) #define s2zeross2(in,size,out) szerosa(out, size[0], size[1]) diff --git a/src/c/operations/interfaces/int_OpLogAnd.h b/src/c/operations/interfaces/int_OpLogAnd.h index 460c81c..50a3189 100644 --- a/src/c/operations/interfaces/int_OpLogAnd.h +++ b/src/c/operations/interfaces/int_OpLogAnd.h @@ -19,6 +19,14 @@ #define Bool2Double(in) ((in) ? 1.0 : 0.0) +#define Bool2Uint8(in) ((in) ? (uint8)1 : (uint8)0) + +#define Bool2Int8(in) ((in) ? (int8)1 : (int8)0) + +#define Bool2Uint16(in) ((in) ? (uint16)1 : (uint16)0) + +#define Bool2Int16(in) ((in) ? (int16)1 : (int16)0) + /*scalar and scalar*/ #define s0s0OpLogAnds0(in1, in2) Bool2Float(in1 != 0.0 && in2 != 0.0) @@ -38,6 +46,15 @@ #define z0d0OpLogAndd0(in1, in2) Bool2Double((zreals(in1) != 0.0 || zimags(in1) != 0.0) && in2 != 0.0) +#define u80u80OpLogAndu80(in1, in2) Bool2Uint8(in1 != 0 && in2 != 0) + +#define i80i80OpLogAndi80(in1, in2) Bool2Int8(in1 != 0 && in2 != 0) + +#define u160u160OpLogAndu160(in1, in2) Bool2Uint16(in1 != 0 && in2 != 0) + +#define i160i160OpLogAndi160(in1, in2) Bool2Int16(in1 != 0 && in2 != 0) + + /*matrix and scalar*/ #define s2s0OpLogAnds2(in1, size1, in2, out) {int i = 0 ;\ @@ -65,6 +82,21 @@ #define z2d0OpLogAndd2(in1, size1, in2, out) {int i = 0 ;\ for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.0 || zimags(in1[i]) != 0.0) && in2 != 0.0);} +#define u82u80OpLogAndu82(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Uint8(in1[i] != 0 && in2 != 0);} + +#define i82i80OpLogAndi82(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Int8(in1[i] != 0 && in2 != 0);} + +#define u82u80OpLogAndu82(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Uint8(in1[i] != 0 && in2 != 0);} + +#define u162u160OpLogAndu162(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Uint16(in1[i] != 0 && in2 != 0);} + +#define i162i160OpLogAndi162(in1, size1, in2, out) {int i = 0 ;\ + for (i = 0 ; i < size1[0]*size1[1] ; i++ ) out[i] = Bool2Int16(in1[i] != 0 && in2 != 0);} + /*scalar and matrix*/ #define s0s2OpLogAnds2(in1, in2, size2, out) {int i = 0 ;\ @@ -92,6 +124,18 @@ #define z0d2OpLogAndd2(in1, in2, size2, out) {int i = 0 ;\ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1) != 0.0 || zimags(in1) != 0.0) && in2[i] != 0.0);} +#define u80u82OpLogAndu82(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Uint8(in1 != 0 && in2[i] != 0);} + +#define i80i82OpLogAndi82(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Int8(in1 != 0 && in2[i] != 0);} + +#define u160u162OpLogAndu162(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Uint16(in1 != 0 && in2[i] != 0);} + +#define i160i162OpLogAndi162(in1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Int16(in1 != 0 && in2[i] != 0);} + /*TODO matrix and matrix*/ #define s2s2OpLogAnds2(in1, size1, in2, size2, out) {int i = 0 ;\ @@ -119,4 +163,17 @@ #define z2d2OpLogAndd2(in1, size1, in2, size2, out) {int i = 0 ;\ for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Double((zreals(in1[i]) != 0.0 || zimags(in1[i]) != 0.0) && in2[i] != 0.0;)} + +#define u82u82OpLogAndu82(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Uint8(in1[i] != 0 && in2[i] != 0);} + +#define i82i82OpLogAndi82(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Int8(in1[i] != 0 && in2[i] != 0);} + +#define u162u162OpLogAndu162(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Uint16(in1[i] != 0 && in2[i] != 0);} + +#define i162i162OpLogAndi162(in1, size1, in2, size2, out) {int i = 0 ;\ + for (i = 0 ; i < size2[0]*size2[1] ; i++ ) out[i] = Bool2Int16(in1[i] != 0 && in2[i] != 0);} + #endif /* !__INT_OPLOGAND_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogEq.h b/src/c/operations/interfaces/int_OpLogEq.h index b15a8b6..446b11c 100644 --- a/src/c/operations/interfaces/int_OpLogEq.h +++ b/src/c/operations/interfaces/int_OpLogEq.h @@ -14,11 +14,17 @@ #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #define s0s0OpLogEqs0(in1,in2) (float) (in1 == in2) #define d0d0OpLogEqd0(in1,in2) (double) (in1 == in2) #define c0c0OpLogEqs0(in1,in2) (float) ((creals(in1) == creals(in2)) && (cimags(in1) == cimags(in2))) #define z0z0OpLogEqd0(in1,in2) (double) ((zreals(in1) == zreals(in2)) && (zimags(in1) == zimags(in2))) +#define u80u80OpLogEqu80(in1,in2) (uint8) (in1 == in2) +#define i80i80OpLogEqi80(in1,in2) (int8) (in1 == in2) +#define u160u160OpLogEqu160(in1,in2) (uint16) (in1 == in2) +#define i160i160OpLogEqi160(in1,in2) (int16) (in1 == in2) + #define s0c0OpLogEqs0(in1,in2) (float) ((in1==creals(in2)) && (0==cimags(in2))) #define d0z0OpLogEqd0(in1,in2) (double) ((in1==zreals(in2)) && (0==zimags(in2))) @@ -51,8 +57,21 @@ #define d2z0OpLogEqd2(in1,size,in2,out) {int i;\ for (i=0;i= in2) #define d0d0OpLogGed0(in1,in2) (double) (in1 >= in2) +#define u80u80OpLogGeu80(in1,in2) (uint8) (in1 >= in2) + +#define i80i80OpLogGei80(in1,in2) (int8) (in1 >= in2) + +#define u160u160OpLogGeu160(in1,in2) (uint16) (in1 >= in2) + +#define i160i160OpLogGei160(in1,in2) (int16) (in1 >= in2) + #define s2s0OpLogGes2(in1, size1, in2, out) {int i;\ for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogGes0(in1[i],in2);\ } + +#define u82u80OpLogGeu82(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u80u80OpLogGeu80(in1[i],in2);\ + } + +#define i82i80OpLogGei82(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i80i80OpLogGei80(in1[i],in2);\ + } + +#define u82u80OpLogGeu82(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u80u80OpLogGeu80(in1[i],in2);\ + } + +#define u162u160OpLogGeu162(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u160u160OpLogGeu160(in1[i],in2);\ + } + +#define i162i160OpLogGei162(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i160i160OpLogGei160(in1[i],in2);\ + } + #define s0s2OpLogGes2(in1, in2, size2, out) {int i; \ for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = s0s0OpLogGes0(in1,in2[i]);\ } +#define u80u82OpLogGeu82(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = u80u80OpLogGeu80(in1,in2[i]);\ + } + +#define u160u162OpLogGeu162(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = u160u160OpLogGeu160(in1,in2[i]);\ + } + + +#define i160i162OpLogGei162(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = i160i160OpLogGei160(in1,in2[i]);\ + } + /* we must have size1=size2 */ #define s2s2OpLogGes2(in1, size1, in2, size2, out) {int i; \ for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogGes0(in1[i],in2[i]);\ @@ -47,4 +89,22 @@ #define d2d2OpLogGed2(in1, size1, in2, size2, out) {int i; \ for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = d0d0OpLogGed0(in1[i],in2[i]);\ } + +#define u82u82OpLogGeu82(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u80u80OpLogGeu80(in1[i],in2[i]);\ + } + +#define i82i82OpLogGei82(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i80i80OpLogGei80(in1[i],in2[i]);\ + } + +#define u162u162OpLogGeu162(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u160u160OpLogGeu160(in1[i],in2[i]);\ + } + +#define i162i162OpLogGei162(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i160i160OpLogGei160(in1[i],in2[i]);\ + } + + #endif /* !__OPLOGGE_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogGt.h b/src/c/operations/interfaces/int_OpLogGt.h index 161b654..38c76cf 100644 --- a/src/c/operations/interfaces/int_OpLogGt.h +++ b/src/c/operations/interfaces/int_OpLogGt.h @@ -21,15 +21,51 @@ #define s0s0OpLogGts0(in1,in2) (float) (in1 > in2) #define d0d0OpLogGtd0(in1,in2) (double) (in1 > in2) +#define u80u80OpLogGtu80(in1,in2) (uint8) (in1 > in2) +#define i80i80OpLogGti80(in1,in2) (int8) (in1 > in2) +#define u160u160OpLogGtu160(in1,in2) (uint16) (in1 > in2) +#define i160i160OpLogGti160(in1,in2) (int16) (in1 > in2) #define s2s0OpLogGts2(in1, size1, in2, out) {int i;\ for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogGts0(in1[i],in2);\ } +#define u82u80OpLogGtu82(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u80u80OpLogGtu80(in1[i],in2);\ + } + +#define i82i80OpLogGti82(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i80i80OpLogGti80(in1[i],in2);\ + } + +#define u162u160OpLogGtu162(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u160u160OpLogGtu160(in1[i],in2);\ + } + +#define i162i160OpLogGti162(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i160i160OpLogGti160(in1[i],in2);\ + } + #define s0s2OpLogGts2(in1, in2, size2, out) {int i; \ for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = s0s0OpLogGts0(in1,in2[i]);\ } +#define u80u82OpLogGtu82(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = u80u80OpLogGtu80(in1,in2[i]);\ + } + +#define i80i82OpLogGti82(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = i80i80OpLogGti80(in1,in2[i]);\ + } + +#define u160u162OpLogGtu162(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = u160u160OpLogGtu160(in1,in2[i]);\ + } + +#define i160i162OpLogGti162(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = i160i160OpLogGti160(in1,in2[i]);\ + } + /* we must have size1=size2 */ #define s2s2OpLogGts2(in1, size1, in2, size2, out) {int i; \ for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogGts0(in1[i],in2[i]);\ @@ -47,4 +83,21 @@ #define d2d2OpLogGtd2(in1, size1, in2, size2, out) {int i; \ for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = d0d0OpLogGtd0(in1[i],in2[i]);\ } + +#define u82u82OpLogGtu82(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u80u80OpLogGtu80(in1[i],in2[i]);\ + } + +#define i82i82OpLogGti82(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i80i80OpLogGti80(in1[i],in2[i]);\ + } + +#define u162u162OpLogGtu162(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u160u160OpLogGt160(in1[i],in2[i]);\ + } + +#define i162i162OpLogGti162(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i160i160OpLogGti160(in1[i],in2[i]);\ + } + #endif /* !__OPLOGGT_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogLe.h b/src/c/operations/interfaces/int_OpLogLe.h index ebb09c7..8dbd1aa 100644 --- a/src/c/operations/interfaces/int_OpLogLe.h +++ b/src/c/operations/interfaces/int_OpLogLe.h @@ -20,16 +20,51 @@ #define s0s0OpLogLes0(in1,in2) (float) (in1 <= in2) #define d0d0OpLogLed0(in1,in2) (double) (in1 <= in2) - +#define u80u80OpLogLeu80(in1,in2) (uint8) (in1 <= in2) +#define i80i80OpLogLei80(in1,in2) (int8) (in1 <= in2) +#define u160u160OpLogLeu160(in1,in2) (uint16) (in1 <= in2) +#define i160i160OpLogLei160(in1,in2) (int16) (in1 <= in2) #define s2s0OpLogLes2(in1, size1, in2, out) {int i;\ for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogLes0(in1[i],in2);\ } +#define u82u80OpLogLeu82(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u80u80OpLogLeu80(in1[i],in2);\ + } + +#define i82i80OpLogLei82(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i80i80OpLogLei80(in1[i],in2);\ + } + +#define u162u160OpLogLeu162(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u160u160OpLogLeu160(in1[i],in2);\ + } + +#define i162i160OpLogLei162(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i160i160OpLogLei160(in1[i],in2);\ + } + #define s0s2OpLogLes2(in1, in2, size2, out) {int i; \ for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = s0s0OpLogLes0(in1,in2[i]);\ } +#define u80u82OpLogLeu82(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = u80u80OpLogLeu80(in1,in2[i]);\ + } + +#define i80i82OpLogLei82(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = i80i80OpLogLei80(in1,in2[i]);\ + } + +#define u160u162OpLogLeu162(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = u160u160OpLogLeu160(in1,in2[i]);\ + } + +#define i160i162OpLogLei162(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = i160i160OpLogLei160(in1,in2[i]);\ + } + /* we must have size1=size2 */ #define s2s2OpLogLes2(in1, size1, in2, size2, out) {int i; \ for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogLes0(in1[i],in2[i]);\ @@ -47,4 +82,21 @@ #define d2d2OpLogLed2(in1, size1, in2, size2, out) {int i; \ for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = d0d0OpLogLed0(in1[i],in2[i]);\ } + +#define u82u82OpLogLeu82(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u80u80OpLogLeu80(in1[i],in2[i]);\ + } + +#define i82i82OpLogLei82(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i80i80OpLogLei80(in1[i],in2[i]);\ + } + +#define u162u162OpLogLeu162(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u160u160OpLogLeu160(in1[i],in2[i]);\ + } + +#define i162i162OpLogLei162(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i160i160OpLogLei160(in1[i],in2[i]);\ + } + #endif /* !__OPLOGLE_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogLt.h b/src/c/operations/interfaces/int_OpLogLt.h index 2c5d863..8974b15 100644 --- a/src/c/operations/interfaces/int_OpLogLt.h +++ b/src/c/operations/interfaces/int_OpLogLt.h @@ -20,16 +20,51 @@ #define s0s0OpLogLts0(in1,in2) (float) (in1 < in2) #define d0d0OpLogLtd0(in1,in2) (double) (in1 < in2) - +#define u80u80OpLogLtu80(in1,in2) (uint8) (in1 < in2) +#define i80i80OpLogLti80(in1,in2) (int8) (in1 < in2) +#define u160u160OpLogLtu160(in1,in2) (uint16) (in1 < in2) +#define i160i160OpLogLti160(in1,in2) (int16) (in1 < in2) #define s2s0OpLogLts2(in1, size1, in2, out) {int i;\ for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogLts0(in1[i],in2);\ } +#define u82u80OpLogLtu82(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u80u80OpLogLtu80(in1[i],in2);\ + } + +#define i82i80OpLogLti82(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i80i80OpLogLti80(in1[i],in2);\ + } + +#define u162u160OpLogLtu162(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u160u160OpLogLtu160(in1[i],in2);\ + } + +#define i162i160OpLogLti162(in1, size1, in2, out) {int i;\ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i160i160OpLogLti160(in1[i],in2);\ + } + #define s0s2OpLogLts2(in1, in2, size2, out) {int i; \ for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = s0s0OpLogLts0(in1,in2[i]);\ } +#define u80u82OpLogLtu82(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = u80u80OpLogLtu80(in1,in2[i]);\ + } + +#define i80i82OpLogLti82(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = i80i80OpLogLti80(in1,in2[i]);\ + } + +#define u160u162OpLogLtu162(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = u160u160OpLogLtu160(in1,in2[i]);\ + } + +#define i160i162OpLogLti162(in1, in2, size2, out) {int i; \ + for(i = 0 ; i < size2[0] * size2[1] ; ++i) out[i] = i160i160OpLogLti160(in1,in2[i]);\ + } + /* we must have size1=size2 */ #define s2s2OpLogLts2(in1, size1, in2, size2, out) {int i; \ for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = s0s0OpLogLts0(in1[i],in2[i]);\ @@ -47,4 +82,21 @@ #define d2d2OpLogLtd2(in1, size1, in2, size2, out) {int i; \ for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = d0d0OpLogLtd0(in1[i],in2[i]);\ } + +#define u82u82OpLogLtu82(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u80u80OpLogLtu80(in1[i],in2[i]);\ + } + +#define i82i82OpLogLti82(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i80i80OpLogLti80(in1[i],in2[i]);\ + } + +#define u162u162OpLogLtu162(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = u160u160OpLogLtu160(in1[i],in2[i]);\ + } + +#define i162i162OpLogLti162(in1, size1, in2, size2, out) {int i; \ + for(i = 0 ; i < size1[0] * size1[1] ; ++i) out[i] = i160i160OpLogLti160(in1[i],in2[i]);\ + } + #endif /* !__OPLOGLT_H__ */ diff --git a/src/c/operations/interfaces/int_OpLogNe.h b/src/c/operations/interfaces/int_OpLogNe.h index 238ef48..56cafef 100644 --- a/src/c/operations/interfaces/int_OpLogNe.h +++ b/src/c/operations/interfaces/int_OpLogNe.h @@ -22,6 +22,10 @@ #define d0d0OpLogNed0(in1,in2) (double) !(in1 == in2) #define c0c0OpLogNes0(in1,in2) (float) !((creals(in1) == creals(in2)) && (cimags(in1) == cimags(in2))) #define z0z0OpLogNed0(in1,in2) (double) !((zreals(in1) == zreals(in2)) && (zimags(in1) == zimags(in2))) +#define u80u80OpLogNeu80(in1,in2) (uint8) !(in1 == in2) +#define i80i80OpLogNei80(in1,in2) (int8) !(in1 == in2) +#define u160u160OpLogNeu160(in1,in2) (uint16) !(in1 == in2) +#define i160i160OpLogNei160(in1,in2) (int16) !(in1 == in2) #define s0c0OpLogNes0(in1,in2) (float) !((in1==creals(in2)) && (0==cimags(in2))) #define d0z0OpLogNed0(in1,in2) (double) !((in1==zreals(in2)) && (0==zimags(in2))) @@ -55,7 +59,21 @@ for (i=0;i