From 5f2d4d678256289e72c1455cf26d9c0ecdeedc0e Mon Sep 17 00:00:00 2001 From: imushir Date: Fri, 27 Nov 2015 15:22:41 +0530 Subject: added c files for u8 u16 i8 i16 --- src/c/statisticsFunctions/max/dcolumnmaxa.c | 6 +- src/c/statisticsFunctions/max/dcolumnmaxa.c~ | 26 +++++++ src/c/statisticsFunctions/max/dmaxa.c | 5 +- src/c/statisticsFunctions/max/dmaxa.c~ | 25 +++++++ src/c/statisticsFunctions/max/drowmaxa.c | 9 +-- src/c/statisticsFunctions/max/drowmaxa.c~ | 24 +++++++ src/c/statisticsFunctions/max/i16columnmaxa.c | 25 +++++++ src/c/statisticsFunctions/max/i16columnmaxa.c~ | 25 +++++++ src/c/statisticsFunctions/max/i16maxa.c | 26 +++++++ src/c/statisticsFunctions/max/i16maxa.c~ | 26 +++++++ src/c/statisticsFunctions/max/i16rowmaxa.c | 25 +++++++ src/c/statisticsFunctions/max/i16rowmaxa.c~ | 25 +++++++ src/c/statisticsFunctions/max/i8columnmaxa.c | 26 +++++++ src/c/statisticsFunctions/max/i8columnmaxa.c~ | 26 +++++++ src/c/statisticsFunctions/max/i8maxa.c | 26 +++++++ src/c/statisticsFunctions/max/i8maxa.c~ | 26 +++++++ src/c/statisticsFunctions/max/i8rowmaxa.c | 25 +++++++ src/c/statisticsFunctions/max/i8rowmaxa.c~ | 25 +++++++ src/c/statisticsFunctions/max/scolumnmaxa.c | 3 +- src/c/statisticsFunctions/max/scolumnmaxa.c~ | 25 +++++++ src/c/statisticsFunctions/max/smaxa.c | 2 +- src/c/statisticsFunctions/max/smaxa.c~ | 25 +++++++ src/c/statisticsFunctions/max/srowmaxa.c | 2 +- src/c/statisticsFunctions/max/srowmaxa.c~ | 23 +++++++ src/c/statisticsFunctions/max/testDoubleMax.c | 2 +- src/c/statisticsFunctions/max/testDoubleMax.c~ | 93 ++++++++++++++++++++++++++ src/c/statisticsFunctions/max/testFloatMax.c | 1 + src/c/statisticsFunctions/max/testFloatMax.c~ | 93 ++++++++++++++++++++++++++ src/c/statisticsFunctions/max/u16columnmaxa.c | 28 ++++++++ src/c/statisticsFunctions/max/u16columnmaxa.c~ | 28 ++++++++ src/c/statisticsFunctions/max/u16maxa.c | 26 +++++++ src/c/statisticsFunctions/max/u16maxa.c~ | 25 +++++++ src/c/statisticsFunctions/max/u16rowmaxa.c | 29 ++++++++ src/c/statisticsFunctions/max/u16rowmaxa.c~ | 28 ++++++++ src/c/statisticsFunctions/max/u8columnmaxa.c | 26 +++++++ src/c/statisticsFunctions/max/u8columnmaxa.c~ | 26 +++++++ src/c/statisticsFunctions/max/u8maxa.c | 26 +++++++ src/c/statisticsFunctions/max/u8maxa.c~ | 27 ++++++++ src/c/statisticsFunctions/max/u8rowmaxa.c | 28 ++++++++ src/c/statisticsFunctions/max/u8rowmaxa.c~ | 28 ++++++++ 40 files changed, 983 insertions(+), 12 deletions(-) create mode 100644 src/c/statisticsFunctions/max/dcolumnmaxa.c~ create mode 100644 src/c/statisticsFunctions/max/dmaxa.c~ create mode 100644 src/c/statisticsFunctions/max/drowmaxa.c~ create mode 100644 src/c/statisticsFunctions/max/i16columnmaxa.c create mode 100644 src/c/statisticsFunctions/max/i16columnmaxa.c~ create mode 100644 src/c/statisticsFunctions/max/i16maxa.c create mode 100644 src/c/statisticsFunctions/max/i16maxa.c~ create mode 100644 src/c/statisticsFunctions/max/i16rowmaxa.c create mode 100644 src/c/statisticsFunctions/max/i16rowmaxa.c~ create mode 100644 src/c/statisticsFunctions/max/i8columnmaxa.c create mode 100644 src/c/statisticsFunctions/max/i8columnmaxa.c~ create mode 100644 src/c/statisticsFunctions/max/i8maxa.c create mode 100644 src/c/statisticsFunctions/max/i8maxa.c~ create mode 100644 src/c/statisticsFunctions/max/i8rowmaxa.c create mode 100644 src/c/statisticsFunctions/max/i8rowmaxa.c~ create mode 100644 src/c/statisticsFunctions/max/scolumnmaxa.c~ create mode 100644 src/c/statisticsFunctions/max/smaxa.c~ create mode 100644 src/c/statisticsFunctions/max/srowmaxa.c~ create mode 100644 src/c/statisticsFunctions/max/testDoubleMax.c~ create mode 100644 src/c/statisticsFunctions/max/testFloatMax.c~ create mode 100644 src/c/statisticsFunctions/max/u16columnmaxa.c create mode 100644 src/c/statisticsFunctions/max/u16columnmaxa.c~ create mode 100644 src/c/statisticsFunctions/max/u16maxa.c create mode 100644 src/c/statisticsFunctions/max/u16maxa.c~ create mode 100644 src/c/statisticsFunctions/max/u16rowmaxa.c create mode 100644 src/c/statisticsFunctions/max/u16rowmaxa.c~ create mode 100644 src/c/statisticsFunctions/max/u8columnmaxa.c create mode 100644 src/c/statisticsFunctions/max/u8columnmaxa.c~ create mode 100644 src/c/statisticsFunctions/max/u8maxa.c create mode 100644 src/c/statisticsFunctions/max/u8maxa.c~ create mode 100644 src/c/statisticsFunctions/max/u8rowmaxa.c create mode 100644 src/c/statisticsFunctions/max/u8rowmaxa.c~ (limited to 'src') diff --git a/src/c/statisticsFunctions/max/dcolumnmaxa.c b/src/c/statisticsFunctions/max/dcolumnmaxa.c index ae0bbd47..e66422a2 100644 --- a/src/c/statisticsFunctions/max/dcolumnmaxa.c +++ b/src/c/statisticsFunctions/max/dcolumnmaxa.c @@ -11,14 +11,16 @@ */ #include "statMax.h" +//#include "max.h" void dcolumnmaxa(double *in, int rows, int columns, double* out) { int i = 0, j = 0; for (i = 0; i < rows; i++) { - out[i]=in[i]; + out[i]=in[i*columns]; for (j=0;jout[i]) out[i] = in[i+j*rows]; + if (in[i+j*rows]>out[i]) + out[i] = in[i+j*rows]; } } diff --git a/src/c/statisticsFunctions/max/dcolumnmaxa.c~ b/src/c/statisticsFunctions/max/dcolumnmaxa.c~ new file mode 100644 index 00000000..e66422a2 --- /dev/null +++ b/src/c/statisticsFunctions/max/dcolumnmaxa.c~ @@ -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 + * + */ + +#include "statMax.h" +//#include "max.h" + +void dcolumnmaxa(double *in, int rows, int columns, double* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=in[i*columns]; + for (j=0;jout[i]) + out[i] = in[i+j*rows]; + } + +} diff --git a/src/c/statisticsFunctions/max/dmaxa.c b/src/c/statisticsFunctions/max/dmaxa.c index 5e2145e3..63644635 100644 --- a/src/c/statisticsFunctions/max/dmaxa.c +++ b/src/c/statisticsFunctions/max/dmaxa.c @@ -11,14 +11,15 @@ */ #include "statMax.h" - +//#include "max.h" double dmaxa(double *in, int size) { double out = in[0]; int i = 0; for (i = 1; i < size; ++i) { - if (in[i]>out) out = in[i]; + if (in[i]>out) + out = in[i]; } return out; diff --git a/src/c/statisticsFunctions/max/dmaxa.c~ b/src/c/statisticsFunctions/max/dmaxa.c~ new file mode 100644 index 00000000..931c0d2d --- /dev/null +++ b/src/c/statisticsFunctions/max/dmaxa.c~ @@ -0,0 +1,25 @@ +/* + * 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 + * + */ + +#include "statMax.h" +//#include "max.h" +double dmaxa(double *in, int size) { + double out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) out = in[i]; + } + return out; + +} diff --git a/src/c/statisticsFunctions/max/drowmaxa.c b/src/c/statisticsFunctions/max/drowmaxa.c index a3099231..db0c72c0 100644 --- a/src/c/statisticsFunctions/max/drowmaxa.c +++ b/src/c/statisticsFunctions/max/drowmaxa.c @@ -11,13 +11,14 @@ */ #include "statMax.h" - +//#include "max.h" void drowmaxa(double *in, int rows, int columns, double* out) { int i = 0, j = 0; - - for (i = 0; i < columns; i++) { + for (i = 0; i < columns; i++) + { out[i]=in[i*rows]; for (j = 1 ; j < rows ; j++) - if (in[i*rows+j]>out[i]) out[i] = in[i*rows+j]; + if (in[i*rows+j]>out[i]) + out[i] = in[i*rows+j]; } } diff --git a/src/c/statisticsFunctions/max/drowmaxa.c~ b/src/c/statisticsFunctions/max/drowmaxa.c~ new file mode 100644 index 00000000..db0c72c0 --- /dev/null +++ b/src/c/statisticsFunctions/max/drowmaxa.c~ @@ -0,0 +1,24 @@ +/* + * 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 + * + */ + +#include "statMax.h" +//#include "max.h" +void drowmaxa(double *in, int rows, int columns, double* out) { + int i = 0, j = 0; + for (i = 0; i < columns; i++) + { + out[i]=in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]>out[i]) + out[i] = in[i*rows+j]; + } +} diff --git a/src/c/statisticsFunctions/max/i16columnmaxa.c b/src/c/statisticsFunctions/max/i16columnmaxa.c new file mode 100644 index 00000000..94c5cf6a --- /dev/null +++ b/src/c/statisticsFunctions/max/i16columnmaxa.c @@ -0,0 +1,25 @@ +/* + * 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 + * + */ + +#include "statMax.h" +//#include "max.h" +void i16columnmaxa(int16 *in, int rows, int columns, int16* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(int16)in[i*columns]; + for (j=0;jout[i]) + out[i] = (int16)in[i+j*rows]; + } + +} diff --git a/src/c/statisticsFunctions/max/i16columnmaxa.c~ b/src/c/statisticsFunctions/max/i16columnmaxa.c~ new file mode 100644 index 00000000..94c5cf6a --- /dev/null +++ b/src/c/statisticsFunctions/max/i16columnmaxa.c~ @@ -0,0 +1,25 @@ +/* + * 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 + * + */ + +#include "statMax.h" +//#include "max.h" +void i16columnmaxa(int16 *in, int rows, int columns, int16* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(int16)in[i*columns]; + for (j=0;jout[i]) + out[i] = (int16)in[i+j*rows]; + } + +} diff --git a/src/c/statisticsFunctions/max/i16maxa.c b/src/c/statisticsFunctions/max/i16maxa.c new file mode 100644 index 00000000..c1294193 --- /dev/null +++ b/src/c/statisticsFunctions/max/i16maxa.c @@ -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 + * + */ + +#include "statMax.h" +//#include "max.h" +int16 i16maxa(int16 *in, int size) { + int16 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (int16)in[i]; + } + return out; + +} diff --git a/src/c/statisticsFunctions/max/i16maxa.c~ b/src/c/statisticsFunctions/max/i16maxa.c~ new file mode 100644 index 00000000..c1294193 --- /dev/null +++ b/src/c/statisticsFunctions/max/i16maxa.c~ @@ -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 + * + */ + +#include "statMax.h" +//#include "max.h" +int16 i16maxa(int16 *in, int size) { + int16 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (int16)in[i]; + } + return out; + +} diff --git a/src/c/statisticsFunctions/max/i16rowmaxa.c b/src/c/statisticsFunctions/max/i16rowmaxa.c new file mode 100644 index 00000000..263e56ca --- /dev/null +++ b/src/c/statisticsFunctions/max/i16rowmaxa.c @@ -0,0 +1,25 @@ +/* + * 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 + * + */ + +#include "statMax.h" +//#include "max.h" + +void i16rowmaxa(int16 *in, int rows, int columns, int16* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(int16)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]>out[i]) + out[i] = (int16)in[i*rows+j]; + } +} diff --git a/src/c/statisticsFunctions/max/i16rowmaxa.c~ b/src/c/statisticsFunctions/max/i16rowmaxa.c~ new file mode 100644 index 00000000..263e56ca --- /dev/null +++ b/src/c/statisticsFunctions/max/i16rowmaxa.c~ @@ -0,0 +1,25 @@ +/* + * 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 + * + */ + +#include "statMax.h" +//#include "max.h" + +void i16rowmaxa(int16 *in, int rows, int columns, int16* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(int16)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]>out[i]) + out[i] = (int16)in[i*rows+j]; + } +} diff --git a/src/c/statisticsFunctions/max/i8columnmaxa.c b/src/c/statisticsFunctions/max/i8columnmaxa.c new file mode 100644 index 00000000..9c214dbb --- /dev/null +++ b/src/c/statisticsFunctions/max/i8columnmaxa.c @@ -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 + * + */ + +#include "statMax.h" +//#include "max.h" + +void i8columnmaxa(int8 *in, int rows, int columns, int8* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(int8)in[i*columns]; + for (j=0;jout[i]) + out[i] = (int8)in[i+j*rows]; + } + +} diff --git a/src/c/statisticsFunctions/max/i8columnmaxa.c~ b/src/c/statisticsFunctions/max/i8columnmaxa.c~ new file mode 100644 index 00000000..9c214dbb --- /dev/null +++ b/src/c/statisticsFunctions/max/i8columnmaxa.c~ @@ -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 + * + */ + +#include "statMax.h" +//#include "max.h" + +void i8columnmaxa(int8 *in, int rows, int columns, int8* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=(int8)in[i*columns]; + for (j=0;jout[i]) + out[i] = (int8)in[i+j*rows]; + } + +} diff --git a/src/c/statisticsFunctions/max/i8maxa.c b/src/c/statisticsFunctions/max/i8maxa.c new file mode 100644 index 00000000..67fd3358 --- /dev/null +++ b/src/c/statisticsFunctions/max/i8maxa.c @@ -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 + * + */ +#include "statMax.h" +//#include "max.h" + +int8 i8maxa(int8 *in, int size) { + int8 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (int8)in[i]; + } + return out; + +} diff --git a/src/c/statisticsFunctions/max/i8maxa.c~ b/src/c/statisticsFunctions/max/i8maxa.c~ new file mode 100644 index 00000000..67fd3358 --- /dev/null +++ b/src/c/statisticsFunctions/max/i8maxa.c~ @@ -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 + * + */ +#include "statMax.h" +//#include "max.h" + +int8 i8maxa(int8 *in, int size) { + int8 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (int8)in[i]; + } + return out; + +} diff --git a/src/c/statisticsFunctions/max/i8rowmaxa.c b/src/c/statisticsFunctions/max/i8rowmaxa.c new file mode 100644 index 00000000..a6d15aa3 --- /dev/null +++ b/src/c/statisticsFunctions/max/i8rowmaxa.c @@ -0,0 +1,25 @@ +/* + * 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 + * + */ + +#include "statMax.h" +//#include "max.h" + +void i8rowmaxa(int8 *in, int rows, int columns, int8* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(int8)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]>out[i]) + out[i] = (int8)in[i*rows+j]; + } +} diff --git a/src/c/statisticsFunctions/max/i8rowmaxa.c~ b/src/c/statisticsFunctions/max/i8rowmaxa.c~ new file mode 100644 index 00000000..a6d15aa3 --- /dev/null +++ b/src/c/statisticsFunctions/max/i8rowmaxa.c~ @@ -0,0 +1,25 @@ +/* + * 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 + * + */ + +#include "statMax.h" +//#include "max.h" + +void i8rowmaxa(int8 *in, int rows, int columns, int8* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=(int8)in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]>out[i]) + out[i] = (int8)in[i*rows+j]; + } +} diff --git a/src/c/statisticsFunctions/max/scolumnmaxa.c b/src/c/statisticsFunctions/max/scolumnmaxa.c index 71af8460..4014f88a 100644 --- a/src/c/statisticsFunctions/max/scolumnmaxa.c +++ b/src/c/statisticsFunctions/max/scolumnmaxa.c @@ -11,12 +11,13 @@ */ #include "statMax.h" +//#include "max.h" void scolumnmaxa(float *in, int rows, int columns, float* out) { int i = 0, j = 0; for (i = 0; i < rows; i++) { - out[i]=in[i]; + out[i]=in[i*columns]; for (j=0;jout[i]) out[i] = in[i+j*rows]; } diff --git a/src/c/statisticsFunctions/max/scolumnmaxa.c~ b/src/c/statisticsFunctions/max/scolumnmaxa.c~ new file mode 100644 index 00000000..4014f88a --- /dev/null +++ b/src/c/statisticsFunctions/max/scolumnmaxa.c~ @@ -0,0 +1,25 @@ +/* + * 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 + * + */ + +#include "statMax.h" +//#include "max.h" + +void scolumnmaxa(float *in, int rows, int columns, float* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) { + out[i]=in[i*columns]; + for (j=0;jout[i]) out[i] = in[i+j*rows]; + } + +} diff --git a/src/c/statisticsFunctions/max/smaxa.c b/src/c/statisticsFunctions/max/smaxa.c index f47fcffe..03b4cf18 100644 --- a/src/c/statisticsFunctions/max/smaxa.c +++ b/src/c/statisticsFunctions/max/smaxa.c @@ -9,8 +9,8 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ - #include "statMax.h" +//#include "max.h" float smaxa(float *in, int size) { float out = in[0]; diff --git a/src/c/statisticsFunctions/max/smaxa.c~ b/src/c/statisticsFunctions/max/smaxa.c~ new file mode 100644 index 00000000..03b4cf18 --- /dev/null +++ b/src/c/statisticsFunctions/max/smaxa.c~ @@ -0,0 +1,25 @@ +/* + * 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 + * + */ +#include "statMax.h" +//#include "max.h" + +float smaxa(float *in, int size) { + float out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) out = in[i]; + } + return out; + +} diff --git a/src/c/statisticsFunctions/max/srowmaxa.c b/src/c/statisticsFunctions/max/srowmaxa.c index c87ccf7f..ea6c33d6 100644 --- a/src/c/statisticsFunctions/max/srowmaxa.c +++ b/src/c/statisticsFunctions/max/srowmaxa.c @@ -9,8 +9,8 @@ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt * */ - #include "statMax.h" +//#include "max.h" void srowmaxa(float *in, int rows, int columns, float* out) { int i = 0, j = 0; diff --git a/src/c/statisticsFunctions/max/srowmaxa.c~ b/src/c/statisticsFunctions/max/srowmaxa.c~ new file mode 100644 index 00000000..ea6c33d6 --- /dev/null +++ b/src/c/statisticsFunctions/max/srowmaxa.c~ @@ -0,0 +1,23 @@ +/* + * 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 + * + */ +#include "statMax.h" +//#include "max.h" + +void srowmaxa(float *in, int rows, int columns, float* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) { + out[i]=in[i*rows]; + for (j = 1 ; j < rows ; j++) + if (in[i*rows+j]>out[i]) out[i] = in[i*rows+j]; + } +} diff --git a/src/c/statisticsFunctions/max/testDoubleMax.c b/src/c/statisticsFunctions/max/testDoubleMax.c index 81c50324..883b427f 100644 --- a/src/c/statisticsFunctions/max/testDoubleMax.c +++ b/src/c/statisticsFunctions/max/testDoubleMax.c @@ -11,8 +11,8 @@ */ - #include "statMax.h" +//#include "max.h" #include "assert.h" #include "stdio.h" diff --git a/src/c/statisticsFunctions/max/testDoubleMax.c~ b/src/c/statisticsFunctions/max/testDoubleMax.c~ new file mode 100644 index 00000000..883b427f --- /dev/null +++ b/src/c/statisticsFunctions/max/testDoubleMax.c~ @@ -0,0 +1,93 @@ +/* + * 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 "statMax.h" +//#include "max.h" +#include "assert.h" +#include "stdio.h" + + +static void dmaxaTest(void){ + double in[12]={4,5,7,1,2,6,4,1,2,5,4,3}; + double out; + + out = dmaxa(in,12); + assert(out-7==0); + +} + + +static void drowmaxaTest(void){ + double in[12]={4,5,7,1,2,6,4,1,2,5,4,3}; + double result2[2]={7,5}; + double result3[3]={7,6,5}; + double result4[4]={7,6,4,5}; + double result6[6]={5,7,6,4,5,4}; + double out1[1],out2[2],out3[3],out4[4],out6[6],out12[12]; + int i; + + + drowmaxa(in,12,1,out1); + drowmaxa(in,6,2,out2); + drowmaxa(in,4,3,out3); + drowmaxa(in,3,4,out4); + drowmaxa(in,2,6,out6); + drowmaxa(in,1,12,out12); + + assert(out1[0]-7==0); + for (i=0;i<2;i++) assert(out2[i]-result2[i]==0); + for (i=0;i<3;i++) assert(out3[i]-result3[i]==0); + for (i=0;i<4;i++) assert(out4[i]-result4[i]==0); + for (i=0;i<6;i++) assert(out6[i]-result6[i]==0); + for (i=0;i<12;i++) assert(out12[i]-in[i]==0); +} + + +static void dcolumnmaxaTest(void){ + double in[12]={4,5,7,1,2,6,4,1,2,5,4,3}; + double out1[1],out2[2],out3[3],out4[4],out6[6],out12[12]; + double result2[2]={7,6}; + double result3[3]={5,5,7}; + double result4[4]={4,6,7,3}; + double result6[6]={4,5,7,5,4,6}; + int i; + + + + dcolumnmaxa(in,12,1,out12); + dcolumnmaxa(in,6,2,out6); + dcolumnmaxa(in,4,3,out4); + dcolumnmaxa(in,3,4,out3); + dcolumnmaxa(in,2,6,out2); + dcolumnmaxa(in,1,12,out1); + + assert(out1[0]-7==0); + for (i=0;i<2;i++) assert(out2[i]-result2[i]==0); + for (i=0;i<3;i++) assert(out3[i]-result3[i]==0); + for (i=0;i<4;i++) assert(out4[i]-result4[i]==0); + for (i=0;i<6;i++) assert(out6[i]-result6[i]==0); + for (i=0;i<12;i++) assert(out12[i]-in[i]==0); +} + +static int maxTest(void){ + dmaxaTest(); + drowmaxaTest(); + dcolumnmaxaTest(); + return 0; +} + + +int main(void){ + assert(maxTest()==0); + return 0; +} diff --git a/src/c/statisticsFunctions/max/testFloatMax.c b/src/c/statisticsFunctions/max/testFloatMax.c index 7741aef4..cb572f7e 100644 --- a/src/c/statisticsFunctions/max/testFloatMax.c +++ b/src/c/statisticsFunctions/max/testFloatMax.c @@ -13,6 +13,7 @@ #include "statMax.h" +//#include "max.h" #include "assert.h" #include "stdio.h" diff --git a/src/c/statisticsFunctions/max/testFloatMax.c~ b/src/c/statisticsFunctions/max/testFloatMax.c~ new file mode 100644 index 00000000..cb572f7e --- /dev/null +++ b/src/c/statisticsFunctions/max/testFloatMax.c~ @@ -0,0 +1,93 @@ +/* + * 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 "statMax.h" +//#include "max.h" +#include "assert.h" +#include "stdio.h" + +static void smaxaTest(void){ + float in[12]={4,5,7,1,2,6,4,1,2,5,4,3}; + float out; + + out = smaxa(in,12); + assert(out-7==0); + +} + + +static void srowmaxaTest(void){ + float in[12]={4,5,7,1,2,6,4,1,2,5,4,3}; + float out1[1],out2[2],out3[3],out4[4],out6[6],out12[12]; + float result2[2]={7,5}; + float result3[3]={7,6,5}; + float result4[4]={7,6,4,5}; + float result6[6]={5,7,6,4,5,4}; + int i; + + + srowmaxa(in,12,1,out1); + srowmaxa(in,6,2,out2); + srowmaxa(in,4,3,out3); + srowmaxa(in,3,4,out4); + srowmaxa(in,2,6,out6); + srowmaxa(in,1,12,out12); + + assert(out1[0]-7==0); + for (i=0;i<2;i++) assert(out2[i]-result2[i]==0); + for (i=0;i<3;i++) assert(out3[i]-result3[i]==0); + for (i=0;i<4;i++) assert(out4[i]-result4[i]==0); + for (i=0;i<6;i++) assert(out6[i]-result6[i]==0); + for (i=0;i<12;i++) assert(out12[i]-in[i]==0); +} + + +static void scolumnmaxaTest(void){ + float in[12]={4,5,7,1,2,6,4,1,2,5,4,3}; + float out1[1],out2[2],out3[3],out4[4],out6[6],out12[12]; + float result2[2]={7,6}; + float result3[3]={5,5,7}; + float result4[4]={4,6,7,3}; + float result6[6]={4,5,7,5,4,6}; + int i; + + + + scolumnmaxa(in,12,1,out12); + scolumnmaxa(in,6,2,out6); + scolumnmaxa(in,4,3,out4); + scolumnmaxa(in,3,4,out3); + scolumnmaxa(in,2,6,out2); + scolumnmaxa(in,1,12,out1); + + assert(out1[0]-7==0); + for (i=0;i<2;i++) assert(out2[i]-result2[i]==0); + for (i=0;i<3;i++) assert(out3[i]-result3[i]==0); + for (i=0;i<4;i++) assert(out4[i]-result4[i]==0); + for (i=0;i<6;i++) assert(out6[i]-result6[i]==0); + for (i=0;i<12;i++) assert(out12[i]-in[i]==0); +} + +static int maxTest(void){ + smaxaTest(); + srowmaxaTest(); + scolumnmaxaTest(); + return 0; +} + + +int main(void){ + assert(maxTest()==0); + return 0; +} diff --git a/src/c/statisticsFunctions/max/u16columnmaxa.c b/src/c/statisticsFunctions/max/u16columnmaxa.c new file mode 100644 index 00000000..e0ccb3ae --- /dev/null +++ b/src/c/statisticsFunctions/max/u16columnmaxa.c @@ -0,0 +1,28 @@ +/* + * 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 + * + */ + +#include "statMax.h" + +//#include "max.h" + +void u16columnmaxa(uint16 *in, int rows, int columns, uint16* out) { + int i = 0, j = 0; + + + for (i = 0; i < rows; i++) { + out[i]=(uint16)in[i]; + for (j=0;jout[i]) + out[i] = (uint16)in[i+j*rows]; + } + +} diff --git a/src/c/statisticsFunctions/max/u16columnmaxa.c~ b/src/c/statisticsFunctions/max/u16columnmaxa.c~ new file mode 100644 index 00000000..e0ccb3ae --- /dev/null +++ b/src/c/statisticsFunctions/max/u16columnmaxa.c~ @@ -0,0 +1,28 @@ +/* + * 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 + * + */ + +#include "statMax.h" + +//#include "max.h" + +void u16columnmaxa(uint16 *in, int rows, int columns, uint16* out) { + int i = 0, j = 0; + + + for (i = 0; i < rows; i++) { + out[i]=(uint16)in[i]; + for (j=0;jout[i]) + out[i] = (uint16)in[i+j*rows]; + } + +} diff --git a/src/c/statisticsFunctions/max/u16maxa.c b/src/c/statisticsFunctions/max/u16maxa.c new file mode 100644 index 00000000..c3af84f6 --- /dev/null +++ b/src/c/statisticsFunctions/max/u16maxa.c @@ -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 + * + */ +#include "statMax.h" +//#include "max.h" + +uint16 u16maxa(uint16 *in, int size) { + uint16 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (uint16)in[i]; + } + return out; + +} diff --git a/src/c/statisticsFunctions/max/u16maxa.c~ b/src/c/statisticsFunctions/max/u16maxa.c~ new file mode 100644 index 00000000..c881d88a --- /dev/null +++ b/src/c/statisticsFunctions/max/u16maxa.c~ @@ -0,0 +1,25 @@ +/* + * 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 + * + */ +#include "statMax.h" +//#include "max.h" + +uint16 u16maxa(uint16 *in, int size) { + uint16 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) out = (uint16)in[i]; + } + return out; + +} diff --git a/src/c/statisticsFunctions/max/u16rowmaxa.c b/src/c/statisticsFunctions/max/u16rowmaxa.c new file mode 100644 index 00000000..cef61f1d --- /dev/null +++ b/src/c/statisticsFunctions/max/u16rowmaxa.c @@ -0,0 +1,29 @@ +/* + * 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 + * + */ +#include "statMax.h" +//#include +//#include "max.h" + +void u16rowmaxa(uint16 *in, int rows, int columns, uint16* out) { + int i = 0, j = 0; + //out = malloc(columns*sizeof(uint16)); + for (i = 0; i < columns; i++) + { + out[i]=(uint16)in[i]; + for (j = 1 ; j < rows ; j++) + { + if (in[j*columns+i]>out[i]) + out[i] = (uint16)in[j*columns+i]; + } + } + +} diff --git a/src/c/statisticsFunctions/max/u16rowmaxa.c~ b/src/c/statisticsFunctions/max/u16rowmaxa.c~ new file mode 100644 index 00000000..7c6b6801 --- /dev/null +++ b/src/c/statisticsFunctions/max/u16rowmaxa.c~ @@ -0,0 +1,28 @@ +/* + * 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 + * + */ +#include "statMax.h" +#include +//#include "max.h" + +void u16rowmaxa(uint16 *in, int rows, int columns, uint16* out) { + int i = 0, j = 0; + for (i = 0; i < columns; i++) + { + out[i]=(uint16)in[i]; + for (j = 1 ; j < rows ; j++) + { + if (in[j*columns+i]>out[i]) + out[i] = (uint16)in[j*columns+i]; + } + } + +} diff --git a/src/c/statisticsFunctions/max/u8columnmaxa.c b/src/c/statisticsFunctions/max/u8columnmaxa.c new file mode 100644 index 00000000..222bc291 --- /dev/null +++ b/src/c/statisticsFunctions/max/u8columnmaxa.c @@ -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 + * + */ +#include "statMax.h" +//#include "max.h" + +void u8columnmaxa(uint8 *in, int rows, int columns, uint8* out) { + int i = 0, j = 0; + + for (i = 0; i < rows; i++) +{ + out[i]=(uint8)in[0]; + for (j=0;jout[i]) + out[i] = (uint8)in[j]; + } + +} diff --git a/src/c/statisticsFunctions/max/u8columnmaxa.c~ b/src/c/statisticsFunctions/max/u8columnmaxa.c~ new file mode 100644 index 00000000..e7f8f0ef --- /dev/null +++ b/src/c/statisticsFunctions/max/u8columnmaxa.c~ @@ -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 + * + */ +#include "statMax.h" +//#include "max.h" + +void u8columnmaxa(uint8 *in, int rows, int columns, uint8* out) { + int i = 0, j = 0; + + for (i = 0; i < columns; i++) + { + out[i]=(uint8)in[0]; + for (j=0;jout[i]) + out[i] = (uint8)in[j]; + } + +} diff --git a/src/c/statisticsFunctions/max/u8maxa.c b/src/c/statisticsFunctions/max/u8maxa.c new file mode 100644 index 00000000..3e599150 --- /dev/null +++ b/src/c/statisticsFunctions/max/u8maxa.c @@ -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 + * + */ + +#include "statMax.h" +//#include "max.h" +uint8 u8maxa(uint8 *in, int size) { + uint8 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (uint8)in[i]; + } + return out; + +} diff --git a/src/c/statisticsFunctions/max/u8maxa.c~ b/src/c/statisticsFunctions/max/u8maxa.c~ new file mode 100644 index 00000000..d9b6eca0 --- /dev/null +++ b/src/c/statisticsFunctions/max/u8maxa.c~ @@ -0,0 +1,27 @@ +/* + * 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 + * + */ + +#include "statMax.h" +//#include "max.h" + +uint8 u8maxa(uint8 *in, int size) { + uint8 out = in[0]; + int i = 0; + + for (i = 1; i < size; ++i) + { + if (in[i]>out) + out = (uint8)in[i]; + } + return out; + +} diff --git a/src/c/statisticsFunctions/max/u8rowmaxa.c b/src/c/statisticsFunctions/max/u8rowmaxa.c new file mode 100644 index 00000000..fda293c7 --- /dev/null +++ b/src/c/statisticsFunctions/max/u8rowmaxa.c @@ -0,0 +1,28 @@ +/* + * 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 + * + */ +#include "statMax.h" +//#include "max.h" + +void u8rowmaxa(uint8 *in, int rows, int columns, uint8* out) { + int i = 0, j = 0; + + + for (i = 0; i < columns; i++) + { + out[i]=(uint8)in[0]; + for (j = 0 ; j < rows ; j++) + { + if (in[j]>out[i]) + out[i] = (uint8)in[j]; + } + } +} diff --git a/src/c/statisticsFunctions/max/u8rowmaxa.c~ b/src/c/statisticsFunctions/max/u8rowmaxa.c~ new file mode 100644 index 00000000..fda293c7 --- /dev/null +++ b/src/c/statisticsFunctions/max/u8rowmaxa.c~ @@ -0,0 +1,28 @@ +/* + * 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 + * + */ +#include "statMax.h" +//#include "max.h" + +void u8rowmaxa(uint8 *in, int rows, int columns, uint8* out) { + int i = 0, j = 0; + + + for (i = 0; i < columns; i++) + { + out[i]=(uint8)in[0]; + for (j = 0 ; j < rows ; j++) + { + if (in[j]>out[i]) + out[i] = (uint8)in[j]; + } + } +} -- cgit From 1deb8dda99b1bd8e65f1ff9a3ca3fadd95b27684 Mon Sep 17 00:00:00 2001 From: imushir Date: Fri, 27 Nov 2015 15:24:05 +0530 Subject: added c files for u8 u16 i8 i16 --- src/c/statisticsFunctions/min/dcolumnmina.c | 2 +- src/c/statisticsFunctions/min/dcolumnmina.c~ | 24 ++++++++++++++++++++++++ src/c/statisticsFunctions/min/i16columnmina.c | 25 +++++++++++++++++++++++++ src/c/statisticsFunctions/min/i16columnmina.c~ | 25 +++++++++++++++++++++++++ src/c/statisticsFunctions/min/i16mina.c | 26 ++++++++++++++++++++++++++ src/c/statisticsFunctions/min/i16mina.c~ | 26 ++++++++++++++++++++++++++ src/c/statisticsFunctions/min/i16rowmina.c | 24 ++++++++++++++++++++++++ src/c/statisticsFunctions/min/i16rowmina.c~ | 24 ++++++++++++++++++++++++ src/c/statisticsFunctions/min/i8columnmina.c | 25 +++++++++++++++++++++++++ src/c/statisticsFunctions/min/i8columnmina.c~ | 25 +++++++++++++++++++++++++ src/c/statisticsFunctions/min/i8mina.c | 26 ++++++++++++++++++++++++++ src/c/statisticsFunctions/min/i8mina.c~ | 26 ++++++++++++++++++++++++++ src/c/statisticsFunctions/min/i8rowmina.c | 24 ++++++++++++++++++++++++ src/c/statisticsFunctions/min/i8rowmina.c~ | 24 ++++++++++++++++++++++++ src/c/statisticsFunctions/min/scolumnmina.c | 2 +- src/c/statisticsFunctions/min/scolumnmina.c~ | 24 ++++++++++++++++++++++++ src/c/statisticsFunctions/min/u16columnmina.c | 25 +++++++++++++++++++++++++ src/c/statisticsFunctions/min/u16columnmina.c~ | 25 +++++++++++++++++++++++++ src/c/statisticsFunctions/min/u16mina.c | 26 ++++++++++++++++++++++++++ src/c/statisticsFunctions/min/u16mina.c~ | 26 ++++++++++++++++++++++++++ src/c/statisticsFunctions/min/u16rowmina.c | 24 ++++++++++++++++++++++++ src/c/statisticsFunctions/min/u16rowmina.c~ | 24 ++++++++++++++++++++++++ src/c/statisticsFunctions/min/u8columnmina.c | 25 +++++++++++++++++++++++++ src/c/statisticsFunctions/min/u8columnmina.c~ | 25 +++++++++++++++++++++++++ src/c/statisticsFunctions/min/u8mina.c | 26 ++++++++++++++++++++++++++ src/c/statisticsFunctions/min/u8mina.c~ | 26 ++++++++++++++++++++++++++ src/c/statisticsFunctions/min/u8rowmina.c | 24 ++++++++++++++++++++++++ src/c/statisticsFunctions/min/u8rowmina.c~ | 24 ++++++++++++++++++++++++ 28 files changed, 650 insertions(+), 2 deletions(-) create mode 100644 src/c/statisticsFunctions/min/dcolumnmina.c~ create mode 100644 src/c/statisticsFunctions/min/i16columnmina.c create mode 100644 src/c/statisticsFunctions/min/i16columnmina.c~ create mode 100644 src/c/statisticsFunctions/min/i16mina.c create mode 100644 src/c/statisticsFunctions/min/i16mina.c~ create mode 100644 src/c/statisticsFunctions/min/i16rowmina.c create mode 100644 src/c/statisticsFunctions/min/i16rowmina.c~ create mode 100644 src/c/statisticsFunctions/min/i8columnmina.c create mode 100644 src/c/statisticsFunctions/min/i8columnmina.c~ create mode 100644 src/c/statisticsFunctions/min/i8mina.c create mode 100644 src/c/statisticsFunctions/min/i8mina.c~ create mode 100644 src/c/statisticsFunctions/min/i8rowmina.c create mode 100644 src/c/statisticsFunctions/min/i8rowmina.c~ create mode 100644 src/c/statisticsFunctions/min/scolumnmina.c~ create mode 100644 src/c/statisticsFunctions/min/u16columnmina.c create mode 100644 src/c/statisticsFunctions/min/u16columnmina.c~ create mode 100644 src/c/statisticsFunctions/min/u16mina.c create mode 100644 src/c/statisticsFunctions/min/u16mina.c~ create mode 100644 src/c/statisticsFunctions/min/u16rowmina.c create mode 100644 src/c/statisticsFunctions/min/u16rowmina.c~ create mode 100644 src/c/statisticsFunctions/min/u8columnmina.c create mode 100644 src/c/statisticsFunctions/min/u8columnmina.c~ create mode 100644 src/c/statisticsFunctions/min/u8mina.c create mode 100644 src/c/statisticsFunctions/min/u8mina.c~ create mode 100644 src/c/statisticsFunctions/min/u8rowmina.c create mode 100644 src/c/statisticsFunctions/min/u8rowmina.c~ (limited to 'src') diff --git a/src/c/statisticsFunctions/min/dcolumnmina.c b/src/c/statisticsFunctions/min/dcolumnmina.c index e12cb8ff..6f0b3c1a 100644 --- a/src/c/statisticsFunctions/min/dcolumnmina.c +++ b/src/c/statisticsFunctions/min/dcolumnmina.c @@ -16,7 +16,7 @@ void dcolumnmina(double *in, int rows, int columns, double* out) { int i = 0, j = 0; for (i = 0; i < rows; i++) { - out[i]=in[i]; + out[i]=in[i*columns]; for (j=0;j=b?a:b) + +#define maxa(a,size1,b,size2,out) {int i;\ + for (i=0;i #include "sqrt.h" -double dsqrts(double in){ +double dsqrts(double in){ return sqrt(in); } diff --git a/src/c/elementaryFunctions/sqrt/dsqrts.c~ b/src/c/elementaryFunctions/sqrt/dsqrts.c~ new file mode 100644 index 00000000..350cbbd0 --- /dev/null +++ b/src/c/elementaryFunctions/sqrt/dsqrts.c~ @@ -0,0 +1,18 @@ +/* + * 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 +#include "sqrt.h" + +double dsqrts(double in){ + return sqrt(in); +} diff --git a/src/c/elementaryFunctions/sqrt/i16sqrta.c~ b/src/c/elementaryFunctions/sqrt/i16sqrta.c~ new file mode 100644 index 00000000..95a67982 --- /dev/null +++ b/src/c/elementaryFunctions/sqrt/i16sqrta.c~ @@ -0,0 +1,20 @@ +/* + * 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 "sqrt.h" + +void i16sqrta(int16* in, int size, int16* out) { + int i = 0; + for (i = 0 ; i < size ; ++i) { + out[i] = i16sqrts(in[i]); + } +} diff --git a/src/c/elementaryFunctions/sqrt/i16sqrts.c~ b/src/c/elementaryFunctions/sqrt/i16sqrts.c~ new file mode 100644 index 00000000..2f286214 --- /dev/null +++ b/src/c/elementaryFunctions/sqrt/i16sqrts.c~ @@ -0,0 +1,18 @@ +/* + * 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 +#include "sqrt.h" + +int16 i16sqrts(int16 in){ + return sqrt(in); +} diff --git a/src/c/elementaryFunctions/sqrt/i8sqrta.c~ b/src/c/elementaryFunctions/sqrt/i8sqrta.c~ new file mode 100644 index 00000000..b4b40c48 --- /dev/null +++ b/src/c/elementaryFunctions/sqrt/i8sqrta.c~ @@ -0,0 +1,20 @@ +/* + * 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 "sqrt.h" + +void i8sqrta(int8* in, int size, int8* out) { + int i = 0; + for (i = 0 ; i < size ; ++i) { + out[i] = i8sqrts(in[i]); + } +} diff --git a/src/c/elementaryFunctions/sqrt/i8sqrts.c~ b/src/c/elementaryFunctions/sqrt/i8sqrts.c~ new file mode 100644 index 00000000..bbd6997e --- /dev/null +++ b/src/c/elementaryFunctions/sqrt/i8sqrts.c~ @@ -0,0 +1,18 @@ +/* + * 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 +#include "sqrt.h" + +int8 i8sqrts(int8 in){ + return sqrt(in); +} diff --git a/src/c/elementaryFunctions/sqrt/u16sqrta.c~ b/src/c/elementaryFunctions/sqrt/u16sqrta.c~ new file mode 100644 index 00000000..2589a67d --- /dev/null +++ b/src/c/elementaryFunctions/sqrt/u16sqrta.c~ @@ -0,0 +1,20 @@ +/* + * 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 "sqrt.h" + +void u16sqrta(uint16* in, int size, float* out) { + int i = 0; + for (i = 0 ; i < size ; ++i) { + out[i] = u16sqrts(in[i]); + } +} diff --git a/src/c/elementaryFunctions/sqrt/u16sqrts.c~ b/src/c/elementaryFunctions/sqrt/u16sqrts.c~ new file mode 100644 index 00000000..1226025e --- /dev/null +++ b/src/c/elementaryFunctions/sqrt/u16sqrts.c~ @@ -0,0 +1,18 @@ +/* + * 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 +#include "sqrt.h" + +float u16sqrts(uint16 in){ + return sqrt(in); +} diff --git a/src/c/elementaryFunctions/sqrt/u8sqrta.c~ b/src/c/elementaryFunctions/sqrt/u8sqrta.c~ new file mode 100644 index 00000000..03424b99 --- /dev/null +++ b/src/c/elementaryFunctions/sqrt/u8sqrta.c~ @@ -0,0 +1,20 @@ +/* + * 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 "sqrt.h" + +void u8sqrta(uint8* in, int size, float* out) { + int i = 0; + for (i = 0 ; i < size ; ++i) { + out[i] = u8sqrts(in[i]); + } +} diff --git a/src/c/elementaryFunctions/sqrt/u8sqrts.c~ b/src/c/elementaryFunctions/sqrt/u8sqrts.c~ new file mode 100644 index 00000000..29ecc40c --- /dev/null +++ b/src/c/elementaryFunctions/sqrt/u8sqrts.c~ @@ -0,0 +1,18 @@ +/* + * 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 +#include "sqrt.h" + +float u8sqrts(uint8 in){ + return sqrt(in); +} -- cgit From a68ba950e81e43dfc8edb6b5966aaf601dbb8f8a Mon Sep 17 00:00:00 2001 From: imushir Date: Fri, 27 Nov 2015 15:37:10 +0530 Subject: #define for u8 u16 i8 i16 added --- src/c/elementaryFunctions/includes/sqrt.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/c/elementaryFunctions/includes/sqrt.h b/src/c/elementaryFunctions/includes/sqrt.h index 7885c9c2..df11b20e 100644 --- a/src/c/elementaryFunctions/includes/sqrt.h +++ b/src/c/elementaryFunctions/includes/sqrt.h @@ -16,6 +16,7 @@ #include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -48,13 +49,14 @@ EXTERN_ELEMFUNCT floatComplex csqrts(floatComplex in); */ EXTERN_ELEMFUNCT doubleComplex zsqrts(doubleComplex in); + /* ** \brief Float Matrix Square Root function ** \param in : input array value. ** \param out : output array value. ** \param size : the size of in and out arrays. */ -EXTERN_ELEMFUNCT void ssqrta(float* in, int size, float* out); +EXTERN_ELEMFUNCT void ssqrta(float* in, int size, float* out); /* ** \brief Double Matrix Square Root function @@ -80,6 +82,10 @@ EXTERN_ELEMFUNCT void csqrta(floatComplex* in, int size, floatComplex* out); */ EXTERN_ELEMFUNCT void zsqrta(doubleComplex* in, int size, doubleComplex* out); + + + + #ifdef __cplusplus } /* extern "C" */ #endif -- cgit From bdf2f89f7f221fc9d24d5b67bfa3235924334403 Mon Sep 17 00:00:00 2001 From: imushir Date: Fri, 27 Nov 2015 15:38:03 +0530 Subject: reference for u8 u16 i8 i16 for different combination added --- src/c/elementaryFunctions/interfaces/int_sqrt.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/c/elementaryFunctions/interfaces/int_sqrt.h b/src/c/elementaryFunctions/interfaces/int_sqrt.h index 0efbca96..090d9825 100644 --- a/src/c/elementaryFunctions/interfaces/int_sqrt.h +++ b/src/c/elementaryFunctions/interfaces/int_sqrt.h @@ -33,27 +33,32 @@ #define __INT_SQRT_H__ #define s0sqrts0(in) ssqrts(in) - + #define s0sqrtc0(in) csqrts(FloatComplex(in,0)) #define d0sqrtd0(in) dsqrts(in) - + #define d0sqrtz0(in) zsqrts(DoubleComplex(in,0)) #define c0sqrtc0(in) csqrts(in) - + #define z0sqrtz0(in) zsqrts(in) - + + + #define s2sqrts2(in,size,out) ssqrta(in, size[0]*size[1], out) #define s2sqrtc2(in,size,out) csqrta(FloatComplexMatrix(in,0), size[0]*size[1], out) #define d2sqrtd2(in,size,out) dsqrta(in, size[0]*size[1], out) - + #define d2sqrtz2(in,size,out) zsqrta(DoubleComplexMatrix(in,0), size[0]*size[1], out) #define c2sqrtc2(in,size,out) csqrta(in, size[0]*size[1], out) - -#define z2sqrtz2(in,size,out) zsqrta(in, size[0]*size[1], out) + +#define z2sqrtz2(in,size,out) zsqrta(in, size[0]*size[1], out) + + + #endif /* !__INT_SQRT_H__ */ -- cgit From dfafd95d1ae7cf5627cd5434cbbb5d7b8fdb30b5 Mon Sep 17 00:00:00 2001 From: imushir Date: Fri, 27 Nov 2015 15:40:33 +0530 Subject: added c files for u8 u16 i8 i16 --- src/c/matrixOperations/transpose/i16transposea.c | 27 +++++++++++++++++++++++ src/c/matrixOperations/transpose/i16transposea.c~ | 27 +++++++++++++++++++++++ src/c/matrixOperations/transpose/i8transposea.c | 27 +++++++++++++++++++++++ src/c/matrixOperations/transpose/i8transposea.c~ | 27 +++++++++++++++++++++++ src/c/matrixOperations/transpose/u16transposea.c | 27 +++++++++++++++++++++++ src/c/matrixOperations/transpose/u16transposea.c~ | 27 +++++++++++++++++++++++ src/c/matrixOperations/transpose/u8transposea.c | 27 +++++++++++++++++++++++ src/c/matrixOperations/transpose/u8transposea.c~ | 27 +++++++++++++++++++++++ 8 files changed, 216 insertions(+) create mode 100644 src/c/matrixOperations/transpose/i16transposea.c create mode 100644 src/c/matrixOperations/transpose/i16transposea.c~ create mode 100644 src/c/matrixOperations/transpose/i8transposea.c create mode 100644 src/c/matrixOperations/transpose/i8transposea.c~ create mode 100644 src/c/matrixOperations/transpose/u16transposea.c create mode 100644 src/c/matrixOperations/transpose/u16transposea.c~ create mode 100644 src/c/matrixOperations/transpose/u8transposea.c create mode 100644 src/c/matrixOperations/transpose/u8transposea.c~ (limited to 'src') diff --git a/src/c/matrixOperations/transpose/i16transposea.c b/src/c/matrixOperations/transpose/i16transposea.c new file mode 100644 index 00000000..366de067 --- /dev/null +++ b/src/c/matrixOperations/transpose/i16transposea.c @@ -0,0 +1,27 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTranspose.h" + +void i16transposea ( int16* in , int lines , int columns, int16* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (int16)in[i+j*lines]; + } + +} diff --git a/src/c/matrixOperations/transpose/i16transposea.c~ b/src/c/matrixOperations/transpose/i16transposea.c~ new file mode 100644 index 00000000..366de067 --- /dev/null +++ b/src/c/matrixOperations/transpose/i16transposea.c~ @@ -0,0 +1,27 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTranspose.h" + +void i16transposea ( int16* in , int lines , int columns, int16* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (int16)in[i+j*lines]; + } + +} diff --git a/src/c/matrixOperations/transpose/i8transposea.c b/src/c/matrixOperations/transpose/i8transposea.c new file mode 100644 index 00000000..20d451a0 --- /dev/null +++ b/src/c/matrixOperations/transpose/i8transposea.c @@ -0,0 +1,27 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTranspose.h" + +void i8transposea ( int8* in , int lines , int columns, int8* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (int8)in[i+j*lines]; + } + +} diff --git a/src/c/matrixOperations/transpose/i8transposea.c~ b/src/c/matrixOperations/transpose/i8transposea.c~ new file mode 100644 index 00000000..20d451a0 --- /dev/null +++ b/src/c/matrixOperations/transpose/i8transposea.c~ @@ -0,0 +1,27 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTranspose.h" + +void i8transposea ( int8* in , int lines , int columns, int8* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (int8)in[i+j*lines]; + } + +} diff --git a/src/c/matrixOperations/transpose/u16transposea.c b/src/c/matrixOperations/transpose/u16transposea.c new file mode 100644 index 00000000..33b35ecb --- /dev/null +++ b/src/c/matrixOperations/transpose/u16transposea.c @@ -0,0 +1,27 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTranspose.h" + +void u16transposea ( uint16* in , int lines , int columns, uint16* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (uint16)in[i+j*lines]; + } + +} diff --git a/src/c/matrixOperations/transpose/u16transposea.c~ b/src/c/matrixOperations/transpose/u16transposea.c~ new file mode 100644 index 00000000..33b35ecb --- /dev/null +++ b/src/c/matrixOperations/transpose/u16transposea.c~ @@ -0,0 +1,27 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTranspose.h" + +void u16transposea ( uint16* in , int lines , int columns, uint16* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (uint16)in[i+j*lines]; + } + +} diff --git a/src/c/matrixOperations/transpose/u8transposea.c b/src/c/matrixOperations/transpose/u8transposea.c new file mode 100644 index 00000000..2d0dd743 --- /dev/null +++ b/src/c/matrixOperations/transpose/u8transposea.c @@ -0,0 +1,27 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTranspose.h" + +void u8transposea ( uint8* in , int lines , int columns, uint8* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (uint8)in[i+j*lines]; + } + +} diff --git a/src/c/matrixOperations/transpose/u8transposea.c~ b/src/c/matrixOperations/transpose/u8transposea.c~ new file mode 100644 index 00000000..2d0dd743 --- /dev/null +++ b/src/c/matrixOperations/transpose/u8transposea.c~ @@ -0,0 +1,27 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTranspose.h" + +void u8transposea ( uint8* in , int lines , int columns, uint8* out ){ + + int i = 0 ; + int j = 0 ; + + for(i = 0 ; i < lines ; i++) + { + for(j = 0 ; j < columns ; j++) + + out[j+i*columns] = (uint8)in[i+j*lines]; + } + +} -- cgit From e4c4c540dc4a604084354b93d0f96e5bebcc4111 Mon Sep 17 00:00:00 2001 From: imushir Date: Fri, 27 Nov 2015 15:41:35 +0530 Subject: added c files for u8 u16 i8 i16 --- src/c/matrixOperations/trace/i16tracea.c | 28 ++++++++++++++++++++++++++++ src/c/matrixOperations/trace/i16tracea.c~ | 28 ++++++++++++++++++++++++++++ src/c/matrixOperations/trace/i8tracea.c | 28 ++++++++++++++++++++++++++++ src/c/matrixOperations/trace/i8tracea.c~ | 28 ++++++++++++++++++++++++++++ src/c/matrixOperations/trace/u16tracea.c | 28 ++++++++++++++++++++++++++++ src/c/matrixOperations/trace/u16tracea.c~ | 28 ++++++++++++++++++++++++++++ src/c/matrixOperations/trace/u8tracea.c | 28 ++++++++++++++++++++++++++++ src/c/matrixOperations/trace/u8tracea.c~ | 28 ++++++++++++++++++++++++++++ 8 files changed, 224 insertions(+) create mode 100644 src/c/matrixOperations/trace/i16tracea.c create mode 100644 src/c/matrixOperations/trace/i16tracea.c~ create mode 100644 src/c/matrixOperations/trace/i8tracea.c create mode 100644 src/c/matrixOperations/trace/i8tracea.c~ create mode 100644 src/c/matrixOperations/trace/u16tracea.c create mode 100644 src/c/matrixOperations/trace/u16tracea.c~ create mode 100644 src/c/matrixOperations/trace/u8tracea.c create mode 100644 src/c/matrixOperations/trace/u8tracea.c~ (limited to 'src') diff --git a/src/c/matrixOperations/trace/i16tracea.c b/src/c/matrixOperations/trace/i16tracea.c new file mode 100644 index 00000000..6a3d6a8b --- /dev/null +++ b/src/c/matrixOperations/trace/i16tracea.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTrace.h" + +int16 i16tracea ( int16* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + int16 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (int16)in[i*lines + i] ; + + return out; +} + + diff --git a/src/c/matrixOperations/trace/i16tracea.c~ b/src/c/matrixOperations/trace/i16tracea.c~ new file mode 100644 index 00000000..6a3d6a8b --- /dev/null +++ b/src/c/matrixOperations/trace/i16tracea.c~ @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTrace.h" + +int16 i16tracea ( int16* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + int16 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (int16)in[i*lines + i] ; + + return out; +} + + diff --git a/src/c/matrixOperations/trace/i8tracea.c b/src/c/matrixOperations/trace/i8tracea.c new file mode 100644 index 00000000..88a1c46e --- /dev/null +++ b/src/c/matrixOperations/trace/i8tracea.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTrace.h" + +int8 i8tracea ( int8* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + int8 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (int8)in[i*lines + i] ; + + return out; +} + + diff --git a/src/c/matrixOperations/trace/i8tracea.c~ b/src/c/matrixOperations/trace/i8tracea.c~ new file mode 100644 index 00000000..88a1c46e --- /dev/null +++ b/src/c/matrixOperations/trace/i8tracea.c~ @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTrace.h" + +int8 i8tracea ( int8* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + int8 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (int8)in[i*lines + i] ; + + return out; +} + + diff --git a/src/c/matrixOperations/trace/u16tracea.c b/src/c/matrixOperations/trace/u16tracea.c new file mode 100644 index 00000000..3cf9943c --- /dev/null +++ b/src/c/matrixOperations/trace/u16tracea.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTrace.h" + +uint16 u16tracea ( uint16* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + uint16 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (uint16)in[i*lines + i] ; + + return out; +} + + diff --git a/src/c/matrixOperations/trace/u16tracea.c~ b/src/c/matrixOperations/trace/u16tracea.c~ new file mode 100644 index 00000000..3cf9943c --- /dev/null +++ b/src/c/matrixOperations/trace/u16tracea.c~ @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTrace.h" + +uint16 u16tracea ( uint16* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + uint16 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (uint16)in[i*lines + i] ; + + return out; +} + + diff --git a/src/c/matrixOperations/trace/u8tracea.c b/src/c/matrixOperations/trace/u8tracea.c new file mode 100644 index 00000000..97e73e21 --- /dev/null +++ b/src/c/matrixOperations/trace/u8tracea.c @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTrace.h" + +uint8 u8tracea ( uint8* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + uint8 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (uint8)in[i*lines + i] ; + + return out; +} + + diff --git a/src/c/matrixOperations/trace/u8tracea.c~ b/src/c/matrixOperations/trace/u8tracea.c~ new file mode 100644 index 00000000..97e73e21 --- /dev/null +++ b/src/c/matrixOperations/trace/u8tracea.c~ @@ -0,0 +1,28 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008-2008 - INRIA - Allan SIMON + * + * 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 "matrixTrace.h" + +uint8 u8tracea ( uint8* in ,int lines){ + + + int i = 0 ; + //double out = 0 ; + uint8 out = 0; + + for ( i = 0 ; i < lines ; ++i) + out += (uint8)in[i*lines + i] ; + + return out; +} + + -- cgit From b4de19f848751783259164cf02fc965a0ab77925 Mon Sep 17 00:00:00 2001 From: imushir Date: Fri, 27 Nov 2015 15:42:52 +0530 Subject: #define for u8 u16 i8 i16 added --- src/c/matrixOperations/includes/matrixTrace.h | 39 ++++++++++++++++++++++ src/c/matrixOperations/includes/matrixTranspose.h | 40 +++++++++++++++++++++++ 2 files changed, 79 insertions(+) (limited to 'src') diff --git a/src/c/matrixOperations/includes/matrixTrace.h b/src/c/matrixOperations/includes/matrixTrace.h index 76b77454..80f895df 100644 --- a/src/c/matrixOperations/includes/matrixTrace.h +++ b/src/c/matrixOperations/includes/matrixTrace.h @@ -16,6 +16,7 @@ #include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #ifdef __cplusplus extern "C" { @@ -63,6 +64,44 @@ EXTERN_MATOPS floatComplex ctracea ( floatComplex* in ,int lines ) ; */ EXTERN_MATOPS doubleComplex ztracea ( doubleComplex* in ,int lines ) ; + +/* +** \brief Compute the trace of a uint8 matrix. +** \param in : input array. +** \param lines : number of lines +** \param out : uint8 containing the trace. +*/ +EXTERN_MATOPS uint8 u8tracea ( uint8* in ,int lines ) ; + + +/* +** \brief Compute the trace of a uint16 matrix. +** \param in : input array. +** \param lines : number of lines +** \param out : uint16 containing the trace. +*/ +EXTERN_MATOPS uint16 u16tracea ( uint16* in ,int lines ) ; + + +/* +** \brief Compute the trace of a int8 matrix. +** \param in : input array. +** \param lines : number of lines +** \param out : int8 containing the trace. +*/ +EXTERN_MATOPS int8 i8tracea ( int8* in ,int lines ) ; + + +/* +** \brief Compute the trace of a int16 matrix. +** \param in : input array. +** \param lines : number of lines +** \param out : int16 containing the trace. +*/ +EXTERN_MATOPS int16 i16tracea ( int16* in ,int lines ) ; + + + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/c/matrixOperations/includes/matrixTranspose.h b/src/c/matrixOperations/includes/matrixTranspose.h index 122b618d..7e2acbf1 100644 --- a/src/c/matrixOperations/includes/matrixTranspose.h +++ b/src/c/matrixOperations/includes/matrixTranspose.h @@ -16,6 +16,7 @@ #include "dynlib_matrixoperations.h" #include "floatComplex.h" #include "doubleComplex.h" +#include "types.h" #include #ifdef __cplusplus @@ -54,6 +55,45 @@ EXTERN_MATOPS void ctransposea ( floatComplex* in , int lines1 , int column1, fl */ EXTERN_MATOPS void ztransposea ( doubleComplex* in , int lines1 , int column1, doubleComplex* out ); + +/* +** \brief Compute the transpose of a uint8 matrix. +** \param in : input matrix. +** \param lines1 : number of lines +** \param column1 : number of column1 +** \param out : the transposed uint8 matrix. +*/ +EXTERN_MATOPS void u8transposea ( uint8* in , int lines1 , int column1, uint8* out ); + +/* +** \brief Compute the transpose of a uint16 matrix. +** \param in : input matrix. +** \param lines1 : number of lines +** \param column1 : number of column1 +** \param out : the transposed uint16 matrix. +*/ +EXTERN_MATOPS void u16transposea ( uint16* in , int lines1 , int column1, uint16* out ); + +/* +** \brief Compute the transpose of a int8 matrix. +** \param in : input matrix. +** \param lines1 : number of lines +** \param column1 : number of column1 +** \param out : the transposed int8 matrix. +*/ +EXTERN_MATOPS void i8transposea ( int8* in , int lines1 , int column1, int8* out ); + +/* +** \brief Compute the transpose of a int16 matrix. +** \param in : input matrix. +** \param lines1 : number of lines +** \param column1 : number of column1 +** \param out : the transposed int16 matrix. +*/ +EXTERN_MATOPS void i16transposea ( int16* in , int lines1 , int column1, int16* out ); + + + #ifdef __cplusplus } /* extern "C" */ #endif -- cgit From 3f0575546e66458cb437c9c333c44c227e58b9bc Mon Sep 17 00:00:00 2001 From: imushir Date: Fri, 27 Nov 2015 15:43:45 +0530 Subject: reference for u8 u16 i8 i16 for different combination added --- src/c/matrixOperations/interfaces/int_trace.h | 16 +++++++++++++++- src/c/matrixOperations/interfaces/int_transpose.h | 17 +++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/c/matrixOperations/interfaces/int_trace.h b/src/c/matrixOperations/interfaces/int_trace.h index 8bfea860..58c42991 100644 --- a/src/c/matrixOperations/interfaces/int_trace.h +++ b/src/c/matrixOperations/interfaces/int_trace.h @@ -21,7 +21,13 @@ #define c0tracec0(in) in -#define z0tracez0(in) in +#define u80traceu80(in) (uint8)in + +#define u160traceu160(in) (uint16)in + +#define i80tracei80(in) (int8)in + +#define i160tracei160(in) (int16)in #define s2traces0(in,size) stracea(in, size[0]) @@ -31,4 +37,12 @@ #define z2tracez0(in,size) ztracea(in, size[0]) +#define u82traceu80(in,size) u8tracea(in, size[0]) + +#define u162traceu160(in,size) u16tracea(in, size[0]) + +#define i82tracei80(in,size) i8tracea(in, size[0]) + +#define i162tracei160(in,size) i16trace(in,size[0]) + #endif /* !__INT_TRACE_H__ */ diff --git a/src/c/matrixOperations/interfaces/int_transpose.h b/src/c/matrixOperations/interfaces/int_transpose.h index 250d565f..3fd328f6 100644 --- a/src/c/matrixOperations/interfaces/int_transpose.h +++ b/src/c/matrixOperations/interfaces/int_transpose.h @@ -23,6 +23,14 @@ #define z0transposez0(in) in +#define u80transposeu80(in) (uint8)in + +#define u160transposeu160(in) (uint16)in + +#define i80transposei80(in) (int8)in + +#define i160transposei160(in) (int16)in + #define s2transposes2(in,size,out) stransposea(in, size[0], size[1], out) #define d2transposed2(in,size,out) dtransposea(in, size[0], size[1], out) @@ -31,4 +39,13 @@ #define z2transposez2(in,size,out) ztransposea(in, size[0], size[1], out) + +#define u82transposeu82(in,size,out) u8transposea(in, size[0], size[1], out) + +#define u162transposeu162(in,size,out) u16transposea(in, size[0], size[1], out) + +#define i82transposei82(in,size,out) i8transposea(in, size[0], size[1], out) + +#define i162transposei162(in,size,out) i16transposea(in, size[0], size[1], out) + #endif /* !__INT_TRANSPOSE_H__ */ -- cgit From bdd5b73b966178c4ddad8d331d080e244641b218 Mon Sep 17 00:00:00 2001 From: imushir Date: Fri, 27 Nov 2015 15:46:30 +0530 Subject: added c files for u8 u16 i8 i16 --- src/c/operations/division/cldiva.c | 3 ++- src/c/operations/division/cldiva.c~ | 22 ++++++++++++++++++++++ src/c/operations/division/crdiva.c | 3 ++- src/c/operations/division/crdiva.c~ | 22 ++++++++++++++++++++++ src/c/operations/division/i16ldiva.c | 21 +++++++++++++++++++++ src/c/operations/division/i16ldiva.c~ | 21 +++++++++++++++++++++ src/c/operations/division/i16rdiva.c | 21 +++++++++++++++++++++ src/c/operations/division/i16rdiva.c~ | 21 +++++++++++++++++++++ src/c/operations/division/i8ldiva.c | 21 +++++++++++++++++++++ src/c/operations/division/i8ldiva.c~ | 21 +++++++++++++++++++++ src/c/operations/division/i8rdiva.c | 21 +++++++++++++++++++++ src/c/operations/division/i8rdiva.c~ | 21 +++++++++++++++++++++ src/c/operations/division/u16ldiva.c | 21 +++++++++++++++++++++ src/c/operations/division/u16ldiva.c~ | 21 +++++++++++++++++++++ src/c/operations/division/u16rdiva.c | 21 +++++++++++++++++++++ src/c/operations/division/u16rdiva.c~ | 21 +++++++++++++++++++++ src/c/operations/division/u8ldiva.c | 21 +++++++++++++++++++++ src/c/operations/division/u8ldiva.c~ | 21 +++++++++++++++++++++ src/c/operations/division/u8rdiva .c~ | 21 +++++++++++++++++++++ src/c/operations/division/u8rdiva.c | 21 +++++++++++++++++++++ src/c/operations/division/u8rdiva.c~ | 21 +++++++++++++++++++++ 21 files changed, 405 insertions(+), 2 deletions(-) create mode 100644 src/c/operations/division/cldiva.c~ create mode 100644 src/c/operations/division/crdiva.c~ create mode 100644 src/c/operations/division/i16ldiva.c create mode 100644 src/c/operations/division/i16ldiva.c~ create mode 100644 src/c/operations/division/i16rdiva.c create mode 100644 src/c/operations/division/i16rdiva.c~ create mode 100644 src/c/operations/division/i8ldiva.c create mode 100644 src/c/operations/division/i8ldiva.c~ create mode 100644 src/c/operations/division/i8rdiva.c create mode 100644 src/c/operations/division/i8rdiva.c~ create mode 100644 src/c/operations/division/u16ldiva.c create mode 100644 src/c/operations/division/u16ldiva.c~ create mode 100644 src/c/operations/division/u16rdiva.c create mode 100644 src/c/operations/division/u16rdiva.c~ create mode 100644 src/c/operations/division/u8ldiva.c create mode 100644 src/c/operations/division/u8ldiva.c~ create mode 100644 src/c/operations/division/u8rdiva .c~ create mode 100644 src/c/operations/division/u8rdiva.c create mode 100644 src/c/operations/division/u8rdiva.c~ (limited to 'src') diff --git a/src/c/operations/division/cldiva.c b/src/c/operations/division/cldiva.c index 21d95e31..73b94f28 100644 --- a/src/c/operations/division/cldiva.c +++ b/src/c/operations/division/cldiva.c @@ -15,7 +15,8 @@ void cldiva (floatComplex* in1, floatComplex* in2, int size, floatComplex* out ){ int i=0; - for (i=0;i #include "pow.h" -double dpows(double x, double p) { +double dpows(double x, double p) +{ return pow(x, p); } diff --git a/src/c/elementaryFunctions/pow/dpows.c~ b/src/c/elementaryFunctions/pow/dpows.c~ new file mode 100644 index 00000000..cce89196 --- /dev/null +++ b/src/c/elementaryFunctions/pow/dpows.c~ @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +double dpows(double x, double p) +{ + return pow(x, p); +} diff --git a/src/c/elementaryFunctions/pow/i16powa.c b/src/c/elementaryFunctions/pow/i16powa.c new file mode 100644 index 00000000..e8e87fd3 --- /dev/null +++ b/src/c/elementaryFunctions/pow/i16powa.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +void i16powa(int16* x, int size, int16* power, int16 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = i16pows(x[i], power[i]); + } +} diff --git a/src/c/elementaryFunctions/pow/i16powa.c~ b/src/c/elementaryFunctions/pow/i16powa.c~ new file mode 100644 index 00000000..e8e87fd3 --- /dev/null +++ b/src/c/elementaryFunctions/pow/i16powa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +void i16powa(int16* x, int size, int16* power, int16 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = i16pows(x[i], power[i]); + } +} diff --git a/src/c/elementaryFunctions/pow/i16pows.c b/src/c/elementaryFunctions/pow/i16pows.c new file mode 100644 index 00000000..c8068c75 --- /dev/null +++ b/src/c/elementaryFunctions/pow/i16pows.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +int16 i16pows(int16 x, int16 p) { + return pow(x, p); +} diff --git a/src/c/elementaryFunctions/pow/i16pows.c~ b/src/c/elementaryFunctions/pow/i16pows.c~ new file mode 100644 index 00000000..c8068c75 --- /dev/null +++ b/src/c/elementaryFunctions/pow/i16pows.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +int16 i16pows(int16 x, int16 p) { + return pow(x, p); +} diff --git a/src/c/elementaryFunctions/pow/i8powa.c b/src/c/elementaryFunctions/pow/i8powa.c new file mode 100644 index 00000000..e17b666d --- /dev/null +++ b/src/c/elementaryFunctions/pow/i8powa.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +void i8powa(int8* x, int size, int8* power, int8 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = i8pows(x[i], power[i]); + } +} diff --git a/src/c/elementaryFunctions/pow/i8powa.c~ b/src/c/elementaryFunctions/pow/i8powa.c~ new file mode 100644 index 00000000..e17b666d --- /dev/null +++ b/src/c/elementaryFunctions/pow/i8powa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +void i8powa(int8* x, int size, int8* power, int8 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = i8pows(x[i], power[i]); + } +} diff --git a/src/c/elementaryFunctions/pow/i8pows.c b/src/c/elementaryFunctions/pow/i8pows.c new file mode 100644 index 00000000..3566c417 --- /dev/null +++ b/src/c/elementaryFunctions/pow/i8pows.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +int8 i8pows(int8 x, int8 p) { + return pow(x, p); +} diff --git a/src/c/elementaryFunctions/pow/i8pows.c~ b/src/c/elementaryFunctions/pow/i8pows.c~ new file mode 100644 index 00000000..3566c417 --- /dev/null +++ b/src/c/elementaryFunctions/pow/i8pows.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +int8 i8pows(int8 x, int8 p) { + return pow(x, p); +} diff --git a/src/c/elementaryFunctions/pow/u16powa.c b/src/c/elementaryFunctions/pow/u16powa.c new file mode 100644 index 00000000..65ba77e7 --- /dev/null +++ b/src/c/elementaryFunctions/pow/u16powa.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +void u16powa(uint16* x, int size, uint16* power, uint16 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = u16pows(x[i], power[i]); + } +} diff --git a/src/c/elementaryFunctions/pow/u16powa.c~ b/src/c/elementaryFunctions/pow/u16powa.c~ new file mode 100644 index 00000000..65ba77e7 --- /dev/null +++ b/src/c/elementaryFunctions/pow/u16powa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +void u16powa(uint16* x, int size, uint16* power, uint16 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = u16pows(x[i], power[i]); + } +} diff --git a/src/c/elementaryFunctions/pow/u16pows.c b/src/c/elementaryFunctions/pow/u16pows.c new file mode 100644 index 00000000..34672b0f --- /dev/null +++ b/src/c/elementaryFunctions/pow/u16pows.c @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +uint16 u16pows(uint16 x, uint16 p) { + return pow(x, p); +} diff --git a/src/c/elementaryFunctions/pow/u16pows.c~ b/src/c/elementaryFunctions/pow/u16pows.c~ new file mode 100644 index 00000000..34672b0f --- /dev/null +++ b/src/c/elementaryFunctions/pow/u16pows.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +uint16 u16pows(uint16 x, uint16 p) { + return pow(x, p); +} diff --git a/src/c/elementaryFunctions/pow/u8powa.c b/src/c/elementaryFunctions/pow/u8powa.c new file mode 100644 index 00000000..b69431c7 --- /dev/null +++ b/src/c/elementaryFunctions/pow/u8powa.c @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +void u8powa(uint8* x, int size, uint8* power, uint8 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = u8pows(x[i], power[i]); + } +} diff --git a/src/c/elementaryFunctions/pow/u8powa.c~ b/src/c/elementaryFunctions/pow/u8powa.c~ new file mode 100644 index 00000000..b69431c7 --- /dev/null +++ b/src/c/elementaryFunctions/pow/u8powa.c~ @@ -0,0 +1,25 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +void u8powa(uint8* x, int size, uint8* power, uint8 *out) { + /* + Computes Scilab x.^power + Computes power element by element + x and power must have same size + */ + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = u8pows(x[i], power[i]); + } +} diff --git a/src/c/elementaryFunctions/pow/u8pows.c b/src/c/elementaryFunctions/pow/u8pows.c new file mode 100644 index 00000000..786b9194 --- /dev/null +++ b/src/c/elementaryFunctions/pow/u8pows.c @@ -0,0 +1,19 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +uint8 u8pows(uint8 x, uint8 p) +{ + return pow(x, p); +} diff --git a/src/c/elementaryFunctions/pow/u8pows.c~ b/src/c/elementaryFunctions/pow/u8pows.c~ new file mode 100644 index 00000000..4b5042ff --- /dev/null +++ b/src/c/elementaryFunctions/pow/u8pows.c~ @@ -0,0 +1,18 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * 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 + * 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 "pow.h" + +uint8 u8pows(uint8 x, uint8 p) { + return pow(x, p); +} diff --git a/src/c/elementaryFunctions/pow/zpows.c b/src/c/elementaryFunctions/pow/zpows.c index 1a7059b2..4fe771ab 100644 --- a/src/c/elementaryFunctions/pow/zpows.c +++ b/src/c/elementaryFunctions/pow/zpows.c @@ -14,7 +14,7 @@ #include "log.h" #include "exp.h" -doubleComplex zpows(doubleComplex z, doubleComplex power) { +doubleComplex zpows(doubleComplex z, doubleComplex power) { /*Cas z=0 */ if ( (zreals(z)==0) && (zimags(z)==0) ){ /* Cas 0^0 */ diff --git a/src/c/elementaryFunctions/pow/zpows.c~ b/src/c/elementaryFunctions/pow/zpows.c~ new file mode 100644 index 00000000..1a7059b2 --- /dev/null +++ b/src/c/elementaryFunctions/pow/zpows.c~ @@ -0,0 +1,28 @@ +/* + * 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 + * + */ + +#include "pow.h" +#include "log.h" +#include "exp.h" + +doubleComplex zpows(doubleComplex z, doubleComplex power) { + /*Cas z=0 */ + if ( (zreals(z)==0) && (zimags(z)==0) ){ + /* Cas 0^0 */ + if ( (zreals(power)==0) && (zimags(power)==0) ) return DoubleComplex(1,0); + /* Cas 0^x, x!=0 */ + return DoubleComplex(0,0); + } + + /* Cas z!=0 */ + return zexps(zmuls(zlogs(z), power)); +} -- cgit From 1d9579578ebde88d3c276825ac1145817c5d0128 Mon Sep 17 00:00:00 2001 From: imushir Date: Fri, 27 Nov 2015 15:58:35 +0530 Subject: #define for u8 u16 i8 i16 added --- src/c/elementaryFunctions/includes/pow.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/c/elementaryFunctions/includes/pow.h b/src/c/elementaryFunctions/includes/pow.h index ec8216d8..de1eb409 100644 --- a/src/c/elementaryFunctions/includes/pow.h +++ b/src/c/elementaryFunctions/includes/pow.h @@ -27,6 +27,14 @@ EXTERN_ELEMFUNCT floatComplex cpows(floatComplex value, floatComplex expand); EXTERN_ELEMFUNCT doubleComplex zpows(doubleComplex value, doubleComplex expand); +EXTERN_ELEMFUNCT uint8 u8pows(uint8 value, uint8 expand); + +EXTERN_ELEMFUNCT uint16 u16pows(uint16 value, uint16 expand); + +EXTERN_ELEMFUNCT int8 i8pows(int8 value, int8 expand); + +EXTERN_ELEMFUNCT int16 i16pows(int16 value, int16 expand); + EXTERN_ELEMFUNCT void spowa(float *value, int size, float* expand, float *out); EXTERN_ELEMFUNCT void dpowa(double *value, int size, double* expand, double *out); @@ -35,6 +43,14 @@ EXTERN_ELEMFUNCT void cpowa(floatComplex *value, int size, floatComplex* expand EXTERN_ELEMFUNCT void zpowa(doubleComplex *value, int size, doubleComplex* expand, doubleComplex *out); +EXTERN_ELEMFUNCT void u8powa(uint8 *value, int size, uint8* expand, uint8 *out); + +EXTERN_ELEMFUNCT void u16powa(uint16 *value, int size, uint16* expand, uint16 *out); + +EXTERN_ELEMFUNCT void i8powa(int8 *value, int size, int8* expand, int8 *out); + +EXTERN_ELEMFUNCT void i16powa(int16 *value, int size, int16* expand, int16 *out); + #ifdef __cplusplus } /* extern "C" */ #endif -- cgit From 342decd91b6c88fc1cc3bd1bf8983989122705f9 Mon Sep 17 00:00:00 2001 From: imushir Date: Fri, 27 Nov 2015 16:00:40 +0530 Subject: reference for u8 u16 i8 i16 for different combination added --- .../elementaryFunctions/interfaces/int_OpDotHat.h | 65 ++++++++++++++++++++++ src/c/elementaryFunctions/interfaces/int_OpHat.h | 43 ++++++++++++++ 2 files changed, 108 insertions(+) (limited to 'src') diff --git a/src/c/elementaryFunctions/interfaces/int_OpDotHat.h b/src/c/elementaryFunctions/interfaces/int_OpDotHat.h index 8e5c7042..2444f100 100644 --- a/src/c/elementaryFunctions/interfaces/int_OpDotHat.h +++ b/src/c/elementaryFunctions/interfaces/int_OpDotHat.h @@ -25,6 +25,14 @@ #define z0z0OpDotHatz0(in1, in2) zpows(in1, in2) +#define u80u80OpDotHatu80(in1, in2) u8pows(in1, in2) + +#define u160u160OpDotHatu160(in1, in2) u16pows(in1, in2) + +#define i80i80OpDotHati80(in1, in2) i8pows(in1, in2) + +#define i160i160OpDotHati60(in1, in2) i16pows(in1, in2) + #define s0c0OpDotHatc0(in1, in2) cpows(FloatComplex(in1,0), in2) #define c0s0OpDotHatc0(in1, in2) cpows(in1, FloatComplex(in2,0)) @@ -53,6 +61,20 @@ for (i=0;i