diff options
Diffstat (limited to 'src/c/elementaryFunctions/nanmax')
-rw-r--r-- | src/c/elementaryFunctions/nanmax/dnanmaxa.c | 53 | ||||
-rw-r--r-- | src/c/elementaryFunctions/nanmax/dnanmaxcola.c | 35 | ||||
-rw-r--r-- | src/c/elementaryFunctions/nanmax/dnanmaxrowa.c | 36 | ||||
-rw-r--r-- | src/c/elementaryFunctions/nanmax/snanmaxa.c | 53 | ||||
-rw-r--r-- | src/c/elementaryFunctions/nanmax/snanmaxcola.c | 35 | ||||
-rw-r--r-- | src/c/elementaryFunctions/nanmax/snanmaxrowa.c | 36 | ||||
-rw-r--r-- | src/c/elementaryFunctions/nanmax/znanmaxa.c | 57 | ||||
-rw-r--r-- | src/c/elementaryFunctions/nanmax/znanmaxcola.c | 36 | ||||
-rw-r--r-- | src/c/elementaryFunctions/nanmax/znanmaxrowa.c | 37 |
9 files changed, 378 insertions, 0 deletions
diff --git a/src/c/elementaryFunctions/nanmax/dnanmaxa.c b/src/c/elementaryFunctions/nanmax/dnanmaxa.c new file mode 100644 index 0000000..4ff4a1a --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/dnanmaxa.c @@ -0,0 +1,53 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nanmax.h" +#include "types.h" +double dnanmaxa(double* in, int size) +{ +double high; +for(int i=0; i<size; i++) +{ + if( !(isnan(in[i])) ) + { + high= in[i]; + break; + + } +} + + + + for(int i=0; i< size; i++) + { + if( !(isnan(in[i])) ) + { + if( in[i] > high) + { + high= in[i]; + + } + + + } + + + } + + + +return high; + +} diff --git a/src/c/elementaryFunctions/nanmax/dnanmaxcola.c b/src/c/elementaryFunctions/nanmax/dnanmaxcola.c new file mode 100644 index 0000000..9db0742 --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/dnanmaxcola.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" + +void dnanmaxcola(double *in, int row, int col, double* out) +{ + double inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= dnanmaxa( inter, col); + + } + + +} diff --git a/src/c/elementaryFunctions/nanmax/dnanmaxrowa.c b/src/c/elementaryFunctions/nanmax/dnanmaxrowa.c new file mode 100644 index 0000000..191fa01 --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/dnanmaxrowa.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" + +void dnanmaxrowa(double *in, int row, int col, double* out) +{ + double inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= dnanmaxa( inter, row); + + } + + +} diff --git a/src/c/elementaryFunctions/nanmax/snanmaxa.c b/src/c/elementaryFunctions/nanmax/snanmaxa.c new file mode 100644 index 0000000..1eab1ac --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/snanmaxa.c @@ -0,0 +1,53 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nanmax.h" +#include "types.h" +float snanmaxa(float* in, int size) +{ +float high; +for(int i=0; i<size; i++) +{ + if( !(isnan(in[i])) ) + { + high= in[i]; + break; + + } +} + + + + for(int i=0; i< size; i++) + { + if( !(isnan(in[i])) ) + { + if( in[i] > high) + { + high= in[i]; + + } + + + } + + + } + + + +return high; + +} diff --git a/src/c/elementaryFunctions/nanmax/snanmaxcola.c b/src/c/elementaryFunctions/nanmax/snanmaxcola.c new file mode 100644 index 0000000..b408052 --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/snanmaxcola.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" + +void snanmaxcola(float *in, int row, int col, float* out) +{ + float inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= snanmaxa( inter, col); + + } + + +} diff --git a/src/c/elementaryFunctions/nanmax/snanmaxrowa.c b/src/c/elementaryFunctions/nanmax/snanmaxrowa.c new file mode 100644 index 0000000..ab1ce0c --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/snanmaxrowa.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" + +void snanmaxrowa(float *in, int row, int col, float* out) +{ + float inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= snanmaxa( inter, row); + + } + + +} diff --git a/src/c/elementaryFunctions/nanmax/znanmaxa.c b/src/c/elementaryFunctions/nanmax/znanmaxa.c new file mode 100644 index 0000000..6283bf1 --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/znanmaxa.c @@ -0,0 +1,57 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include "nanmax.h" +#include "types.h" +#include "doubleComplex.h" +#include "abs.h" + +doubleComplex znanmaxa(doubleComplex* in, int size) +{ +doubleComplex high=0; int k=0; +for(int i=0; i<size; i++) +{ + if( !(isnan(in[i])) ) + { + high= in[i]; + break; + k= 1; + } +} + + + + for(int i=0; i< size; i++) + { + if( !(isnan(in[i])) ) + { + if( zabss(in[i]) > zabss(high)) + { + high= in[i]; + + } + + + } + + + } + + +if(k != 0) +return high; +else +return - 0.0/0.0; +} diff --git a/src/c/elementaryFunctions/nanmax/znanmaxcola.c b/src/c/elementaryFunctions/nanmax/znanmaxcola.c new file mode 100644 index 0000000..ffb96b2 --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/znanmaxcola.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" + +void znanmaxcola(doubleComplex *in, int row, int col, doubleComplex* out) +{ + doubleComplex inter[col]; + + +for(int i=0; i< row; i++) + { + for(int j=0 ; j< col; j++) + { + inter[j]= in[i+ (j*row)]; + + } + out[i]= znanmaxa( inter, col); + + } + + +} diff --git a/src/c/elementaryFunctions/nanmax/znanmaxrowa.c b/src/c/elementaryFunctions/nanmax/znanmaxrowa.c new file mode 100644 index 0000000..e035e77 --- /dev/null +++ b/src/c/elementaryFunctions/nanmax/znanmaxrowa.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Abhinav Dronamraju + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "nanmax.h" +#include "types.h" +#include "uint16.h" +#include "doubleComplex.h" + +void znanmaxrowa(doubleComplex *in, int row, int col, doubleComplex* out) +{ + doubleComplex inter[row]; + + + +for(int i=0; i< col; i++) + { + for(int j=0 ; j< row; j++) + { + inter[j]= in[j+ (i*row)]; + + } + out[i]= znanmaxa( inter, row); + + } + + +} |