diff options
author | siddhu8990 | 2015-09-03 02:06:47 +0530 |
---|---|---|
committer | siddhu8990 | 2015-09-03 02:06:47 +0530 |
commit | 3704cdf7eb9551353ac9175aa10be444755b8e22 (patch) | |
tree | e7d66716e67137209a55d880ebb58a7f69ce3484 /2.3-1/src/c/elementaryFunctions | |
parent | 5675f7cd91515d5e88fd151943c3ec5cde57ceaa (diff) | |
download | Scilab2C-3704cdf7eb9551353ac9175aa10be444755b8e22.tar.gz Scilab2C-3704cdf7eb9551353ac9175aa10be444755b8e22.tar.bz2 Scilab2C-3704cdf7eb9551353ac9175aa10be444755b8e22.zip |
Intermediate commit. Not to be used
Diffstat (limited to '2.3-1/src/c/elementaryFunctions')
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/cosh/i16cosha.c | 18 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/cosh/i8cosha.c | 18 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/cosh/u16cosha.c | 18 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/cosh/u8cosha.c | 18 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/includes/ceil.h | 17 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/includes/cosh.h | 8 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/includes/fix.h | 17 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/includes/floor.h | 17 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/includes/round.h | 17 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/interfaces/int_ceil.h | 16 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/interfaces/int_fix.h | 16 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/interfaces/int_floor.h | 16 | ||||
-rw-r--r-- | 2.3-1/src/c/elementaryFunctions/interfaces/int_round.h | 16 |
13 files changed, 160 insertions, 52 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/cosh/i16cosha.c b/2.3-1/src/c/elementaryFunctions/cosh/i16cosha.c index 8515bc7d..eb2e9f93 100644 --- a/2.3-1/src/c/elementaryFunctions/cosh/i16cosha.c +++ b/2.3-1/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 <math.h> #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/2.3-1/src/c/elementaryFunctions/cosh/i8cosha.c b/2.3-1/src/c/elementaryFunctions/cosh/i8cosha.c index b30c14e2..beed9b30 100644 --- a/2.3-1/src/c/elementaryFunctions/cosh/i8cosha.c +++ b/2.3-1/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 <math.h> #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/2.3-1/src/c/elementaryFunctions/cosh/u16cosha.c b/2.3-1/src/c/elementaryFunctions/cosh/u16cosha.c index 775f710e..e0c41836 100644 --- a/2.3-1/src/c/elementaryFunctions/cosh/u16cosha.c +++ b/2.3-1/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 <math.h> #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/2.3-1/src/c/elementaryFunctions/cosh/u8cosha.c b/2.3-1/src/c/elementaryFunctions/cosh/u8cosha.c index b6d614fa..9584b3e0 100644 --- a/2.3-1/src/c/elementaryFunctions/cosh/u8cosha.c +++ b/2.3-1/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 <math.h> #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/2.3-1/src/c/elementaryFunctions/includes/ceil.h b/2.3-1/src/c/elementaryFunctions/includes/ceil.h index 960b8b3b..57df72d5 100644 --- a/2.3-1/src/c/elementaryFunctions/includes/ceil.h +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/includes/cosh.h b/2.3-1/src/c/elementaryFunctions/includes/cosh.h index e084e427..5c7c8b71 100644 --- a/2.3-1/src/c/elementaryFunctions/includes/cosh.h +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/includes/fix.h b/2.3-1/src/c/elementaryFunctions/includes/fix.h index 504a63c1..d3e7f88b 100644 --- a/2.3-1/src/c/elementaryFunctions/includes/fix.h +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/includes/floor.h b/2.3-1/src/c/elementaryFunctions/includes/floor.h index 971cdf65..cd566416 100644 --- a/2.3-1/src/c/elementaryFunctions/includes/floor.h +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/includes/round.h b/2.3-1/src/c/elementaryFunctions/includes/round.h index 1c3c0cea..6894265a 100644 --- a/2.3-1/src/c/elementaryFunctions/includes/round.h +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/interfaces/int_ceil.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_ceil.h index 918dd5a0..33c01769 100644 --- a/2.3-1/src/c/elementaryFunctions/interfaces/int_ceil.h +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/interfaces/int_fix.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_fix.h index ac483c92..2a00e2cf 100644 --- a/2.3-1/src/c/elementaryFunctions/interfaces/int_fix.h +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/interfaces/int_floor.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_floor.h index 548c5e2a..639819a7 100644 --- a/2.3-1/src/c/elementaryFunctions/interfaces/int_floor.h +++ b/2.3-1/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/2.3-1/src/c/elementaryFunctions/interfaces/int_round.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_round.h index a5da230c..7d013c1e 100644 --- a/2.3-1/src/c/elementaryFunctions/interfaces/int_round.h +++ b/2.3-1/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__ */ |