diff options
Diffstat (limited to 'src/c/elementaryFunctions')
24 files changed, 560 insertions, 0 deletions
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<size;i++) out[i] = dint16s(x[i]); +} diff --git a/src/c/elementaryFunctions/int16/dint16s.c b/src/c/elementaryFunctions/int16/dint16s.c new file mode 100644 index 0000000..76ee96b --- /dev/null +++ b/src/c/elementaryFunctions/int16/dint16s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "int16.h" + +int16 dint16s(double x) { + return (int16) x; +} diff --git a/src/c/elementaryFunctions/int16/sint16a.c b/src/c/elementaryFunctions/int16/sint16a.c new file mode 100644 index 0000000..33058ea --- /dev/null +++ b/src/c/elementaryFunctions/int16/sint16a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "int16.h" + +void sint16a(float* x, int size, int16* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = sint16s(x[i]); +} diff --git a/src/c/elementaryFunctions/int16/sint16s.c b/src/c/elementaryFunctions/int16/sint16s.c new file mode 100644 index 0000000..4634a39 --- /dev/null +++ b/src/c/elementaryFunctions/int16/sint16s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "int16.h" + +int16 sint16s(float x) { + return (int16) x; +} diff --git a/src/c/elementaryFunctions/int8/dint8a.c b/src/c/elementaryFunctions/int8/dint8a.c new file mode 100644 index 0000000..719d6f4 --- /dev/null +++ b/src/c/elementaryFunctions/int8/dint8a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "int8.h" + +void dint8a(double* x, int size, int8* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = dint8s(x[i]); +} diff --git a/src/c/elementaryFunctions/int8/dint8s.c b/src/c/elementaryFunctions/int8/dint8s.c new file mode 100644 index 0000000..f1789e6 --- /dev/null +++ b/src/c/elementaryFunctions/int8/dint8s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "int8.h" + +int8 dint8s(double x) { + return (int8) x; +} diff --git a/src/c/elementaryFunctions/int8/sint8a.c b/src/c/elementaryFunctions/int8/sint8a.c new file mode 100644 index 0000000..87846a7 --- /dev/null +++ b/src/c/elementaryFunctions/int8/sint8a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "int8.h" + +void sint8a(float* x, int size, int8* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = sint8s(x[i]); +} diff --git a/src/c/elementaryFunctions/int8/sint8s.c b/src/c/elementaryFunctions/int8/sint8s.c new file mode 100644 index 0000000..89d4b81 --- /dev/null +++ b/src/c/elementaryFunctions/int8/sint8s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "int8.h" + +int8 sint8s(float x) { + return (int8) x; +} diff --git a/src/c/elementaryFunctions/interfaces/int_int16.h b/src/c/elementaryFunctions/interfaces/int_int16.h new file mode 100644 index 0000000..759cb97 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_int16.h @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_INT16_H__ +#define __INT_INT16_H__ + +#define s0int16u80(in) sint16s(in) + +#define d0int16u80(in) dint16s(in) + +#define s2int16u82(in,size,out) sint16a(in, size[0]*size[1], out) + +#define d2int16u82(in,size,out) dint16a(in, size[0]*size[1], out) + +#endif /* !__INT_INT8_H__ */ diff --git a/src/c/elementaryFunctions/interfaces/int_int8.h b/src/c/elementaryFunctions/interfaces/int_int8.h new file mode 100644 index 0000000..5cf129e --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_int8.h @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_INT8_H__ +#define __INT_INT8_H__ + +#define s0int8u80(in) sint8s(in) + +#define d0int8u80(in) dint8s(in) + +#define s2int8u82(in,size,out) sint8a(in, size[0]*size[1], out) + +#define d2int8u82(in,size,out) dint8a(in, size[0]*size[1], out) + +#endif /* !__INT_INT8_H__ */ diff --git a/src/c/elementaryFunctions/interfaces/int_uint16.h b/src/c/elementaryFunctions/interfaces/int_uint16.h new file mode 100644 index 0000000..0d558b3 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_uint16.h @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_UINT16_H__ +#define __INT_UINT16_H__ + +#define s0uint16u80(in) suint16s(in) + +#define d0uint16u80(in) duint16s(in) + +#define s2uint16u82(in,size,out) suint16a(in, size[0]*size[1], out) + +#define d2uint16u82(in,size,out) duint16a(in, size[0]*size[1], out) + +#endif /* !__INT_UINT8_H__ */ diff --git a/src/c/elementaryFunctions/interfaces/int_uint8.h b/src/c/elementaryFunctions/interfaces/int_uint8.h new file mode 100644 index 0000000..d12b275 --- /dev/null +++ b/src/c/elementaryFunctions/interfaces/int_uint8.h @@ -0,0 +1,26 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +/* THIS IS AN AUTOMATICALLY GENERATED FILE : DO NOT EDIT BY HAND. */ + +#ifndef __INT_UINT8_H__ +#define __INT_UINT8_H__ + +#define s0uint8u80(in) suint8s(in) + +#define d0uint8u80(in) duint8s(in) + +#define s2uint8u82(in,size,out) suint8a(in, size[0]*size[1], out) + +#define d2uint8u82(in,size,out) duint8a(in, size[0]*size[1], out) + +#endif /* !__INT_UINT8_H__ */ diff --git a/src/c/elementaryFunctions/uint16/duint16a.c b/src/c/elementaryFunctions/uint16/duint16a.c new file mode 100644 index 0000000..c94cd18 --- /dev/null +++ b/src/c/elementaryFunctions/uint16/duint16a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "uint16.h" + +void duint16a(double* x, int size, uint16* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = duint16s(x[i]); +} diff --git a/src/c/elementaryFunctions/uint16/duint16s.c b/src/c/elementaryFunctions/uint16/duint16s.c new file mode 100644 index 0000000..4c4918f --- /dev/null +++ b/src/c/elementaryFunctions/uint16/duint16s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "uint16.h" + +uint16 duint16s(double x) { + return (uint16) x; +} diff --git a/src/c/elementaryFunctions/uint16/suint16a.c b/src/c/elementaryFunctions/uint16/suint16a.c new file mode 100644 index 0000000..4bc3768 --- /dev/null +++ b/src/c/elementaryFunctions/uint16/suint16a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "uint16.h" + +void suint16a(float* x, int size, uint16* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = suint16s(x[i]); +} diff --git a/src/c/elementaryFunctions/uint16/suint16s.c b/src/c/elementaryFunctions/uint16/suint16s.c new file mode 100644 index 0000000..708237b --- /dev/null +++ b/src/c/elementaryFunctions/uint16/suint16s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "uint16.h" + +uint16 suint16s(float x) { + return (uint16) x; +} diff --git a/src/c/elementaryFunctions/uint8/duint8a.c b/src/c/elementaryFunctions/uint8/duint8a.c new file mode 100644 index 0000000..0a3f2d2 --- /dev/null +++ b/src/c/elementaryFunctions/uint8/duint8a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "uint8.h" + +void duint8a(double* x, int size, uint8* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = duint8s(x[i]); +} diff --git a/src/c/elementaryFunctions/uint8/duint8s.c b/src/c/elementaryFunctions/uint8/duint8s.c new file mode 100644 index 0000000..b797934 --- /dev/null +++ b/src/c/elementaryFunctions/uint8/duint8s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "uint8.h" + +uint8 duint8s(double x) { + return (uint8) x; +} diff --git a/src/c/elementaryFunctions/uint8/suint8a.c b/src/c/elementaryFunctions/uint8/suint8a.c new file mode 100644 index 0000000..cf64dd4 --- /dev/null +++ b/src/c/elementaryFunctions/uint8/suint8a.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "uint8.h" + +void suint8a(float* x, int size, uint8* out) { + int i = 0; + for (i=0;i<size;i++) out[i] = suint8s(x[i]); +} diff --git a/src/c/elementaryFunctions/uint8/suint8s.c b/src/c/elementaryFunctions/uint8/suint8s.c new file mode 100644 index 0000000..e95e964 --- /dev/null +++ b/src/c/elementaryFunctions/uint8/suint8s.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Arnaud Torset + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + + +#include "uint8.h" + +uint8 suint8s(float x) { + return (uint8) x; +} |