diff options
author | Abhinav Dronamraju | 2017-09-29 22:00:40 +0530 |
---|---|---|
committer | Abhinav Dronamraju | 2017-09-29 22:00:40 +0530 |
commit | 9bc7ad78e8d7d7acc4b9387aa592542832e80b31 (patch) | |
tree | 7fce060665a91de5e5adb12d02003351c3d1fdfc /src/c/operations/multiplication | |
parent | 33755eb085a3ca8154cf83773b23fbb8aac4ba3e (diff) | |
parent | ac0045f12ad3d0938758e9742f4107a334e1afaa (diff) | |
download | scilab2c-9bc7ad78e8d7d7acc4b9387aa592542832e80b31.tar.gz scilab2c-9bc7ad78e8d7d7acc4b9387aa592542832e80b31.tar.bz2 scilab2c-9bc7ad78e8d7d7acc4b9387aa592542832e80b31.zip |
NEW FEATURES AND NEW FUNCTIONS
Diffstat (limited to 'src/c/operations/multiplication')
-rw-r--r-- | src/c/operations/multiplication/dmula.c | 3 | ||||
-rw-r--r-- | src/c/operations/multiplication/dmuls.c | 3 | ||||
-rw-r--r-- | src/c/operations/multiplication/i16mula.c | 21 | ||||
-rw-r--r-- | src/c/operations/multiplication/i16muls.c | 19 | ||||
-rw-r--r-- | src/c/operations/multiplication/i16mulv.c | 27 | ||||
-rw-r--r-- | src/c/operations/multiplication/i8mula.c | 21 | ||||
-rw-r--r-- | src/c/operations/multiplication/i8muls.c | 19 | ||||
-rw-r--r-- | src/c/operations/multiplication/i8mulv.c | 27 | ||||
-rw-r--r-- | src/c/operations/multiplication/u16mula.c | 21 | ||||
-rw-r--r-- | src/c/operations/multiplication/u16muls.c | 19 | ||||
-rw-r--r-- | src/c/operations/multiplication/u16mulv.c | 27 | ||||
-rw-r--r-- | src/c/operations/multiplication/u8mula.c | 21 | ||||
-rw-r--r-- | src/c/operations/multiplication/u8muls.c | 19 | ||||
-rw-r--r-- | src/c/operations/multiplication/u8mulv.c | 26 |
14 files changed, 271 insertions, 2 deletions
diff --git a/src/c/operations/multiplication/dmula.c b/src/c/operations/multiplication/dmula.c index 976faacf..77c204a7 100644 --- a/src/c/operations/multiplication/dmula.c +++ b/src/c/operations/multiplication/dmula.c @@ -15,7 +15,8 @@ void dmula(double* in1, double* in2, int size, double* out){ int i=0; - for (i=0;i<size;i++){ + for (i=0;i<size;i++) + { out[i]=dmuls(in1[i],in2[i]); } } diff --git a/src/c/operations/multiplication/dmuls.c b/src/c/operations/multiplication/dmuls.c index 09e7fdf5..ac21ace0 100644 --- a/src/c/operations/multiplication/dmuls.c +++ b/src/c/operations/multiplication/dmuls.c @@ -13,6 +13,7 @@ #include "multiplication.h" -double dmuls(double in1, double in2){ +double dmuls(double in1, double in2) +{ return in1*in2; } diff --git a/src/c/operations/multiplication/i16mula.c b/src/c/operations/multiplication/i16mula.c new file mode 100644 index 00000000..bffa107e --- /dev/null +++ b/src/c/operations/multiplication/i16mula.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "multiplication.h" + +void i16mula(int16* in1, int16* in2, int size, int16* out){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i16muls(in1[i],in2[i]); + } +} diff --git a/src/c/operations/multiplication/i16muls.c b/src/c/operations/multiplication/i16muls.c new file mode 100644 index 00000000..4aaa5d11 --- /dev/null +++ b/src/c/operations/multiplication/i16muls.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "multiplication.h" +#include "types.h" + +int16 i16muls(int16 in1, int16 in2){ + return in1*in2; +} diff --git a/src/c/operations/multiplication/i16mulv.c b/src/c/operations/multiplication/i16mulv.c new file mode 100644 index 00000000..3f3cc8d1 --- /dev/null +++ b/src/c/operations/multiplication/i16mulv.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "multiplication.h" + +int16 i16mulv(int16* in1, int16* in2, int size) +{ + int16 out = 0; + int i = 0; + + for (i = 0 ; i < size ; ++i) + { + out += i16muls(in1[i], in2[i]); + } + + return out; +} diff --git a/src/c/operations/multiplication/i8mula.c b/src/c/operations/multiplication/i8mula.c new file mode 100644 index 00000000..c5c6114d --- /dev/null +++ b/src/c/operations/multiplication/i8mula.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "multiplication.h" + +void i8mula(int8* in1, int8* in2, int size, int8* out){ + int i=0; + for (i=0;i<size;i++){ + out[i]=i8muls(in1[i],in2[i]); + } +} diff --git a/src/c/operations/multiplication/i8muls.c b/src/c/operations/multiplication/i8muls.c new file mode 100644 index 00000000..d6566208 --- /dev/null +++ b/src/c/operations/multiplication/i8muls.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "multiplication.h" +#include "types.h" + +int8 i8muls(int8 in1, int8 in2){ + return in1*in2; +} diff --git a/src/c/operations/multiplication/i8mulv.c b/src/c/operations/multiplication/i8mulv.c new file mode 100644 index 00000000..6dc1ec4e --- /dev/null +++ b/src/c/operations/multiplication/i8mulv.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "multiplication.h" + +int8 i8mulv(int8* in1, int8* in2, int size) +{ + int8 out = 0; + int i = 0; + + for (i = 0 ; i < size ; ++i) + { + out += i8muls(in1[i], in2[i]); + } + + return out; +} diff --git a/src/c/operations/multiplication/u16mula.c b/src/c/operations/multiplication/u16mula.c new file mode 100644 index 00000000..5be6e64e --- /dev/null +++ b/src/c/operations/multiplication/u16mula.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "multiplication.h" + +void u16mula(uint16* in1, uint16* in2, int size, uint16* out){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u16muls(in1[i],in2[i]); + } +} diff --git a/src/c/operations/multiplication/u16muls.c b/src/c/operations/multiplication/u16muls.c new file mode 100644 index 00000000..10380c0d --- /dev/null +++ b/src/c/operations/multiplication/u16muls.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "multiplication.h" +#include "types.h" + +uint16 u16muls(uint16 in1, uint16 in2){ + return in1*in2; +} diff --git a/src/c/operations/multiplication/u16mulv.c b/src/c/operations/multiplication/u16mulv.c new file mode 100644 index 00000000..5cd9805c --- /dev/null +++ b/src/c/operations/multiplication/u16mulv.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "multiplication.h" + +uint16 u16mulv(uint16* in1, uint16* in2, int size) +{ + uint16 out = 0; + int i = 0; + + for (i = 0 ; i < size ; ++i) + { + out += u16muls(in1[i], in2[i]); + } + + return out; +} diff --git a/src/c/operations/multiplication/u8mula.c b/src/c/operations/multiplication/u8mula.c new file mode 100644 index 00000000..7ff2dd0b --- /dev/null +++ b/src/c/operations/multiplication/u8mula.c @@ -0,0 +1,21 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "multiplication.h" + +void u8mula(uint8* in1, uint8* in2, int size, uint8* out){ + int i=0; + for (i=0;i<size;i++){ + out[i]=u8muls(in1[i],in2[i]); + } +} diff --git a/src/c/operations/multiplication/u8muls.c b/src/c/operations/multiplication/u8muls.c new file mode 100644 index 00000000..7acf5b58 --- /dev/null +++ b/src/c/operations/multiplication/u8muls.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "multiplication.h" +#include "types.h" + +uint8 u8muls(uint8 in1, uint8 in2){ + return in1*in2; +} diff --git a/src/c/operations/multiplication/u8mulv.c b/src/c/operations/multiplication/u8mulv.c new file mode 100644 index 00000000..9ae063e8 --- /dev/null +++ b/src/c/operations/multiplication/u8mulv.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + 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 + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "multiplication.h" + +uint8 u8mulv(uint8* in1, uint8* in2, int size) +{ + uint8 out = 0; + int i = 0; + + for (i = 0 ; i < size ; ++i) + { + out += u8muls(in1[i], in2[i]); + } + + return out; +} |