diff options
Diffstat (limited to 'src/c/auxiliaryFunctions/sign')
-rw-r--r-- | src/c/auxiliaryFunctions/sign/i16signa.c | 21 | ||||
-rw-r--r-- | src/c/auxiliaryFunctions/sign/i16signs.c | 24 | ||||
-rw-r--r-- | src/c/auxiliaryFunctions/sign/i8signa.c | 21 | ||||
-rw-r--r-- | src/c/auxiliaryFunctions/sign/i8signs.c | 24 | ||||
-rw-r--r-- | src/c/auxiliaryFunctions/sign/u16signa.c | 21 | ||||
-rw-r--r-- | src/c/auxiliaryFunctions/sign/u16signs.c | 24 | ||||
-rw-r--r-- | src/c/auxiliaryFunctions/sign/u8signa.c | 21 | ||||
-rw-r--r-- | src/c/auxiliaryFunctions/sign/u8signs.c | 24 |
8 files changed, 180 insertions, 0 deletions
diff --git a/src/c/auxiliaryFunctions/sign/i16signa.c b/src/c/auxiliaryFunctions/sign/i16signa.c new file mode 100644 index 00000000..c1d9e915 --- /dev/null +++ b/src/c/auxiliaryFunctions/sign/i16signa.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "sign.h" + +void i16signa(int16 *in, int size, int16 *out) { + int i = 0; + + for (i = 0 ; i < size ; ++i) { + out[i] = i16signs(in[i]); + } +} diff --git a/src/c/auxiliaryFunctions/sign/i16signs.c b/src/c/auxiliaryFunctions/sign/i16signs.c new file mode 100644 index 00000000..a3a11ab8 --- /dev/null +++ b/src/c/auxiliaryFunctions/sign/i16signs.c @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "sign.h" + +int16 i16signs(int16 num) { + if (num > 0) { + return (int16)1; + } + if (num < 0) { + return (int16)-1; + } + /* num == 0 */ + return (int16)0; +} diff --git a/src/c/auxiliaryFunctions/sign/i8signa.c b/src/c/auxiliaryFunctions/sign/i8signa.c new file mode 100644 index 00000000..c86e0fb0 --- /dev/null +++ b/src/c/auxiliaryFunctions/sign/i8signa.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "sign.h" + +void i8signa(int8 *in, int size, int8 *out) { + int i = 0; + + for (i = 0 ; i < size ; ++i) { + out[i] = i8signs(in[i]); + } +} diff --git a/src/c/auxiliaryFunctions/sign/i8signs.c b/src/c/auxiliaryFunctions/sign/i8signs.c new file mode 100644 index 00000000..ced00a73 --- /dev/null +++ b/src/c/auxiliaryFunctions/sign/i8signs.c @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "sign.h" + +int8 i8signs(int8 num) { + if (num > 0) { + return (int8)1; + } + if (num < 0) { + return (int8)-1; + } + /* num == 0 */ + return (int8)0; +} diff --git a/src/c/auxiliaryFunctions/sign/u16signa.c b/src/c/auxiliaryFunctions/sign/u16signa.c new file mode 100644 index 00000000..3cc4f662 --- /dev/null +++ b/src/c/auxiliaryFunctions/sign/u16signa.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "sign.h" + +void u16signa(uint16 *in, int size, int16 *out) { + int i = 0; + + for (i = 0 ; i < size ; ++i) { + out[i] = u16signs(in[i]); + } +} diff --git a/src/c/auxiliaryFunctions/sign/u16signs.c b/src/c/auxiliaryFunctions/sign/u16signs.c new file mode 100644 index 00000000..7f187227 --- /dev/null +++ b/src/c/auxiliaryFunctions/sign/u16signs.c @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "sign.h" + +int16 u16signs(uint16 num) { + if (num > 0) { + return (int16)1; + } + if (num < 0) { + return (int16)-1; + } + /* num == 0 */ + return (int16)0; +} diff --git a/src/c/auxiliaryFunctions/sign/u8signa.c b/src/c/auxiliaryFunctions/sign/u8signa.c new file mode 100644 index 00000000..34021b51 --- /dev/null +++ b/src/c/auxiliaryFunctions/sign/u8signa.c @@ -0,0 +1,21 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "sign.h" + +void u8signa(uint8 *in, int size, int8 *out) { + int i = 0; + + for (i = 0 ; i < size ; ++i) { + out[i] = u8signs(in[i]); + } +} diff --git a/src/c/auxiliaryFunctions/sign/u8signs.c b/src/c/auxiliaryFunctions/sign/u8signs.c new file mode 100644 index 00000000..437da775 --- /dev/null +++ b/src/c/auxiliaryFunctions/sign/u8signs.c @@ -0,0 +1,24 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007-2008 - INRIA - Bruno JOFRET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + * + */ + +#include "sign.h" + +int8 u8signs(uint8 num) { + if (num > 0) { + return (int8)1; + } + if (num < 0) { + return (int8)-1; + } + /* num == 0 */ + return (int8)0; +} |